[nSLUG] Improving QA of Linux distributions

D G Teed donald.teed at gmail.com
Fri Jun 24 16:51:48 ADT 2011


On Fri, Jun 24, 2011 at 4:30 PM, Peter Dobcsanyi <petrus at ftml.net> wrote:

> On Fri, Jun 24, 2011 at 12:36:54PM -0300, D G Teed wrote:
> > I would think everyone who is writing code (say at Redhat, in this case
> > of not testing for a file before opening) is aware of things they teach
> in
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > a first year programming course.
>
> Could you, please, explain what kind of "testing" you have in mind and
> why that would be beneficial.
>
>
I checked my email history and my memory was slightly off.
In the problem I encountered, the file existed, but it was empty.

When yum was run with any arguments, it crapped out with a backtrace:

yum help
Loading "rhnplugin" plugin
Loading "security" plugin
Loading "dellsysidplugin" plugin
Traceback (most recent call last):
 File "/usr/bin/yum", line 29, in ?
   yummain.main(sys.argv[1:])
 File "/usr/share/yum-cli/yummain.py", line 85, in main
   base.getOptionsConfig(args)
 File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
   disabled_plugins=self.optparser._splitArg(opts.disableplugins))
 File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 183,
in _getConfig
   self.plugins.run('init')
 File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 169, in run
   func(conduitcls(self, self.base, conf, **kwargs))
 File "/usr/lib/yum-plugins/rhnplugin.py", line 110, in init_hook
   login_info = up2dateAuth.getLoginInfo()
 File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 211, in
getLoginInfo
   login()
 File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 159, in login
   if readCachedLogin():
 File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 120, in
readCachedLogin
   data = pickle.load(pcklAuth)
 File "/usr/lib64/python2.4/pickle.py", line 1390, in load
   return Unpickler(file).load()
 File "/usr/lib64/python2.4/pickle.py", line 872, in load
   dispatch[key](self)
 File "/usr/lib64/python2.4/pickle.py", line 894, in load_eof
   raise EOFError
EOFError


The source of this problem was that /var/spool/up2date/loginAuth.pkl
was an empty file.  This wasn't at all obvious in the errors.
This could have been recovered more gracefully by testing
for error after a read from the file.  Of course there was some other
bug present which wiped it empty but I never saw it happen again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/mailman/private/nslug/attachments/20110624/01cccfc9/attachment-0002.html>


More information about the nSLUG mailing list