Blame SOURCES/bz987086.patch

95ec45
commit 66ce1d4adc73cbe18b2ffac9d95efd820cf3ca44
95ec45
Author: Nathan Scott <nathans@redhat.com>
95ec45
Date:   Fri Feb 21 13:29:44 2014 +1100
95ec45
95ec45
    Make test qa/750 deterministic, remove hard-wired hostname
95ec45
95ec45
diff --git a/qa/750 b/qa/750
95ec45
index 1922722..94ac5ee 100755
95ec45
--- a/qa/750
95ec45
+++ b/qa/750
95ec45
@@ -29,8 +29,9 @@ trap "_rpm_cleanup" 0 1 2 3 15
95ec45
 filter_pmval()
95ec45
 {
95ec45
     sed \
95ec45
-	-e "s/\"$hostname\"/\"BUILDHOST\"/g" \
95ec45
+	-e "s/^ *\"$hostname\"/\"BUILDHOST\"/g" \
95ec45
 	-e 's/^ [0-9][0-9]* $/ TIMESTAMP /g' \
95ec45
+	-e "s/^host:      $hostname$/host:      HOST/g" \
95ec45
     # end
95ec45
 }
95ec45
 
95ec45
diff --git a/qa/750.out.1 b/qa/750.out.1
95ec45
index acdbe0b..cbfb16b 100644
95ec45
--- a/qa/750.out.1
95ec45
+++ b/qa/750.out.1
95ec45
@@ -3,7 +3,7 @@ Preparing RPM package
95ec45
 Installing qaplayer
95ec45
 
95ec45
 metric:    rpm.arch
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -12,16 +12,16 @@ samples:   1
95ec45
              "noarch" 
95ec45
 
95ec45
 metric:    rpm.buildhost
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
 
95ec45
              qaplayer 
95ec45
-              "BUILDHOST" 
95ec45
+"BUILDHOST" 
95ec45
 
95ec45
 metric:    rpm.buildtime
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     sec
95ec45
 samples:   1
95ec45
@@ -30,7 +30,7 @@ samples:   1
95ec45
  TIMESTAMP 
95ec45
 
95ec45
 metric:    rpm.description
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -43,7 +43,7 @@ oversampling.  This leads to sound quality that
95ec45
 cannot be equaled with more mundane software..." 
95ec45
 
95ec45
 metric:    rpm.epoch
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -52,7 +52,7 @@ samples:   1
95ec45
           0 
95ec45
 
95ec45
 metric:    rpm.group
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -61,7 +61,7 @@ samples:   1
95ec45
  "Applications/Sound" 
95ec45
 
95ec45
 metric:    rpm.installtime
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     sec
95ec45
 samples:   1
95ec45
@@ -70,7 +70,7 @@ samples:   1
95ec45
  TIMESTAMP 
95ec45
 
95ec45
 metric:    rpm.license
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -79,7 +79,7 @@ samples:   1
95ec45
                 "GPL" 
95ec45
 
95ec45
 metric:    rpm.packager
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -88,7 +88,7 @@ samples:   1
95ec45
 "Santa Claus <sclaus@northpole.com>" 
95ec45
 
95ec45
 metric:    rpm.release
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -97,7 +97,7 @@ samples:   1
95ec45
                   "1" 
95ec45
 
95ec45
 metric:    rpm.size
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     byte
95ec45
 samples:   1
95ec45
@@ -106,7 +106,7 @@ samples:   1
95ec45
           0 
95ec45
 
95ec45
 metric:    rpm.sourcerpm
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -115,7 +115,7 @@ samples:   1
95ec45
 "qaplayer-1.0-1.src.rpm" 
95ec45
 
95ec45
 metric:    rpm.summary
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -124,7 +124,7 @@ samples:   1
95ec45
 "A QA player app that rocks!" 
95ec45
 
95ec45
 metric:    rpm.url
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -133,7 +133,7 @@ samples:   1
95ec45
 "http://www.gnomovision.com/qaplayer/qaplayer.html" 
95ec45
 
95ec45
 metric:    rpm.vendor
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -142,7 +142,7 @@ samples:   1
95ec45
 "White Socks Software, Inc." 
95ec45
 
