Blob Blame History Raw
commit 66ce1d4adc73cbe18b2ffac9d95efd820cf3ca44
Author: Nathan Scott <nathans@redhat.com>
Date:   Fri Feb 21 13:29:44 2014 +1100

    Make test qa/750 deterministic, remove hard-wired hostname

diff --git a/qa/750 b/qa/750
index 1922722..94ac5ee 100755
--- a/qa/750
+++ b/qa/750
@@ -29,8 +29,9 @@ trap "_rpm_cleanup" 0 1 2 3 15
 filter_pmval()
 {
     sed \
-	-e "s/\"$hostname\"/\"BUILDHOST\"/g" \
+	-e "s/^ *\"$hostname\"/\"BUILDHOST\"/g" \
 	-e 's/^ [0-9][0-9]* $/ TIMESTAMP /g' \
+	-e "s/^host:      $hostname$/host:      HOST/g" \
     # end
 }
 
diff --git a/qa/750.out.1 b/qa/750.out.1
index acdbe0b..cbfb16b 100644
--- a/qa/750.out.1
+++ b/qa/750.out.1
@@ -3,7 +3,7 @@ Preparing RPM package
 Installing qaplayer
 
 metric:    rpm.arch
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -12,16 +12,16 @@ samples:   1
              "noarch" 
 
 metric:    rpm.buildhost
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
 
              qaplayer 
-              "BUILDHOST" 
+"BUILDHOST" 
 
 metric:    rpm.buildtime
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     sec
 samples:   1
@@ -30,7 +30,7 @@ samples:   1
  TIMESTAMP 
 
 metric:    rpm.description
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -43,7 +43,7 @@ oversampling.  This leads to sound quality that
 cannot be equaled with more mundane software..." 
 
 metric:    rpm.epoch
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -52,7 +52,7 @@ samples:   1
           0 
 
 metric:    rpm.group
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -61,7 +61,7 @@ samples:   1
  "Applications/Sound" 
 
 metric:    rpm.installtime
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     sec
 samples:   1
@@ -70,7 +70,7 @@ samples:   1
  TIMESTAMP 
 
 metric:    rpm.license
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -79,7 +79,7 @@ samples:   1
                 "GPL" 
 
 metric:    rpm.packager
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -88,7 +88,7 @@ samples:   1
 "Santa Claus <sclaus@northpole.com>" 
 
 metric:    rpm.release
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -97,7 +97,7 @@ samples:   1
                   "1" 
 
 metric:    rpm.size
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     byte
 samples:   1
@@ -106,7 +106,7 @@ samples:   1
           0 
 
 metric:    rpm.sourcerpm
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -115,7 +115,7 @@ samples:   1
 "qaplayer-1.0-1.src.rpm" 
 
 metric:    rpm.summary
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -124,7 +124,7 @@ samples:   1
 "A QA player app that rocks!" 
 
 metric:    rpm.url
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -133,7 +133,7 @@ samples:   1
 "http://www.gnomovision.com/qaplayer/qaplayer.html" 
 
 metric:    rpm.vendor
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -142,7 +142,7 @@ samples:   1
 "White Socks Software, Inc." 
 
 metric:    rpm.version
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
diff --git a/qa/750.out.2 b/qa/750.out.2
index ce6efac..a7b082d 100644
--- a/qa/750.out.2
+++ b/qa/750.out.2
@@ -3,7 +3,7 @@ Preparing RPM package
 Installing qaplayer
 
 metric:    rpm.arch
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -12,16 +12,16 @@ qaplayer-1.0-1.noarch
              "noarch" 
 
 metric:    rpm.buildhost
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
 
 qaplayer-1.0-1.noarch 
-              "BUILDHOST" 
+"BUILDHOST" 
 
 metric:    rpm.buildtime
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     sec
 samples:   1
