1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#!/bin/sh
# PCP QA Test No. 1532
# Test Linux ZFS PMDA against a live ZFS pool - part A (older stats files)
# See also qa/1309 for part B
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
[ $PCP_PLATFORM = linux ] || _notrun "Linux ZFS PMDA is Linux-specific (uses procfs)"
[ -d $PCP_PMDAS_DIR/zfs ] || _notrun "Linux ZFS PMDA not installed"
grep -q zfs /proc/filesystems || _notrun "ZFS filesystem unsupported by the running kernel"
which zpool > /dev/null || _notrun "zpool not found, please check your OpenZFS installation"
zpool -? 2>&1 | grep -q "make sure that the zfs-fuse daemon is running."
[ $? -eq 0 ] && _notrun "zfs-fuse is installed but test targets OpenZFS"
for file in arcstats dmu_tx xuio_stats zfetchstats zil
do
[ -f /proc/spl/kstat/zfs/$file ] || _notrun "/proc/spl/kstat/zfs/$file is missing"
done
status=1
trap "cd $here; $sudo rm -rf $tmp.*; exit \$status" 0 1 2 3 15
_filter()
{
$here/src/sortinst \
| sed -e '/inst /s/\[[01] /[0-or-1 /'
}
pmda=$PCP_PMDAS_DIR/zfs/pmda_zfs.so,zfs_init
pmns=$PCP_PMDAS_DIR/zfs/root
opts="-L -K clear -K add,153,$pmda -n $pmns"
ZFS_PATH=; export ZFS_PATH
poolname=pmdazfs_test
root=$tmp.root
$sudo rm -f $PCP_VAR_DIR/config/pmda/153.*
$sudo rm -fr $root
mkdir $root || _fail "root in use when processing $tgz"
$sudo dd if=/dev/zero of=$root/disk.img bs=1024 count=65536 > /dev/null 2>&1
$sudo zpool create $poolname $root/disk.img
echo "== Checking metric count for ZFS ARC"
pminfo $opts -f zfs.arc | grep '^ \+value ' | wc -l 2>&1
echo "== Checking metric count for ZFS DMU TX"
pminfo $opts -f zfs.dmu_tx | grep '^ \+value ' | wc -l 2>&1
echo "== Checking metric count for ZFS XUIO"
pminfo $opts -f zfs.xuio | grep '^ \+value ' | wc -l 2>&1
echo "== Checking metric count for ZFS ZFetch"
pminfo $opts -f zfs.zfetch | grep '^ \+value ' | wc -l 2>&1
echo "== Checking metric count for ZFS ZIL"
pminfo $opts -f zfs.zil | grep '^ \+value ' | wc -l 2>&1
echo "== Checking metric count for ZFS pool $poolname"
pminfo $opts -f zfs.pool | grep $poolname | wc -l 2>&1
echo && echo "== done" && echo
$sudo zpool destroy $poolname
$sudo rm $root/disk.img
# success, all done
status=0
exit
|