95ec45
 metric:    rpm.version
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
diff --git a/qa/750.out.2 b/qa/750.out.2
95ec45
index ce6efac..a7b082d 100644
95ec45
--- a/qa/750.out.2
95ec45
+++ b/qa/750.out.2
95ec45
@@ -3,7 +3,7 @@ Preparing RPM package
95ec45
 Installing qaplayer
95ec45
 
95ec45
 metric:    rpm.arch
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -12,16 +12,16 @@ qaplayer-1.0-1.noarch
95ec45
              "noarch" 
95ec45
 
95ec45
 metric:    rpm.buildhost
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
 
95ec45
 qaplayer-1.0-1.noarch 
95ec45
-              "BUILDHOST" 
95ec45
+"BUILDHOST" 
95ec45
 
95ec45
 metric:    rpm.buildtime
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     sec
95ec45
 samples:   1
95ec45
@@ -31,7 +31,7 @@ qaplayer-1.
95ec45
  TIMESTAMP 
95ec45
 
95ec45
 metric:    rpm.description
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -44,7 +44,7 @@ oversampling.  This leads to sound quality that
95ec45
 cannot be equaled with more mundane software..." 
95ec45
 
95ec45
 metric:    rpm.epoch
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -54,7 +54,7 @@ qaplayer-1.
95ec45
           0 
95ec45
 
95ec45
 metric:    rpm.group
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -63,7 +63,7 @@ qaplayer-1.0-1.noarch
95ec45
  "Applications/Sound" 
95ec45
 
95ec45
 metric:    rpm.installtime
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     sec
95ec45
 samples:   1
95ec45
@@ -73,7 +73,7 @@ qaplayer-1.
95ec45
  TIMESTAMP 
95ec45
 
95ec45
 metric:    rpm.license
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -82,7 +82,7 @@ qaplayer-1.0-1.noarch
95ec45
                 "GPL" 
95ec45
 
95ec45
 metric:    rpm.packager
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -91,7 +91,7 @@ qaplayer-1.0-1.noarch
95ec45
 "Santa Claus <sclaus@northpole.com>" 
95ec45
 
95ec45
 metric:    rpm.release
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -100,7 +100,7 @@ qaplayer-1.0-1.noarch
95ec45
                   "1" 
95ec45
 
95ec45
 metric:    rpm.size
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     byte
95ec45
 samples:   1
95ec45
@@ -110,7 +110,7 @@ qaplayer-1.
95ec45
           0 
95ec45
 
95ec45
 metric:    rpm.sourcerpm
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -119,7 +119,7 @@ qaplayer-1.0-1.noarch
95ec45
 "qaplayer-1.0-1.src.rpm" 
95ec45
 
95ec45
 metric:    rpm.summary
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -128,7 +128,7 @@ qaplayer-1.0-1.noarch
95ec45
 "A QA player app that rocks!" 
95ec45
 
95ec45
 metric:    rpm.url
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -137,7 +137,7 @@ qaplayer-1.0-1.noarch
95ec45
 "http://www.gnomovision.com/qaplayer/qaplayer.html" 
95ec45
 
95ec45
 metric:    rpm.vendor
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -146,7 +146,7 @@ qaplayer-1.0-1.noarch
95ec45
 "White Socks Software, Inc." 
95ec45
 
95ec45
 metric:    rpm.version
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
@@ -155,7 +155,7 @@ qaplayer-1.0-1.noarch
95ec45
                 "1.0" 
95ec45
 
95ec45
 metric:    rpm.name
95ec45
-host:      smash
95ec45
+host:      HOST
95ec45
 semantics: instantaneous value
95ec45
 units:     none
95ec45
 samples:   1
95ec45
commit 13a5562e18910ecffaba5b60f3b7adc5a01d7e56
95ec45
Author: Nathan Scott <nathans@redhat.com>
95ec45
Date:   Fri Feb 21 14:11:51 2014 +1100
95ec45
95ec45
    Extend qa/003 filter for non-x86 hosts, with less cpuinfo
95ec45
95ec45
diff --git a/qa/003 b/qa/003
95ec45
index e0cffa7..b83a63f 100755
95ec45
--- a/qa/003
95ec45
+++ b/qa/003
95ec45
@@ -54,6 +54,7 @@ linux_filter()
95ec45
     sed \
