build: Makepkgs support for vector deb building
[pcp.git] / qa / 187
blob8bd9543308ecad5908253247367b3c6e41719ea6
1 #! /bin/sh
2 # PCP QA Test No. 187
3 # for bug #327288 - $PCP_RC_DIR/pcp blows away $PCP_TMP_DIR/pmlogger entries
5 # Note ... this will be a "sometimes" failure ... requires special
6 # combinations of pids such that sort != sort -n and comm gets confused
7 # $PCP_RC_DIR/pcp
9 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
12 seq=`basename $0`
13 echo "QA output created by $seq"
15 # get standard filters
16 . ./common.product
17 . ./common.filter
18 . ./common.check
20 sts=0
21 trap "$sudo rm -f $tmp.*; exit \$sts" 0 1 2 3 15
22 signal=$PCP_BINADM_DIR/pmsignal
24 rm -f $seq.full
26 _burn_pids()
28 # burn off 1024 pids
30 for i in 1 2 3 4 5 6 7 8
32 for j in 1 2 3 4 5 6 7 8
34 for k in 1 2 3 4 5 6 7 8
36 for l in 1 2
38 true
39 done
40 done
41 done
42 done
45 _check()
47 ( echo "this" $this_pid;
48 echo "other" $other_pid;
49 echo "other-fqdn" $otherfqdn_pid; ) \
50 | while read tag pid
52 $PCP_ECHO_PROG $PCP_ECHO_N "map file for $tag host""$PCP_ECHO_C"
53 if [ -f $PCP_TMP_DIR/pmlogger/$pid ]
54 then
55 $PCP_ECHO_PROG " present"
56 else
57 $PCP_ECHO_PROG $PCP_ECHO_N " missing ... ""$PCP_ECHO_C"
59 if [ "$tag" = this ]
60 then
61 $PCP_ECHO_PROG "expected for this host when PMCD killed"
62 else
63 $PCP_ECHO_PROG "NOT EXPECTED"
64 echo "pid=$pid, $PCP_TMP_DIR/pmlogger contains"
65 ls -l $PCP_TMP_DIR/pmlogger
66 echo "pmlogger processes ..."
67 ps $PCP_PS_ALL_FLAGS | grep pmlogger
68 echo "pmlogger log file for missing one ..."
69 cat $tmp.$pid
72 done
75 otherhost=`./getpmcdhosts -L -n 1`
76 [ -z "$otherhost" ] && _notrun "Cannot find a remote host running pmcd"
77 echo "otherhost=$otherhost" >>$seq.full
78 otherip=`_host_to_ipaddr $otherhost`
79 if [ -z "$otherip" ]
80 then
81 echo "Arrgh ... cannot get IP addr for otherhost=$otherhost"
82 sts=1
83 exit
85 echo "otherip=$otherip" >>$seq.full
87 # real QA test starts here
88 _start_up_pmlogger -L -c /dev/null -l $tmp.log1 -s1 $tmp.this >/dev/null 2>&1
89 this_pid=$pid
90 echo "this logger pid=$this_pid" >>$seq.full
91 _wait_for_pmlogger $this_pid $tmp.log1
92 $sudo mv $tmp.log1 $tmp.$this_pid
94 trap "$sudo $signal $this_pid $other_pid $otherfqdn_pid >/dev/null 2>&1; wait; $sudo rm -fr $tmp.*; exit \$sts" 0 1 2 3 15
96 _burn_pids
98 _start_up_pmlogger -h $otherhost -L -c /dev/null -l $tmp.log2 -s1 $tmp.other >/dev/null 2>&1
99 other_pid=$pid
100 echo "other host=$otherhost logger pid=$other_pid" >>$seq.full
101 _wait_for_pmlogger $other_pid $tmp.log2
102 $sudo mv $tmp.log2 $tmp.$other_pid
104 _burn_pids
106 _start_up_pmlogger -h $otherip -L -c /dev/null -l $tmp.log3 -s1 $tmp.other.fqdn >/dev/null 2>&1
107 otherfqdn_pid=$pid
108 echo "other fqdnhost=$otherip logger pid=$otherfqdn_pid" >>$seq.full
109 _wait_for_pmlogger $otherfqdn_pid $tmp.log3
110 $sudo mv $tmp.log3 $tmp.$otherfqdn_pid
112 # check entries
113 _check
115 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
116 _wait_for_pmcd
117 _wait_for_pmlogger
119 # check again
120 _check
122 echo >>$seq.full
123 echo "=== this log ===" >>$seq.full
124 cat $tmp.$this_pid >>$seq.full
127 echo >>$seq.full
128 echo "=== other log ===" >>$seq.full
129 cat $tmp.$other_pid >>$seq.full
132 echo >>$seq.full
133 echo "=== otherfqdn log ===" >>$seq.full
134 cat $tmp.$otherfqdn_pid >>$seq.full