3 # Exercise the zswap PMDA using the running kernel.
5 # Copyright (c) 2014,2016 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ -f $PCP_PMDAS_DIR/zswap
/pmdazswap.python
] || _notrun
"zswap pmda not installed"
17 $sudo test -d /sys
/kernel
/debug
/zswap || _notrun
"No kernel support for zswap"
19 status
=1 # failure is the default!
20 $sudo rm -f $tmp.
* $seq.full
24 # filter metric values for deterministic output
25 tee -a $here/$seq.full |
sed \
26 -e 's/value [0-9][0-9]*/value NUMBER/'
32 echo "=== remove $iam agent ==="
33 $sudo .
/Remove
>$tmp.out
2>&1
34 _filter_pmda_remove
<$tmp.out
39 # start from a known starting point
40 cd $PCP_PMDAS_DIR/zswap
41 $sudo .
/Remove
>/dev
/null
2>&1
42 $sudo $PCP_RC_DIR/pmcd stop | _filter_pcp_stop
45 echo "=== $iam agent installation ==="
46 $sudo .
/Install
</dev
/null
>$tmp.out
2>&1
47 # Check zswap metrics have appeared ... X metrics and Y values
48 _filter_pmda_install
<$tmp.out \
50 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
51 -e 's/[0-9][0-9]* warnings, //' \
53 /Check zswap metrics have appeared/ { if ($7 >= 8 && $7 <= 20) $7 = "X"
54 if ($10 >= 8 && $10 <= 20) $10 = "Y"
60 trap "_cleanup_pmda zswap; exit \$status" 0 1 2 3 15
62 # real QA test starts here
65 # pmcd should have been started by the Install process - check
66 if pminfo
-v zswap
> $tmp.info
2> $tmp.err
70 echo "... failed! ... here is the Install log ..."
73 cat $tmp.info
$tmp.err | _filter_zswap