/var/lib/pcp/testsuite/662 is in pcp-testsuite 3.10.8build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 65 66 67 68 69 70 71 72 73 74 | #! /bin/sh
# PCP QA Test No. 662
# checks pmwebd functionality using python test script
#
# Copyright (c) 2013-2015 Red Hat, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
. ./common.webapi
. ./common.python
[ -f ${PCP_BINADM_DIR}/pmwebd ] || _notrun "pmwebd package not installed"
pyscript=src/test_webapi.py
$python --version >/dev/null 2>&1 || _notrun "python missing"
version=`$python --version 2>&1 | sed -e 's/Python //'`
case "$version"
in
2.7.3|2.7.4)
_notrun "requests.json() broken in Python $version"
;;
esac
$sudo rm -f $tmp.* $seq.full
signal=$PCP_BINADM_DIR/pmsignal
status=1 # failure is the default!
username=`id -u -n`
webargs="-U $username"
webport=`_find_free_port`
webpid=""
_cleanup()
{
if [ "X$webpid" != "X" ]; then
$signal -s TERM $webpid
webpid=""
fi
$sudo rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
$PCP_BINADM_DIR/pmwebd $webargs -p $webport -l $tmp.out -v -t5 &
webpid=$!
echo "pid=$webpid" >>$seq.full
_wait_for_pmwebd_logfile $tmp.out
# prepare the expected output file based on detected mode
rm -f $seq.out
if grep -q IPv6 $tmp.out; then
grep -q IPv4 $tmp.out || _notrun "QA host running in IPv6 mode only"
ln $seq.out.46 $seq.out # ipv6 + ipv4
else
ln $seq.out.4 $seq.out # ipv4 only
fi
ipv6local=`_ipv6_localhost`
echo "ipv6local=$ipv6local" >>$seq.full
if grep -q IPv4 $tmp.out; then
echo && echo === IPv4 pmwebd testing via python ===
$python $pyscript --host localhost --port $webport | _webapi_response_filter
fi
if grep -q IPv6 $tmp.out; then
echo && echo === IPv6 pmwebd testing via python ===
$python $pyscript --host $ipv6local --port $webport | _webapi_response_filter
fi
status=0
exit
|