Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 411
blobacce1263de90bd08d57fd1d892f2c596c4d0a54f
1 #! /bin/sh
2 # PCP QA Test No. 411
3 # exercising the simple pmdas dynamic instance domain
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard filters
12 . ./common.product
13 . ./common.check
14 . ./common.filter
16 status=1 # failure is the default!
17 trap "_cleanup" 0 1 2 3 15
19 _cleanup()
21 [ -f $iam.conf.$seq ] && $sudo mv $iam.conf.$seq $iam.conf
22 $sudo ./Install </dev/null >/dev/null 2>&1
23 $sudo rm -f $tmp.*
24 exit $status
27 unset ROOT TOOLROOT MAKEFLAGS
29 _time_filter()
31 sed \
32 -e 's/[0-9][0-9]*/[NUMBER]/g'
35 _pmda_filter()
37 _filter_pmda_install \
38 | sed \
39 -e 's/or python //g' \
40 -e 's/or perl //g' \
44 # real QA test starts here
45 home=$PCP_PMDAS_DIR
46 iam=simple
47 if [ ! -d $home/$iam ]
48 then
49 echo "Where is $home/$iam?"
50 exit 1
52 cd $home/$iam
53 unset ROOT
55 $sudo mv $iam.conf $iam.conf.$seq
57 echo "sec,min,hour" >$tmp.conf
58 $sudo cp $tmp.conf $home/$iam/$iam.conf
60 if $sudo $PCP_MAKE_PROG clobber >$tmp.out 2>&1
61 then
63 else
64 cat $tmp.out
65 echo "Arrgh, make clobber failed"
66 exit
69 # start from a known starting point
70 $sudo ./Remove >/dev/null 2>&1
72 $sudo ./Install -e </dev/null >$tmp.out 2>&1
73 _pmda_filter <$tmp.out
75 # exercise various configuration file entries (updated on the fly) ...
76 # check all together
77 cat > $tmp.test1 << EOF
78 sec,min,hour
79 EOF
80 # should just get min
81 cat > $tmp.test2 << EOF
82 min, hour
83 EOF
84 # empty file (should fall back to previous config)
85 cat > $tmp.test3 << EOF
86 EOF
87 # should just get hour
88 cat > $tmp.test4 << EOF
89 sdj, min,hour,df
90 mday
91 EOF
92 # multiple entries the same ... should get just one instance returned
93 cat > $tmp.test5 << EOF
94 sec,sec,sec
95 EOF
97 # cp over prev config and then filter pminfo calls for each test
98 for test in $tmp.test1 $tmp.test2 $tmp.test3 $tmp.test4 $tmp.test5
100 $sudo cp $test $home/$iam/$iam.conf
101 sync
102 sleep 3
103 pminfo -f simple.now | _time_filter
104 $sudo rm -f $home/$iam/$iam.conf
105 done
106 $sudo cp $tmp.conf $home/$iam/$iam.conf
108 # remove the agent
109 $sudo ./Remove >$tmp.out 2>&1
110 _pmda_filter <$tmp.out
112 status=0
113 exit