Bug 428064 - "hts certify --test info" fails on RHEL4.6
Summary: "hts certify --test info" fails on RHEL4.6
Keywords:
Status: CLOSED DUPLICATE of bug 410921
Alias: None
Product: Red Hat Hardware Certification Program
Classification: Retired
Component: Test Suite (tests)
Version: 5
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Greg Nichols
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-08 23:27 UTC by Scott Scriven
Modified: 2008-07-16 21:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-09 02:15:33 UTC
Embargoed:


Attachments (Terms of Use)
info.py.patch (1.38 KB, text/plain)
2008-01-08 23:36 UTC, Scott Scriven
no flags Details

Description Scott Scriven 2008-01-08 23:27:18 UTC
Description of problem:
On RHEL4.6, hts cannot correctly identify the kernel RPM name.  It claims the 
kernel was not built by Red Hat, because of a bug in the "info" test.

How reproducible: always

Steps to Reproduce:
1. Install RHEL4.6.
2. Install hts-5.1-16.el4
3. Run "hts plan" then "hts certify --test info".

Actual results:
The cert test claims the kernel was not built by Red Hat.

Expected results:
Kernel correctly identified.

Additional info:
The source uses string.strip() as if strings were mutable, but they are not.  It 
returns a stripped copy, but does not strip strings in-place.  However, the 
block of code is completely unneeded; it duplicates a call just a few lines 
earlier.

--- info.py.orig 2008-01-08 22:13:06.000000000 -0700
+++ info.py 2008-01-08 22:40:16.000000000 -0700
@@ -45,16 +45,10 @@
        self.arch = uname.readline()[:-1]
        uname.close()
        
-        uname = os.popen("uname -r")
-        unameOutput = uname.readline()
-        if not unameOutput:
-            print "Error: uname failed"
-        unameOutput.strip()
-        
        self.kernelRPMName = None
        if self.osVersion == Constants.RHEL4:
            pattern = re.compile("(?P<versionRelease>[^a-z]*)(?P<name>smp|
hugemem|lar gesmp)?$")
-            match = pattern.search(unameOutput)
+            match = pattern.search(self.kernel)
            if match:
                # if the release ends with ELsmp, ELhugemem, or ELlargesmp
                if match.group("name"):
@@ -64,7 +58,7 @@

        else:   # RHEL5 and ?                                           
            pattern = re.compile("(?P<versionRelease>[^a-z]*)(?P<product>el5)(?
P<f lavor>xen|PAE)?$")
-            match = pattern.search(unameOutput)
+            match = pattern.search(self.kernel)
            if match:
                flavor = ""
                if match.group("flavor"):
@@ -75,8 +69,6 @@
            print "Error: could not determine kernel RPM name"
            self.kernelRPMName = None
        
-        uname.close()
-        
   
    def checkKernel(self):
        # print kernel info

Comment 1 Scott Scriven 2008-01-08 23:36:46 UTC
Created attachment 291103 [details]
info.py.patch

The magic of line wrap (unsurprisingly) created a broken patch.  The changes
are simple enough it probably doesn't matter, but for completeness' sake,
here's a correct patch.

Comment 2 Greg Nichols 2008-01-09 02:15:33 UTC

*** This bug has been marked as a duplicate of 410921 ***


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