Bug 734985 - info: TypeError: coercing to Unicode: need string or buffer, NoneType found
Summary: info: TypeError: coercing to Unicode: need string or buffer, NoneType found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Hardware Certification Program
Classification: Red Hat
Component: Test Suite (tests)
Version: 1.3
Hardware: All
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Greg Nichols
QA Contact: Caspar Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-01 04:14 UTC by Caspar Zhang
Modified: 2013-07-03 07:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In v7 1.3, sometimes v7 info test got a traceback when testing with 3rd-party modules. This issue has been fixed in v7 1.4, now no such traceback is printed in v7 info test.
Clone Of:
Environment:
Last Closed: 2011-11-08 15:44:30 UTC
Target Upstream Version:


Attachments (Terms of Use)
proposed patch (457 bytes, patch)
2011-09-01 04:14 UTC, Caspar Zhang
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1436 normal SHIPPED_LIVE v7 bug fix and enhancement update 2011-11-08 23:28:41 UTC

Description Caspar Zhang 2011-09-01 04:14:18 UTC
Created attachment 520948 [details]
proposed patch

Description of problem:

When Guangze executing info test (with a non-redhat module inserted), the following traceback displayed:

Subtest: Modules - Check kernel modules
checking modules...
Error: Non-Red Hat driver vendor The ELRepo Project (http://elrepo.org) for module ac97_bus
Error: Driver module ac97_bus was built on Build64R6.elrepo.org and not built at Red Hat.
Red Hat Enterprise Linux 6 ABI
--------------------------------

Module: ac97_bus
Kernel: 2.6.32-71.el6.x86_64
Whitelist: /lib/modules/kabi/kabi_whitelist_x86_64

Note: ac97_bus seems to use only official ABI.

Error: could not determine driver packaging info for module snd_hda_codec_nvhdmi
"rpm -qf None --qf %{VENDOR}" no match for regular expression None
Red Hat Enterprise Linux 6 ABI
--------------------------------

Module: snd_hda_codec_nvhdmi
Kernel: 2.6.32-71.el6.x86_64
Whitelist: /lib/modules/kabi/kabi_whitelist_x86_64

Traceback (most recent call last):
  File "/usr/bin/v7", line 45, in <module>
    success = v7.do(args)
  File "/usr/share/v7/lib/v7/hardwaretest.py", line 193, in do
    result = self.commands[self.command]()
  File "/usr/share/v7/lib/v7/hardwaretest.py", line 612, in doRun
    return self._doRun(tests)      
  File "/usr/share/v7/lib/v7/hardwaretest.py", line 715, in _doRun
    returnValue = self.runTest(tmpDirectory, test, run, outputFilePath)
  File "/usr/share/v7/lib/v7/hardwaretest.py", line 1130, in runTest
    rv = test.run()
  File "/usr/share/v7/tests/info/info.py", line 433, in run
    if not self.runSubTest(self.checkModules, name="Modules", description="Check kernel modules"):
  File "/usr/share/v7/lib/v7/test.py", line 428, in runSubTest
    result = subtestFunction()
  File "/usr/share/v7/tests/info/info.py", line 202, in checkModules
    self.abiCheck(module)
  File "/usr/share/v7/tests/info/info.py", line 344, in abiCheck
    moduleSymbols = self.readModule(module)
  File "/usr/share/v7/tests/info/info.py", line 277, in readModule
    if not os.path.isfile(moduleFile):
  File "/usr/lib64/python2.6/genericpath.py", line 29, in isfile
    st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found

So far we both couldn't reproduce it, but we do have a simple fix for it.

diff --git a/tests/info/info.py b/tests/info/info.py
index 94b9b9b..c3c1316 100644
--- a/tests/info/info.py
+++ b/tests/info/info.py
@@ -274,7 +274,7 @@ class InfoTest(Test):
         symbols = list()
         moduleFile = self.getModuleFile(module)
 
-        if not os.path.isfile(moduleFile):
+        if not moduleFile or not os.path.isfile(moduleFile):
             print "Error: Cannot read module file %s" % moduleFile
             return None

since the parameter passed to os.path.isfile() couldn't be None, we could add one more check point.

Version-Release number of selected component (if applicable):
1.4 R18

How reproducible:
only once

Steps to Reproduce:
1. Unclear
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 3 Caspar Zhang 2011-10-21 16:25:24 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
In v7 1.3, sometimes v7 info test got a traceback when testing with 3rd-party modules. This issue has been fixed in v7 1.4, now no such traceback is printed in v7 info test.

Comment 5 errata-xmlrpc 2011-11-08 15:44:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1436.html

Comment 6 errata-xmlrpc 2011-11-08 18:33:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1436.html


Note You need to log in before you can comment on or make changes to this bug.