pmrep: fix archive end time reporting
[pcp.git] / qa / 739
blobdee9d8275dd63dc7dc3e0adc356e59268b478fa5
1 #!/bin/sh
2 # PCP QA Test No. 739
3 # Exercise python script automated option handling
5 # Copyright (c) 2014 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 . ./common.python
13 status=1 # failure is the default!
14 $sudo rm -rf $tmp.* $seq.full
15 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
17 $python -c "from pcp import pmapi" >/dev/null 2>&1
18 [ $? -eq 0 ] || _notrun "python pcp pmapi module not installed"
20 _filter_version()
22 sed -e 's/ [0-9]*\.[0-9]*\.[0-9]*$/ X.Y.Z/g'
25 # real QA test starts here
26 echo && echo check no arguments
27 $python $here/src/test_pcp_options.py
29 echo && echo check non arguments
30 $python $here/src/test_pcp_options.py param1 param2
32 echo && echo check archive option and non arguments
33 $python $here/src/test_pcp_options.py -a file param
35 echo && echo check host option and hostzone
36 $python $here/src/test_pcp_options.py -h qa.r.us -z
38 echo && echo check timezone
39 $python $here/src/test_pcp_options.py --timezone UTC
41 echo && echo check option samples and interval
42 $python $here/src/test_pcp_options.py --samples=5 -t1
44 echo && echo check custom local long options
45 $python $here/src/test_pcp_options.py --list /tmp --force
47 echo && echo check custom local short options
48 $python $here/src/test_pcp_options.py -b
50 echo && echo check version message generation
51 $python $here/src/test_pcp_options.py -V 2>&1 | _filter_version
53 echo && echo check unknown option and usage message
54 $python $here/src/test_pcp_options.py --munchies
56 echo && echo check help option and usage message
57 $python $here/src/test_pcp_options.py --help
59 # success, all done
60 status=0
61 exit