qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 845
blobea3771f4f8df7f241f57da3712d13903877ad9e9
1 #!/bin/sh
2 # PCP QA Test No. 845
3 # Exercise the mounts PMDA Install/Remove and basic functionality.
5 # Copyright (c) 2015 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 . ./common.python
12 [ $PCP_PLATFORM = mingw -o $PCP_PLATFORM = darwin ] && \
13 _notrun "Test only valid on platforms with a mount table"
15 [ -n "$PCP_PYTHON_PROG" ] || _notrun "no acceptable python to run src/fsstats.python"
17 status=1 # failure is the default!
18 $sudo rm -rf $tmp.* $seq.full
20 _filter_mounts()
22 # cull some default mounts, non-deterministic values
23 # all systems will have "/" and not "/not-here" so we
24 # keep those, but /boot and /afs we'll filter out.
26 sed \
27 -e '/\/boot/d' \
28 -e '/\/afs/d' \
29 -e 's/ value ".*"$/ value VALUE/g' \
30 -e 's/ value [0-9.]*$/ value NUMBER/g' \
31 #end
34 pmdamounts_remove()
36 echo
37 echo "=== remove mounts agent ==="
38 $sudo ./Remove >$tmp.out 2>&1
39 _filter_pmda_remove <$tmp.out
42 pmdamounts_install()
44 # start from known starting points
45 cd $PCP_PMDAS_DIR/mounts
46 $sudo ./Remove >/dev/null 2>&1
47 $sudo $PCP_RC_DIR/pmcd stop 2>&1 | _filter_pcp_stop
49 echo
50 echo "=== mounts agent installation ==="
51 $sudo ./Install </dev/null >$tmp.out 2>&1
52 cat $tmp.out >>$here/$seq.full
53 # Check mounts metrics have appeared ... X metrics and Y values
54 _filter_pmda_install <$tmp.out \
55 | sed \
56 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
57 -e 's/[0-9][0-9]* warnings, //' \
58 | $PCP_AWK_PROG '
59 /Check mounts metrics have appeared/ { if ($7 = 4) $7 = "X"
60 if ($10 = 4) $10 = "Y"
62 { print }'
65 _prepare_pmda mounts
66 trap "_cleanup_pmda mounts; exit \$status" 0 1 2 3 15
68 # real QA test starts here
69 pmdamounts_install
71 echo "=== verify mounts values ===" | tee -a $here/$seq.full
72 if pminfo -f mounts > $tmp.info 2> $tmp.err
73 then
74 rootdev=`pminfo -f mounts.device | grep '"/"' | awk '{ print $6 }'`
75 echo "rootdev=$rootdev" >>$here/$seq.full
76 eval $python $here/src/fsstats.python $rootdev "/" | \
77 while read metric filesys mounts
79 _within_tolerance $metric $filesys $mounts 1 -v # allow +/-1%
80 done
81 else
82 echo "... failed! ... here is the Install log ..."
83 cat $tmp.out
85 cat $tmp.info $tmp.err | _filter_mounts
87 pmdamounts_remove
88 status=0
89 exit