@@ -31,7 +31,7 @@ qaplayer-1.
  TIMESTAMP 
 
 metric:    rpm.description
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -44,7 +44,7 @@ oversampling.  This leads to sound quality that
 cannot be equaled with more mundane software..." 
 
 metric:    rpm.epoch
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -54,7 +54,7 @@ qaplayer-1.
           0 
 
 metric:    rpm.group
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -63,7 +63,7 @@ qaplayer-1.0-1.noarch
  "Applications/Sound" 
 
 metric:    rpm.installtime
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     sec
 samples:   1
@@ -73,7 +73,7 @@ qaplayer-1.
  TIMESTAMP 
 
 metric:    rpm.license
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -82,7 +82,7 @@ qaplayer-1.0-1.noarch
                 "GPL" 
 
 metric:    rpm.packager
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -91,7 +91,7 @@ qaplayer-1.0-1.noarch
 "Santa Claus <sclaus@northpole.com>" 
 
 metric:    rpm.release
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -100,7 +100,7 @@ qaplayer-1.0-1.noarch
                   "1" 
 
 metric:    rpm.size
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     byte
 samples:   1
@@ -110,7 +110,7 @@ qaplayer-1.
           0 
 
 metric:    rpm.sourcerpm
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -119,7 +119,7 @@ qaplayer-1.0-1.noarch
 "qaplayer-1.0-1.src.rpm" 
 
 metric:    rpm.summary
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -128,7 +128,7 @@ qaplayer-1.0-1.noarch
 "A QA player app that rocks!" 
 
 metric:    rpm.url
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -137,7 +137,7 @@ qaplayer-1.0-1.noarch
 "http://www.gnomovision.com/qaplayer/qaplayer.html" 
 
 metric:    rpm.vendor
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -146,7 +146,7 @@ qaplayer-1.0-1.noarch
 "White Socks Software, Inc." 
 
 metric:    rpm.version
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
@@ -155,7 +155,7 @@ qaplayer-1.0-1.noarch
                 "1.0" 
 
 metric:    rpm.name
-host:      smash
+host:      HOST
 semantics: instantaneous value
 units:     none
 samples:   1
commit 13a5562e18910ecffaba5b60f3b7adc5a01d7e56
Author: Nathan Scott <nathans@redhat.com>
Date:   Fri Feb 21 14:11:51 2014 +1100

    Extend qa/003 filter for non-x86 hosts, with less cpuinfo

diff --git a/qa/003 b/qa/003
index e0cffa7..b83a63f 100755
--- a/qa/003
+++ b/qa/003
@@ -54,6 +54,7 @@ linux_filter()
     sed \
 	-e "/filesys\.readonly: $unknown/d" \
 	-e "/hinv\.nlv: $unavailable/d" \
+	-e "/hinv\.cpu\..*: $unavailable/d" \
 	-e "/kernel\.pernode..*: $unavailable/d" \
 	-e "/mem\.util\.active_anon: $unavailable/d" \
 	-e "/mem\.util\.active_file: $unavailable/d" \
commit ec0ab978a71c12d9ce14d2a1ad51eb944e3e0e7d
Author: Nathan Scott <nathans@redhat.com>
Date:   Wed Feb 19 13:22:02 2014 +1100

    Improvements to the gluster filesystem PMDA
    
    Add a few missing filesystem operations to pmdagluster.
    Introduce exception handling such that if new operations
    appear unexpectedly, we handle this gracefully.
    
    Improve the handling of multiple profiled volumes also.
    
    Resolves Red Hat bug #1066544.

