qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 199
blob4676fcab60a76cb777a14af4e819949c087d6e5c
1 #! /bin/sh
2 # PCP QA Test No. 199
3 # check out trivial PMDA
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.filter
14 . ./common.check
16 signal=$PCP_BINADM_DIR/pmsignal
17 status=1
18 install_on_cleanup=false
19 pminfo trivial >/dev/null 2>&1 && install_on_cleanup=true
21 _cleanup()
24 if $sudo make >$tmp.out 2>&1
25 then
27 else
28 cat $tmp.out
29 echo "Arrgh, cleanup make failed"
30 exit
33 _restore_config $PCP_VAR_DIR/pmns/root
35 if diff $PCP_PMCDCONF_PATH.$seq $PCP_PMCDCONF_PATH > /dev/null 2>&1
36 then
37 _restore_config $PCP_PMCDCONF_PATH
38 else
41 if $install_on_cleanup
42 then
43 # do a default install which ensures the pmns and any views are installed
44 $sudo ./Install </dev/null >/dev/null 2>&1
45 else
46 # leave the landscape clean like you found it
47 $sudo ./Remove >/dev/null 2>&1
50 # PMDA may have been installed differently to default. As everything is
51 # installed we can use the old pmcd.conf file to restore state.
53 if diff $PCP_PMCDCONF_PATH.$seq $PCP_PMCDCONF_PATH > /dev/null 2>&1
54 then
55 _restore_config $PCP_PMCDCONF_PATH
56 else
57 _restore_config $PCP_PMCDCONF_PATH
58 $sudo $signal -a -s HUP pmcd
62 rm -f $tmp.*
63 exit $status
66 trap "_cleanup" 0 1 2 3 15
68 _filter()
70 _filter_pmda_install
73 # real QA test starts here
74 home=$PCP_PMDAS_DIR
75 iam=trivial
76 if [ ! -d $home/$iam ]
77 then
78 echo "Where is $home/$iam?"
79 exit 1
81 cd $home/$iam
82 unset ROOT MAKEFLAGS
84 # copy some config file to restore state later.
85 _save_config $PCP_PMCDCONF_PATH
86 _save_config $PCP_VAR_DIR/pmns/root
88 if $sudo make clobber >$tmp.out 2>&1
89 then
91 else
92 cat $tmp.out
93 echo "Arrgh, make clobber failed"
94 exit
97 if $sudo make >$tmp.out 2>&1
98 then
100 else
101 cat $tmp.out
102 echo "Arrgh, make failed"
103 exit
106 # start from a known starting point
107 $sudo ./Remove >/dev/null 2>&1
109 echo
110 echo "=== pipe daemon agent ==="
111 $sudo ./Remove >$tmp.out 2>&1
112 echo 'both
113 daemon
114 pipe' | $sudo ./Install >>$tmp.out 2>&1
116 _filter <$tmp.out
118 if pminfo -v trivial
119 then
121 else
122 echo "... failed! ... here is the Install log ..."
123 cat $tmp.out
126 echo
127 echo "=== Unix socket daemon agent ==="
128 $sudo ./Remove >$tmp.out 2>&1
129 echo 'both
130 daemon
131 socket
132 Unix
133 '"$tmp.fifo" | $sudo ./Install >>$tmp.out 2>&1
134 echo 'both
135 daemon
136 socket
137 Unix
138 '"$tmp.fifo" | $sudo ./Install >>$tmp.out 2>&1
140 _filter <$tmp.out
142 if pminfo -v trivial
143 then
145 else
146 echo "... failed! ... here is the Install log ..."
147 cat $tmp.out
150 echo
151 echo "=== Internet socket daemon agent ==="
152 $sudo ./Remove >$tmp.out 2>&1
154 # pick a tcp port that is not in use
156 port=`_get_port tcp 5670 5689`
157 if [ -z "$port" ]
158 then
159 echo "Arrgh ... no free TCP port in the range 5670 ... 5689"
160 exit 1
163 echo 'both
164 daemon
165 socket
166 Internet
167 '$port | $sudo ./Install >>$tmp.out 2>&1
169 # use next port this time
170 port=`expr $port + 1`
172 echo 'both
173 daemon
174 socket
175 Internet
176 '$port | $sudo ./Install >>$tmp.out 2>&1
178 _filter <$tmp.out
180 if pminfo -v trivial
181 then
183 else
184 echo "... failed! ... here is the Install log ..."
185 cat $tmp.out
188 echo
189 echo "=== dso agent ==="
190 $sudo ./Remove >$tmp.out 2>&1
191 echo 'both
192 dso' | $sudo ./Install >>$tmp.out 2>&1
193 echo 'both
194 dso' | $sudo ./Install >>$tmp.out 2>&1
196 _filter <$tmp.out
198 if pminfo -v trivial
199 then
201 else
202 echo "... failed! ... here is the Install log ..."
203 cat $tmp.out
206 $sudo ./Remove >$tmp.out 2>&1
207 _filter <$tmp.out
209 status=0
210 exit