Merge branch 'master' of https://github.com/kmcdonell/pcp into kenj-merge
[pcp.git] / qa / 785
blob9ef5cda97c94099db275b727d002f22a5061b862
1 #!/bin/sh
2 # PCP QA Test No. 785
3 # Basic checkout of the pcp-atopsar(1) utility.
5 # Copyright (c) 2015 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 [ -f $PCP_BINADM_DIR/pcp-atopsar ] || _notrun "system monitoring tools not installed"
18 status=1 # failure is the default!
19 $sudo rm -rf $tmp.* $seq.full
20 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
22 _filter()
24 sed \
25 -e "s/^slick 3.19.0-rc7-nathans+.*/HOST-SUMMARY-LINE/g" \
26 #end
29 # real QA test starts here
30 allopts="-t1 -z"
32 echo; echo == Processor metrics
33 pcp $allopts atopsar -r $here/archives/pcp-atop -c | _filter
35 echo; echo == Disk metrics
36 pcp $allopts atopsar -r $here/archives/pcp-atop -d | _filter
38 echo; echo == Network metrics
39 pcp $allopts atopsar -r $here/archives/pcp-atop -i | _filter
41 echo; echo == Memory metrics
42 pcp $allopts atopsar -r $here/archives/pcp-atop -m | _filter
44 echo; echo == Checking sample count and interval
45 export PCP_ARCHIVE=$here/archives/pcp-atop
46 pcp -z atopsar -m 2 3 > $tmp.mem1
47 pcp -z -t 2 -s 3 atopsar -m > $tmp.mem2
48 unset PCP_ARCHIVE
49 test -s $tmp.mem1 || echo "Unexpected empty file 1"
50 test -s $tmp.mem2 || echo "Unexpected empty file 2"
51 diff $tmp.mem1 $tmp.mem2 && echo OK
53 # success, all done
54 echo; echo "== Done"
55 status=0
56 exit