diff --git a/src/pmdas/gluster/pmdagluster.python b/src/pmdas/gluster/pmdagluster.python
index 82277c2..de42e0c 100644
--- a/src/pmdas/gluster/pmdagluster.python
+++ b/src/pmdas/gluster/pmdagluster.python
@@ -2,7 +2,7 @@
 Performance Metrics Domain Agent exporting Gluster filesystem metrics.
 '''
 #
-# Copyright (c) 2013 Red Hat.
+# Copyright (c) 2013-2014 Red Hat.
 # 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -36,7 +36,8 @@ FILEOPS = [    # append only, do not change the order (changes PMID)
     'MKNOD', 'OPEN', 'OPENDIR', 'RCHECKSUM', 'READDIR', 'READDIRP',
     'READLINK', 'READV', 'REMOVEXATTR', 'RENAME', 'RMDIR', 'SETATTR',
     'SETXATTR', 'STAT', 'STATFS', 'SYMLINK', 'TRUNCATE', 'UNLINK',
-    'WRITEV', 'XATTROP',
+    'WRITEV', 'XATTROP', 'READ', 'WRITE', 'RELEASE', 'RELEASEDIR',
+    'FORGET'
 ]
 FILEOPS_INDICES = {}
 
@@ -89,17 +90,20 @@ class GlusterPMDA(PMDA):
 
     def parseVolumeInfo(self, xml):
         ''' Extract the set of volume names from given gluster XML string '''
-        volumes = []
-        for volxml in xml.findall('volInfo/volumes'):
-            volname = volxml.find('volume/name').text
-            volumes.append(volname)
+        volumenames = []
+        volsxml = xml.find('volInfo/volumes')
+        if volsxml == None:
+            return volumenames
+        for volxml in volsxml.findall('volume'):
+            volname = volxml.find('name').text
+            volumenames.append(volname)
             volume = GlusterVolume()
-            volume.distCount = int(volxml.find('volume/distCount').text)
-            volume.stripeCount = int(volxml.find('volume/stripeCount').text)
-            volume.replicaCount = int(volxml.find('volume/replicaCount').text)
+            volume.distCount = int(volxml.find('distCount').text)
+            volume.stripeCount = int(volxml.find('stripeCount').text)
+            volume.replicaCount = int(volxml.find('replicaCount').text)
             volume.fopHitsEnabled = 0
             volume.latencyEnabled = 0
-            for option in volxml.findall('volume/options/option'):
+            for option in volxml.findall('options/option'):
                 name = option.find('name').text
                 value = option.find('value').text
                 if (name == 'diagnostics.count-fop-hits' and value == 'on'):
@@ -107,7 +111,7 @@ class GlusterPMDA(PMDA):
                 if (name == 'diagnostics.latency-measurement' and value == 'on'):
                     volume.latencyEnabled = 1
             self.volumes[volname] = volume	# prepare the volume indom cache
-        return volumes
+        return volumenames
 
     def parseVolumeProfileInfo(self, volume, xml):
         ''' Extract the metric values from a given gluster profile string '''
@@ -116,11 +120,16 @@ class GlusterPMDA(PMDA):
             brick = GlusterBrick()
             for fileop in brickxml.findall('cumulativeStats/fopStats/fop'):
                 name = fileop.find('name').text
-                fop = FILEOPS_INDICES[name]
-                brick.count[fop] = long(fileop.find('hits').text)
-                brick.avgtime[fop] = float(fileop.find('avgLatency').text)
-                brick.mintime[fop] = long(float(fileop.find('minLatency').text))
-                brick.maxtime[fop] = long(float(fileop.find('maxLatency').text))
+                try:
+                    fop = FILEOPS_INDICES[name]
+                except KeyError:
+                    # self.log('Unrecognised fileops key %s' % name)
+                    pass
+                else:
+                    brick.count[fop] = long(fileop.find('hits').text)
+                    brick.avgtime[fop] = float(fileop.find('avgLatency').text)
+                    brick.mintime[fop] = long(float(fileop.find('minLatency').text))
+                    brick.maxtime[fop] = long(float(fileop.find('maxLatency').text))
             brick.read_bytes = long(brickxml.find('cumulativeStats/totalRead').text)
             brick.write_bytes = long(brickxml.find('cumulativeStats/totalWrite').text)
             self.bricks[brickname] = brick	# prepare the bricks indom cache
commit 3428c59e7f2e2bdd25e1f6d5b899a853f6845553
Author: Nathan Scott <nathans@redhat.com>
Date:   Fri Feb 21 14:26:50 2014 +1100

    Do not attempt to run NSS tests affected by bz 1035509

diff --git a/qa/common.secure b/qa/common.secure
index e3ee6a6..b9e936a 100644
--- a/qa/common.secure
+++ b/qa/common.secure
@@ -29,6 +29,11 @@ nss_notrun_checks()
     [ "$secure_sockets" = "true" ] || _notrun "Secure sockets not supported"
     which certutil >/dev/null 2>&1 || _notrun "certutil not installed (NSS tools)"
     [ -c /dev/urandom ] || _notrun "No random number generator special file found"
+
+    fips=false	# testing for exposure to Red Hat bug 1035509
+    fipsfile=/proc/sys/crypto/fips_enabled
+    test -f $fipsfile -a `cat $fipsfile` -ne 0 && fips=true
+    $fips && _notrun "FIPS mode interacts badly with system NSS databases"
 }
 
 nss_cleanup()
commit 2633a9948658a7fb0236a4740dc30b6c0193c91e
Author: Nathan Scott <nathans@redhat.com>
Date:   Fri Feb 21 14:31:55 2014 +1100

    Resolve timezone handling bugs in python wrapper API
    
    We were incorrectly changing the context when asked to change
    the timezone, this nullifying the zone change, and in one sad
    location even calling the wrong PMAPI routine (hohum).  Fixed
    those, then extended qa/737 to cover pmWhichZone use as well.
    
    Problem found by the Red Hat testing folks using test qa/737.

diff --git a/qa/737 b/qa/737
index 17d6c18..6abdc49 100755
--- a/qa/737
+++ b/qa/737
@@ -20,8 +20,13 @@ status=1	# failure is the default!
 $sudo rm -rf $tmp.* $seq.full
 trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
 
+_filter_utc()
+{
+    sed -e 's/UTC+0/UTC/g' -e 's/UTC-0/UTC/g'
+}
+
 # real QA test starts here
-python src/test_pcp_time.python
+python src/test_pcp_time.python | _filter_utc
 
 # success, all done
 status=0
diff --git a/qa/737.out b/qa/737.out
index 6a12e50..4f59a92 100644
--- a/qa/737.out
+++ b/qa/737.out
@@ -1,5 +1,6 @@
 QA output created by 737
-pmLocaltime from int:  1388763979.0 (2014, 1, 3, 15, 46, 19, 1, 33, 0)
-pmLocaltime from float:  1388763979.0 (2014, 1, 3, 15, 46, 19, 1, 33, 0)
-pmCtime from int:  Mon Feb  3 15:46:19 2014
-pmCtime from float:  Mon Feb  3 15:46:19 2014
+pmLocaltime from int:  1388724379.0 (2014, 1, 3, 4, 46, 19, 1, 33, 0)
+pmLocaltime from float:  1388724379.0 (2014, 1, 3, 4, 46, 19, 1, 33, 0)
+pmCtime from int:  Mon Feb  3 04:46:19 2014
+pmCtime from float:  Mon Feb  3 04:46:19 2014
+pmWhichZone:  UTC
diff --git a/qa/src/test_pcp_time.python b/qa/src/test_pcp_time.python
index 49680c5..a36baaa 100755
--- a/qa/src/test_pcp_time.python
+++ b/qa/src/test_pcp_time.python
@@ -29,3 +29,5 @@ print "pmLocaltime from float: ", context.pmLocaltime(sample_time_f)
 
 print "pmCtime from int: ", context.pmCtime(sample_time_i),
 print "pmCtime from float: ", context.pmCtime(sample_time_f),
+
+print "pmWhichZone: ", context.pmWhichZone()
diff --git a/src/python/pcp/pmapi.py b/src/python/pcp/pmapi.py
index 72302b4..fd67a9e 100644
--- a/src/python/pcp/pmapi.py
+++ b/src/python/pcp/pmapi.py
@@ -1,7 +1,7 @@
 # pylint: disable=C0103
 """ Wrapper module for LIBPCP - the core Performace Co-Pilot API
 #
-# Copyright (C) 2012-2013 Red Hat
+# Copyright (C) 2012-2014 Red Hat
 # Copyright (C) 2009-2012 Michael T. Werner
 #
 # This file is part of the "pcp" module, the python interfaces for the
@@ -1123,32 +1123,32 @@ class pmContext(object):
             raise pmErr, status
         return status
 
-    def pmNewZone(self, tz):
+    @staticmethod
+    def pmNewZone(tz):
         """PMAPI - Create new zone handle and set reporting timezone """
-        status = LIBPCP.pmUseContext(self.ctx)
-        if status < 0:
-            raise pmErr, status
-        status = LIBPCP.pmNewContextZone(tz)
+        status = LIBPCP.pmNewZone(tz)
         if status < 0:
             raise pmErr, status
         return status
 
-    def pmUseZone(self, tz_handle):
+    @staticmethod
+    def pmUseZone(tz_handle):
         """PMAPI - Sets the current reporting timezone """
-        status = LIBPCP.pmUseContext(self.ctx)
-        if status < 0:
-            raise pmErr, status
         status = LIBPCP.pmUseZone(tz_handle)
         if status < 0:
             raise pmErr, status
         return status
 
-    def pmWhichZone(self):
+    @staticmethod
+    def pmWhichZone():
         """PMAPI - Query the current reporting timezone """
-        status = LIBPCP.pmGetContextHostName(self.ctx)
+        tz_p = c_char_p()
+        status = LIBPCP.pmWhichZone(byref(tz_p))
         if status < 0:
             raise pmErr, status
-        return status
+        tz = str(tz_p.value)
+        LIBC.free(tz_p)
+        return tz
 
     def pmLocaltime(self, seconds):
         """PMAPI - convert the date and time for a reporting timezone """
commit 9681ff309d09de29fd92942f89b4405164b4d3f2
Author: Nathan Scott <nathans@redhat.com>
Date:   Tue Feb 25 10:51:48 2014 +1100

    Fix qa/749 when systemtap userspace probes are unavailable
    
    Tweak test 749 using Franks suggestion of verifying up to and
    including the compilation phase (-p4) before going ahead with
    the complete test.  This is to catch missing userspace probe
    support on some platforms (s390x tripped this in the Red Hat
    QE environment).

diff --git a/qa/749 b/qa/749
index 9d2e16a..eb712f1 100644
--- a/qa/749
+++ b/qa/749
@@ -2,7 +2,7 @@
 # PCP QA Test No. 749
 # Check pmcd static probes
 #
-# Copyright (c) 2013 Red Hat.
+# Copyright (c) 2013-2014 Red Hat.
 
 seq=`basename $0`
 echo "QA output created by $seq"
@@ -56,8 +56,19 @@ cat $tmp.stap >> $seq.full
 echo "Running pmcd process:" >> $seq.full
 $PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep pmcd >> $seq.full
 
+# check for stap user probing support
+stap -p4 $tmp.stap >$tmp.out 2>&1
+if [ $? -ne 0 ]
+then
+    echo "Systemtap compile check failed"
+    cat $tmp.out >> $seq.full
+    _notrun "Systemtap userspace probing unsupported here"
+fi
+
 # start systemtap and count pmcd probe hits
-$sudo stap $tmp.stap | tee -a $tmp.out 2>&1
+echo "Fire stap probes:" >> $seq.full
+$sudo stap $tmp.stap >$tmp.out 2>&1
+cat $tmp.out | tee -a $seq.full
 
 echo "Output from stap:" >> $seq.full
 cat $tmp.out >> $seq.full