/var/lib/pcp/testsuite/662 is in pcp-testsuite 4.0.1-1.
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 75 76 77 | #! /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
_check_pmwebd
_check_requests_json
_stop_auto_restart pmwebd # see GH #394
_service pmwebd stop >/dev/null 2>&1
$sudo $signal -a pmwebd >/dev/null 2>&1
$sudo rm -f $tmp.* $seq.full
pyscript=src/test_webapi.py
signal=$PCP_BINADM_DIR/pmsignal
status=1 # failure is the default!
username=`id -u -n`
webargs="-U $username -P"
webport=`_find_free_port`
webpid=""
_cleanup()
{
if [ "X$webpid" != "X" ]; then
$signal -s TERM $webpid
webpid=""
fi
_restore_auto_restart pmwebd
_service pmwebd restart >/dev/null 2>&1
$sudo rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
$PCP_BINADM_DIR/pmwebd -l $tmp.out $webargs -p $webport -v -t5 &
webpid=$!
echo "pid=$webpid" >>$seq.full
echo "webport=$webport" >>$seq.full
echo "webargs=$webargs" >>$seq.full
_wait_for_pmwebd_logfile $tmp.out $webport
# 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
echo >>$here/$seq.full
echo "=== pmwebd log ===" >>$here/$seq.full
cat $tmp.out >>$here/$seq.full
status=0
exit
|