pmrep: update TODO, man page
[pcp.git] / qa / 739
blob83555778f763c01b3263f1fefc156a2ad4f403e7
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
12 status=1 # failure is the default!
13 $sudo rm -rf $tmp.* $seq.full
14 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
16 $python -c "from pcp import pmapi" >/dev/null 2>&1
17 [ $? -eq 0 ] || _notrun "python pcp pmapi module not installed"
19 _filter_version()
21 sed -e 's/ [0-9]*\.[0-9]*\.[0-9]*$/ X.Y.Z/g'
24 # real QA test starts here
25 echo && echo check no arguments
26 $python $here/src/test_pcp_options.py
28 echo && echo check non arguments
29 $python $here/src/test_pcp_options.py param1 param2
31 echo && echo check archive option and non arguments
32 $python $here/src/test_pcp_options.py -a file param
34 echo && echo check host option and hostzone
35 $python $here/src/test_pcp_options.py -h qa.r.us -z
37 echo && echo check timezone
38 $python $here/src/test_pcp_options.py --timezone UTC
40 echo && echo check option samples and interval
41 $python $here/src/test_pcp_options.py --samples=5 -t1
43 echo && echo check custom local long options
44 $python $here/src/test_pcp_options.py --list /tmp --force
46 echo && echo check custom local short options
47 $python $here/src/test_pcp_options.py -b
49 echo && echo check version message generation
50 $python $here/src/test_pcp_options.py -V 2>&1 | _filter_version
52 echo && echo check unknown option and usage message
53 $python $here/src/test_pcp_options.py --munchies
55 echo && echo check help option and usage message
56 $python $here/src/test_pcp_options.py --help
58 # success, all done
59 status=0
60 exit