zsh completions: minor tweaks
[pcp.git] / qa / 1009
blob2aed671c1537675aa3a9811c9d5a97fcd20348dc
1 #!/bin/sh
2 # PCP QA Test No. 1009
3 # Exercise some pmdumptext problems
5 seq=`basename $0`
6 echo "QA output created by $seq"
8 status=1 # failure is the default!
9 . ./common.qt
10 trap "_cleanup_qt; exit \$status" 0 1 2 3 15
12 which pmdumptext >/dev/null 2>&1 || _notrun "pmdumptext not installed"
13 rm -f $seq.full
15 # proc metrics may not be available
16 pminfo proc.nprocs >/dev/null 2>&1 || _notrun "proc PMDA not installed"
18 # see if unix domain sockets are available (permissions)
19 eval `pmconfig -L -s unix_domain_sockets`
20 target="-h localhost"
21 $unix_domain_sockets && target="-h unix:"
22 echo "unix_domain_sockets=$unix_domain_sockets" >>$seq.full
23 echo "target=$target" >>$seq.full
25 # real QA test starts here
26 inst=`pminfo $target -F proc.psinfo.pid \
27 | tee -a $seq.full \
28 | sed -n -e '/inst \[1 /{
29 s/^[^"]*"//
30 s/ .*//
32 }'`
34 if [ -z "$inst" ]
35 then
36 echo "Arrgh, cannot find proc.psinfo.pid for init!"
37 pminfo $target -F proc.psinfo.pid
40 echo "proc.psinfo.pid[$inst] 0" >$tmp.config
41 echo "proc.psinfo.pid[1]" >> $tmp.config
43 pmdumptext $target -G -s 1 -f '' -t 1 -c $tmp.config >$tmp.out 2>&1
45 echo
46 echo "expect two \"1\"s ..."
47 sort -u $tmp.out
49 # success, all done
50 status=0
51 exit