Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 722
blob1335843a9853161b35f132e2d595cd885e111c3c
1 #!/bin/sh
2 # PCP QA Test No. 722
3 # Exercise various python mechanisms for setting sources
4 # (hosts, archives) via the pmOptions class interfaces.
6 # Copyright (c) 2015-2016 Red Hat. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 . ./common.python
14 status=1 # failure is the default!
15 $sudo rm -rf $tmp $tmp.* $seq.full
16 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
18 _check_stderr()
20 if [ -s $tmp.stderr ]
21 then
22 echo fail
23 cat $tmp.stderr >>$here/$seq.full
24 else
25 echo pass
27 rm -f $tmp.stderr
30 # real QA test starts here
31 script="$python $here/src/test_set_source.python"
33 echo && echo == Host, expect pass:
34 TEST_SET_HOST=localhost $script 2>$tmp.stderr
35 _check_stderr
36 echo && echo == Host list, expect pass:
37 TEST_SET_HOSTLIST=localhost $script 2>$tmp.stderr
38 _check_stderr
39 echo && echo == Host list, expect fail:
40 TEST_SET_HOSTLIST=localhost,unix: $script 2>$tmp.stderr
41 _check_stderr
42 echo && echo == Host list, expect pass:
43 TEST_SET_MULTI=1 TEST_SET_HOSTLIST=unix:,local:,localhost $script 2>$tmp.stderr
44 _check_stderr
46 echo && echo == Container, expect pass:
47 TEST_SET_CONTAINER=abc012345 $script 2>$tmp.stderr
48 _check_stderr
50 echo && echo == Local PMDA, expect pass:
51 TEST_SET_LOCALPMDA=true TEST_SET_SPECLOCAL=clear $script 2>$tmp.stderr
52 _check_stderr
54 echo && echo == Local PMDA, expect fail:
55 TEST_SET_LOCALPMDA=true TEST_SET_SPECLOCAL=add, $script 2>$tmp.stderr
56 _check_stderr
58 echo && echo == Archive list, expect pass:
59 TEST_SET_ARCHIVELIST=archives/pcp-atop $script 2>$tmp.stderr
60 _check_stderr
61 echo && echo == Archive list, expect pass:
62 TEST_SET_ARCHIVELIST=archives/pcp-free,archives/pcp-uptime $script 2>$tmp.stderr
63 _check_stderr
65 cd $here/archives
66 echo && echo == Folio, expect pass:
67 TEST_SET_ARCHIVEFOLIO=pcp-atop.folio $script 2>$tmp.stderr
68 _check_stderr
70 # success, all done
71 status=0
72 exit