summaryrefslogtreecommitdiff
path: root/qa/729
diff options
context:
space:
mode:
Diffstat (limited to 'qa/729')
-rwxr-xr-xqa/72948
1 files changed, 48 insertions, 0 deletions
diff --git a/qa/729 b/qa/729
new file mode 100755
index 0000000..f81f49e
--- /dev/null
+++ b/qa/729
@@ -0,0 +1,48 @@
+#!/bin/sh
+# PCP QA Test No. 729
+# Exercise fixes for a few python API segfaults
+#
+# Copyright (c) 2014 Red Hat.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+
+status=1 # failure is the default!
+$sudo rm -rf $tmp.* $seq.full
+trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+
+cat > $tmp.units <<EOF
+import pcp.pmapi
+from pcp.pmapi import c_api
+
+fname = 'src/bug_v2'
+context = pcp.pmapi.pmContext(c_api.PM_CONTEXT_ARCHIVE, fname)
+pmids = context.pmLookupName(['proc.nprocs'])
+descs = context.pmLookupDescs(pmids[0])
+print '%s%s' % (descs[0].contents.units, 'Completed safely')
+EOF
+
+cat > $tmp.parse << EOF
+import pcp.pmapi
+context = pcp.pmapi.pmContext(target='local:')
+try:
+ print(context.pmParseInterval(''))
+except pcp.pmapi.pmErr, error:
+ print 'Completed safely'
+EOF
+
+# real QA test starts here
+echo Exercising units string
+python $tmp.units
+echo Exercising interval parsing
+python $tmp.parse
+
+# success, all done
+status=0
+exit