#!/bin/sh
# PCP QA Test No. 1303
# Exercise pcp-dstat extra device handling options (RH BZ #1794273).
#
# Copyright (c) 2020 Red Hat.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

test -x $PCP_BINADM_DIR/pcp-dstat || _notrun "No pcp-dstat(1) installed"

_cleanup()
{
    cd $here
    $sudo rm -rf $tmp $tmp.*
}

status=1	# failure is the default!
$sudo rm -rf $tmp $tmp.* $seq.full
trap "_cleanup; exit \$status" 0 1 2 3 15

# real QA test starts here
echo "Device Mapper"
pcp -z --archive archives/dm-io dstat --device-mapper -L dmcache1 --nocolor --time
echo

echo "Partitions"
pcp -z --archive archives/dm-io dstat --partition -P sda10,sdb1,total --nocolor --time
echo

# success, all done
status=0
exit
