#!/bin/sh
# PCP QA Test No. 1709
# Exercises pmdastatsd - default values of hardcoded metrics, all should equal 0
#
# Copyright (c) 2020 Red Hat.
#

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

# get standard environment, filters and checks
. ./common.python

test -e $PCP_PMDAS_DIR/statsd/pmdastatsd || _notrun "statsd PMDA not installed"

_check_valgrind

_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

_prepare_pmda statsd
# note: _restore_auto_restart pmcd done in _cleanup_pmda()
trap "_cleanup_pmda statsd; exit \$status" 0 1 2 3 15
_stop_auto_restart pmcd

cd $here/statsd/src
$sudo $python cases/03.py
cd $here
status=0
exit
