Author: gnichols
Date: 2012-03-27 19:47:25 +0000 (Tue, 27 Mar 2012)
New Revision: 1243
Modified:
trunk/tests/info/info.py
Log:
781243 - v7 info fails to capture modules tainted for multiple signs\n 784419 - FEAT: v7
should not error on DUP graylist symbols
Modified: trunk/tests/info/info.py
===================================================================
--- trunk/tests/info/info.py 2012-03-23 14:53:39 UTC (rev 1242)
+++ trunk/tests/info/info.py 2012-03-27 19:47:25 UTC (rev 1243)
@@ -78,7 +78,7 @@
success = False
if tainted & Constants.TAINT_TECHPREVIEW_MODULE:
- modules = Command("cat /proc/modules").getStringList(regex
= "^(?P<mod_name>\w+)[\s\S]+\(T\)", regexGroup = "mod_name")
+ modules = self.getTaintedModules("T")
badModules = list()
for module in modules:
if not module in self.techPreviewModuleWhitelist:
@@ -90,7 +90,7 @@
print module
if tainted & Constants.TAINT_UNSIGNED_MODULE:
- modules = Command("cat /proc/modules").getStringList(regex
= "^[\s\S]+\(U\)")
+ modules = self.getTaintedModules("U")
print "Unsigned modules:"
for module in modules:
print module
@@ -124,6 +124,19 @@
return success
+ def getTaintedModules(self, sign):
+ pattern =
re.compile("^(?P<mod_name>\w+)[\s\S]+\((?P<signs>[A-Z]+)\)")
+ procModules = open("/proc/modules")
+ modules = list()
+ for line in procModules.readlines():
+ match = pattern.match(line)
+ if match:
+ if sign in match.group("signs"):
+ modules.append(match.group("mod_name"))
+ procModules.close()
+ return modules
+
+
def checkKernelIsGA(self):
if "Red Hat"not in self.redHatRelease.getProduct() or
self.redHatRelease.getVersion() < 5:
@@ -441,10 +454,26 @@
if not moduleSymbols:
return False
extraSymbols = self.abiCheckSymbols(whitelistSymbols, moduleSymbols)
+
+ # check for a DUP greylist
+ if extraSymbols != []:
+ greylist = "/usr/share/doc/kmod-%s/greylist.txt" % module
+ if os.path.exists(greylist):
+ print "checking greylist for %s" % module
+ greylistSymbols = self.readABIWhitelist(greylist)
+ extraSymbols = self.abiCheckSymbols(greylistSymbols, extraSymbols)
+
+ elif self.debug != Constants.off:
+ print "%s has no greylist %s" % (module, greylist)
if extraSymbols != []:
- print "Error: The following symbols are used by %s are not on the ABI
whitelist." % module
+ message = "Error: The following symbols are used by %s are not on the
ABI whitelist" % module
+ if os.path.exists(greylist):
+ message += " or DUP greylist."
+ else:
+ message += "."
+ print message
print ""
for symbol in extraSymbols:
print symbol
Show replies by date