pmrep: fix archive end time reporting
[pcp.git] / qa / 949
blobcc891f28f792f74d2ae5a2ba4cd5657864d8fb06
1 #!/bin/sh
2 # PCP QA Test No. 949
3 # Exercise bug in creating timespec objects via pmapi.py.
5 # Copyright (c) 2016 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 . ./common.python
13 $python -c "from pcp import pmapi" >/dev/null 2>&1
14 [ $? -eq 0 ] || _notrun "python pcp pmapi module not installed"
16 status=1 # failure is the default!
17 $sudo rm -rf $tmp $tmp.* $seq.full
18 trap "cd $here; rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
20 # real QA test starts here
21 cat > $tmp.py <<EOF
22 from pcp import pmapi
24 ts0 = pmapi.timespec()
25 ts1 = pmapi.timespec(1)
26 ts21 = pmapi.timespec(2, 1000000)
28 print("ts0=%s" % ts0)
29 print("ts1=%s" % ts1)
30 print("ts21=%s" % ts21)
32 tv0 = pmapi.timeval()
33 tv1 = pmapi.timeval(1)
34 tv21 = pmapi.timeval(2, 1000)
36 print("tv0=%s" % tv0)
37 print("tv1=%s" % tv1)
38 print("tv21=%s" % tv21)
39 EOF
40 # cat $tmp.py
41 $python $tmp.py
43 # success, all done
44 status=0
45 exit