This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 428064 - "hts certify --test info" fails on RHEL4.6
"hts certify --test info" fails on RHEL4.6
Status: CLOSED DUPLICATE of bug 410921
Product: Red Hat Hardware Certification Program
Classification: Red Hat
Component: Test Suite (tests) (Show other bugs)
5
All Linux
low Severity medium
: ---
: ---
Assigned To: Greg Nichols
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-08 18:27 EST by Scott Scriven
Modified: 2008-07-16 17:59 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-08 21:15:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Scott Scriven 2008-01-08 18:27:18 EST
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 18:36:46 EST
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-08 21:15:33 EST

*** 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.