95ec45
 	-e "/filesys\.readonly: $unknown/d" \
95ec45
 	-e "/hinv\.nlv: $unavailable/d" \
95ec45
+	-e "/hinv\.cpu\..*: $unavailable/d" \
95ec45
 	-e "/kernel\.pernode..*: $unavailable/d" \
95ec45
 	-e "/mem\.util\.active_anon: $unavailable/d" \
95ec45
 	-e "/mem\.util\.active_file: $unavailable/d" \
95ec45
commit ec0ab978a71c12d9ce14d2a1ad51eb944e3e0e7d
95ec45
Author: Nathan Scott <nathans@redhat.com>
95ec45
Date:   Wed Feb 19 13:22:02 2014 +1100
95ec45
95ec45
    Improvements to the gluster filesystem PMDA
95ec45
    
95ec45
    Add a few missing filesystem operations to pmdagluster.
95ec45
    Introduce exception handling such that if new operations
95ec45
    appear unexpectedly, we handle this gracefully.
95ec45
    
95ec45
    Improve the handling of multiple profiled volumes also.
95ec45
    
95ec45
    Resolves Red Hat bug #1066544.
95ec45
95ec45
diff --git a/src/pmdas/gluster/pmdagluster.python b/src/pmdas/gluster/pmdagluster.python
95ec45
index 82277c2..de42e0c 100644
95ec45
--- a/src/pmdas/gluster/pmdagluster.python
95ec45
+++ b/src/pmdas/gluster/pmdagluster.python
95ec45
@@ -2,7 +2,7 @@
95ec45
 Performance Metrics Domain Agent exporting Gluster filesystem metrics.
