#!/bin/sh
# PCP QA Test No. 707
# Exercise python PMAPI layer
#
# Copyright (c) 2012 Red Hat.
#

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

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

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

# real QA test starts here
python $here/src/test_pcp.python >$seq.full 2>&1
if grep OK $seq.full
then
    :
else
    # Give some hint as to what went wrong ...
    #
    $PCP_AWK_PROG <$seq.full '
$1 == "FAIL:"			{ want = 1 }
$1 == "File"			{ want = 1 }
want == 1 && $1 == "Ran" 	{ exit }
want == 1			{ print }'
fi

# success, all done
status=$?
exit
