3 # Exercise the mounts PMDA Install/Remove and basic functionality.
5 # Copyright (c) 2015 Red Hat.
9 echo "QA output created by $seq"
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
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.
29 -e 's/ value ".*"$/ value VALUE/g' \
30 -e 's/ value [0-9.]*$/ value NUMBER/g' \
37 echo "=== remove mounts agent ==="
38 $sudo .
/Remove
>$tmp.out
2>&1
39 _filter_pmda_remove
<$tmp.out
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
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 \
56 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
57 -e 's/[0-9][0-9]* warnings, //' \
59 /Check mounts metrics have appeared/ { if ($7 = 4) $7 = "X"
60 if ($10 = 4) $10 = "Y"
66 trap "_cleanup_pmda mounts; exit \$status" 0 1 2 3 15
68 # real QA test starts here
71 echo "=== verify mounts values ===" |
tee -a $here/$seq.full
72 if pminfo
-f mounts
> $tmp.info
2> $tmp.err
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%
82 echo "... failed! ... here is the Install log ..."
85 cat $tmp.info
$tmp.err | _filter_mounts