95ec45
 '''
95ec45
 #
95ec45
-# Copyright (c) 2013 Red Hat.
95ec45
+# Copyright (c) 2013-2014 Red Hat.
95ec45
 # 
95ec45
 # This program is free software; you can redistribute it and/or modify it
95ec45
 # under the terms of the GNU General Public License as published by the
95ec45
@@ -36,7 +36,8 @@ FILEOPS = [    # append only, do not change the order (changes PMID)
95ec45
     'MKNOD', 'OPEN', 'OPENDIR', 'RCHECKSUM', 'READDIR', 'READDIRP',
95ec45
     'READLINK', 'READV', 'REMOVEXATTR', 'RENAME', 'RMDIR', 'SETATTR',
95ec45
     'SETXATTR', 'STAT', 'STATFS', 'SYMLINK', 'TRUNCATE', 'UNLINK',
95ec45
-    'WRITEV', 'XATTROP',
95ec45
+    'WRITEV', 'XATTROP', 'READ', 'WRITE', 'RELEASE', 'RELEASEDIR',
95ec45
+    'FORGET'
95ec45
 ]
95ec45
 FILEOPS_INDICES = {}
95ec45
 
95ec45
@@ -89,17 +90,20 @@ class GlusterPMDA(PMDA):
95ec45
 
95ec45
     def parseVolumeInfo(self, xml):
95ec45
         ''' Extract the set of volume names from given gluster XML string '''
95ec45
-        volumes = []
95ec45
-        for volxml in xml.findall('volInfo/volumes'):
95ec45
-            volname = volxml.find('volume/name').text
95ec45
-            volumes.append(volname)
95ec45
+        volumenames = []
95ec45
+        volsxml = xml.find('volInfo/volumes')
95ec45
+        if volsxml == None:
95ec45
+            return volumenames
95ec45
+        for volxml in volsxml.findall('volume'):
95ec45
+            volname = volxml.find('name').text
95ec45
+            volumenames.append(volname)
95ec45
             volume = GlusterVolume()
95ec45
-            volume.distCount = int(volxml.find('volume/distCount').text)
95ec45
-            volume.stripeCount = int(volxml.find('volume/stripeCount').text)
95ec45
-            volume.replicaCount = int(volxml.find('volume/replicaCount').text)
95ec45
+            volume.distCount = int(volxml.find('distCount').text)
95ec45
+            volume.stripeCount = int(volxml.find('stripeCount').text)
95ec45
+            volume.replicaCount = int(volxml.find('replicaCount').text)
95ec45
             volume.fopHitsEnabled = 0
95ec45
             volume.latencyEnabled = 0
95ec45
-            for option in volxml.findall('volume/options/option'):
95ec45
+            for option in volxml.findall('options/option'):
95ec45
                 name = option.find('name').text
95ec45
                 value = option.find('value').text
95ec45
                 if (name == 'diagnostics.count-fop-hits' and value == 'on'):
95ec45
@@ -107,7 +111,7 @@ class GlusterPMDA(PMDA):
95ec45
                 if (name == 'diagnostics.latency-measurement' and value == 'on'):
95ec45
                     volume.latencyEnabled = 1
95ec45
             self.volumes[volname] = volume	# prepare the volume indom cache
95ec45
-        return volumes
95ec45
+        return volumenames
95ec45
 
95ec45
     def parseVolumeProfileInfo(self, volume, xml):
95ec45
         ''' Extract the metric values from a given gluster profile string '''
95ec45
@@ -116,11 +120,16 @@ class GlusterPMDA(PMDA):
95ec45
             brick = GlusterBrick()
95ec45
             for fileop in brickxml.findall('cumulativeStats/fopStats/fop'):
95ec45
                 name = fileop.find('name').text
95ec45
-                fop = FILEOPS_INDICES[name]
95ec45
-                brick.count[fop] = long(fileop.find('hits').text)
95ec45
-                brick.avgtime[fop] = float(fileop.find('avgLatency').text)
95ec45
-                brick.mintime[fop] = long(float(fileop.find('minLatency').text))
95ec45
-                brick.maxtime[fop] = long(float(fileop.find('maxLatency').text))
95ec45
+                try:
95ec45
+                    fop = FILEOPS_INDICES[name]
95ec45
+                except KeyError:
95ec45
+                    # self.log('Unrecognised fileops key %s' % name)
95ec45
+                    pass
95ec45
+                else:
95ec45
+                    brick.count[fop] = long(fileop.find('hits').text)
95ec45
+                    brick.avgtime[fop] = float(fileop.find('avgLatency').text)
95ec45
+                    brick.mintime[fop] = long(float(fileop.find('minLatency').text))
95ec45
+                    brick.maxtime[fop] = long(float(fileop.find('maxLatency').text))
95ec45
             brick.read_bytes = long(brickxml.find('cumulativeStats/totalRead').text)
95ec45
             brick.write_bytes = long(brickxml.find('cumulativeStats/totalWrite').text)
95ec45
             self.bricks[brickname] = brick	# prepare the bricks indom cache
95ec45
commit 3428c59e7f2e2bdd25e1f6d5b899a853f6845553
95ec45
Author: Nathan Scott <nathans@redhat.com>
95ec45
Date:   Fri Feb 21 14:26:50 2014 +1100
95ec45
95ec45
    Do not attempt to run NSS tests affected by bz 1035509
95ec45
95ec45
diff --git a/qa/common.secure b/qa/common.secure
95ec45
index e3ee6a6..b9e936a 100644
95ec45
--- a/qa/common.secure
95ec45
+++ b/qa/common.secure
95ec45
@@ -29,6 +29,11 @@ nss_notrun_checks()
95ec45
     [ "$secure_sockets" = "true" ] || _notrun "Secure sockets not supported"
95ec45
     which certutil >/dev/null 2>&1 || _notrun "certutil not installed (NSS tools)"
95ec45
     [ -c /dev/urandom ] || _notrun "No random number generator special file found"
95ec45
+
95ec45
+    fips=false	# testing for exposure to Red Hat bug 1035509
95ec45
+    fipsfile=/proc/sys/crypto/fips_enabled
95ec45
+    test -f $fipsfile -a `cat $fipsfile` -ne 0 && fips=true
95ec45
+    $fips && _notrun "FIPS mode interacts badly with system NSS databases"
95ec45
 }
95ec45
 
95ec45
 nss_cleanup()
95ec45
commit 2633a9948658a7fb0236a4740dc30b6c0193c91e
95ec45
Author: Nathan Scott <nathans@redhat.com>
95ec45
Date:   Fri Feb 21 14:31:55 2014 +1100
95ec45
95ec45
    Resolve timezone handling bugs in python wrapper API
95ec45
    
95ec45
    We were incorrectly changing the context when asked to change
95ec45
    the timezone, this nullifying the zone change, and in one sad
95ec45
    location even calling the wrong PMAPI routine (hohum).  Fixed
95ec45
    those, then extended qa/737 to cover pmWhichZone use as well.
95ec45
    
95ec45
    Problem found by the Red Hat testing folks using test qa/737.
95ec45
95ec45
diff --git a/qa/737 b/qa/737
95ec45
index 17d6c18..6abdc49 100755
95ec45
--- a/qa/737
95ec45
+++ b/qa/737
95ec45
@@ -20,8 +20,13 @@ status=1	# failure is the default!
95ec45
 $sudo rm -rf $tmp.* $seq.full
95ec45
 trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
95ec45
 
95ec45
+_filter_utc()
95ec45
+{
95ec45
+    sed -e 's/UTC+0/UTC/g' -e 's/UTC-0/UTC/g'
95ec45
+}
95ec45
+
95ec45
 # real QA test starts here
95ec45
-python src/test_pcp_time.python
95ec45
+python src/test_pcp_time.python | _filter_utc
95ec45
 
95ec45
 # success, all done
95ec45
 status=0
95ec45
diff --git a/qa/737.out b/qa/737.out
95ec45
index 6a12e50..4f59a92 100644
95ec45
--- a/qa/737.out
95ec45
+++ b/qa/737.out
95ec45
@@ -1,5 +1,6 @@
95ec45
 QA output created by 737
95ec45
-pmLocaltime from int:  1388763979.0 (2014, 1, 3, 15, 46, 19, 1, 33, 0)
95ec45
-pmLocaltime from float:  1388763979.0 (2014, 1, 3, 15, 46, 19, 1, 33, 0)
95ec45
-pmCtime from int:  Mon Feb  3 15:46:19 2014
95ec45
-pmCtime from float:  Mon Feb  3 15:46:19 2014
95ec45
+pmLocaltime from int:  1388724379.0 (2014, 1, 3, 4, 46, 19, 1, 33, 0)
95ec45
+pmLocaltime from float:  1388724379.0 (2014, 1, 3, 4, 46, 19, 1, 33, 0)
95ec45
+pmCtime from int:  Mon Feb  3 04:46:19 2014
95ec45
+pmCtime from float:  Mon Feb  3 04:46:19 2014
95ec45
+pmWhichZone:  UTC
95ec45
diff --git a/qa/src/test_pcp_time.python b/qa/src/test_pcp_time.python
95ec45
index 49680c5..a36baaa 100755
95ec45
--- a/qa/src/test_pcp_time.python
95ec45
+++ b/qa/src/test_pcp_time.python
95ec45
@@ -29,3 +29,5 @@ print "pmLocaltime from float: ", context.pmLocaltime(sample_time_f)
95ec45
 
95ec45
 print "pmCtime from int: ", context.pmCtime(sample_time_i),
95ec45
 print "pmCtime from float: ", context.pmCtime(sample_time_f),
95ec45
+
95ec45
+print "pmWhichZone: ", context.pmWhichZone()
95ec45
diff --git a/src/python/pcp/pmapi.py b/src/python/pcp/pmapi.py
95ec45
index 72302b4..fd67a9e 100644
95ec45
--- a/src/python/pcp/pmapi.py
95ec45
+++ b/src/python/pcp/pmapi.py
95ec45
@@ -1,7 +1,7 @@
95ec45
 # pylint: disable=C0103
95ec45
 """ Wrapper module for LIBPCP - the core Performace Co-Pilot API
95ec45
 #
95ec45
-# Copyright (C) 2012-2013 Red Hat
95ec45
+# Copyright (C) 2012-2014 Red Hat
95ec45
 # Copyright (C) 2009-2012 Michael T. Werner
95ec45
 #
95ec45
 # This file is part of the "pcp" module, the python interfaces for the
95ec45
@@ -1123,32 +1123,32 @@ class pmContext(object):
95ec45
             raise pmErr, status
95ec45
         return status
95ec45
 
95ec45
-    def pmNewZone(self, tz):
95ec45
+    @staticmethod
95ec45
+    def pmNewZone(tz):
95ec45
         """PMAPI - Create new zone handle and set reporting timezone """
95ec45
-        status = LIBPCP.pmUseContext(self.ctx)
95ec45
-        if status < 0:
95ec45
-            raise pmErr, status
95ec45
-        status = LIBPCP.pmNewContextZone(tz)
95ec45
+        status = LIBPCP.pmNewZone(tz)
95ec45
         if status < 0:
95ec45
             raise pmErr, status
95ec45
         return status
95ec45
 
95ec45
-    def pmUseZone(self, tz_handle):
95ec45
+    @staticmethod
95ec45
+    def pmUseZone(tz_handle):
95ec45
         """PMAPI - Sets the current reporting timezone """
95ec45
-        status = LIBPCP.pmUseContext(self.ctx)
95ec45
-        if status < 0:
95ec45
-            raise pmErr, status
95ec45
         status = LIBPCP.pmUseZone(tz_handle)
95ec45
         if status < 0:
95ec45
             raise pmErr, status
95ec45
         return status
95ec45
 
95ec45
-    def pmWhichZone(self):
95ec45
+    @staticmethod
95ec45
+    def pmWhichZone():
95ec45
         """PMAPI - Query the current reporting timezone """
95ec45
-        status = LIBPCP.pmGetContextHostName(self.ctx)
95ec45
+        tz_p = c_char_p()
95ec45
+        status = LIBPCP.pmWhichZone(byref(tz_p))
95ec45
         if status < 0:
95ec45
             raise pmErr, status
95ec45
-        return status
95ec45
+        tz = str(tz_p.value)
95ec45
+        LIBC.free(tz_p)
95ec45
+        return tz
95ec45
 
95ec45
     def pmLocaltime(self, seconds):
95ec45
         """PMAPI - convert the date and time for a reporting timezone """
95ec45
commit 9681ff309d09de29fd92942f89b4405164b4d3f2
95ec45
Author: Nathan Scott <nathans@redhat.com>
95ec45
Date:   Tue Feb 25 10:51:48 2014 +1100
95ec45
95ec45
    Fix qa/749 when systemtap userspace probes are unavailable
95ec45
    
95ec45
    Tweak test 749 using Franks suggestion of verifying up to and
95ec45
    including the compilation phase (-p4) before going ahead with
95ec45
    the complete test.  This is to catch missing userspace probe
95ec45
    support on some platforms (s390x tripped this in the Red Hat
95ec45
    QE environment).
95ec45
95ec45
diff --git a/qa/749 b/qa/749
95ec45
index 9d2e16a..eb712f1 100644
95ec45
--- a/qa/749
95ec45
+++ b/qa/749
95ec45
@@ -2,7 +2,7 @@
95ec45
 # PCP QA Test No. 749
95ec45
 # Check pmcd static probes
95ec45
 #
95ec45
-# Copyright (c) 2013 Red Hat.
95ec45
+# Copyright (c) 2013-2014 Red Hat.
95ec45
 
95ec45
 seq=`basename $0`
95ec45
 echo "QA output created by $seq"
95ec45
@@ -56,8 +56,19 @@ cat $tmp.stap >> $seq.full
95ec45
 echo "Running pmcd process:" >> $seq.full
95ec45
 $PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep pmcd >> $seq.full
95ec45
 
95ec45
+# check for stap user probing support
95ec45
+stap -p4 $tmp.stap >$tmp.out 2>&1
95ec45
+if [ $? -ne 0 ]
95ec45
+then
95ec45
+    echo "Systemtap compile check failed"
95ec45
+    cat $tmp.out >> $seq.full
95ec45
+    _notrun "Systemtap userspace probing unsupported here"
95ec45
+fi
95ec45
+
95ec45
 # start systemtap and count pmcd probe hits
95ec45
-$sudo stap $tmp.stap | tee -a $tmp.out 2>&1
95ec45
+echo "Fire stap probes:" >> $seq.full
95ec45
+$sudo stap $tmp.stap >$tmp.out 2>&1
95ec45
+cat $tmp.out | tee -a $seq.full
95ec45
 
95ec45
 echo "Output from stap:" >> $seq.full
95ec45
 cat $tmp.out >> $seq.full