3 # checks pmwebd functionality using python test script
5 # Copyright (c) 2013-2015 Red Hat, Inc. All Rights Reserved.
8 echo "QA output created by $seq"
16 $sudo rm -f $tmp.
* $seq.full
18 pyscript
=src
/test_webapi.py
19 signal
=$PCP_BINADM_DIR/pmsignal
20 status
=1 # failure is the default!
23 webargs
="-U $username -P"
24 webport
=`_find_free_port`
29 if [ "X$webpid" != "X" ]; then
30 $signal -s TERM
$webpid
36 trap "_cleanup; exit \$status" 0 1 2 3 15
38 $PCP_BINADM_DIR/pmwebd
$webargs -p $webport -l $tmp.out
-v -t5 &
40 echo "pid=$webpid" >>$seq.full
41 echo "webport=$webport" >>$seq.full
42 echo "webargs=$webargs" >>$seq.full
44 _wait_for_pmwebd_logfile
$tmp.out
$webport
46 # prepare the expected output file based on detected mode
48 if grep -q IPv6
$tmp.out
; then
49 grep -q IPv4
$tmp.out || _notrun
"QA host running in IPv6 mode only"
50 ln $seq.out
.46 $seq.out
# ipv6 + ipv4
52 ln $seq.out
.4 $seq.out
# ipv4 only
55 ipv6local
=`_ipv6_localhost`
56 echo "ipv6local=$ipv6local" >>$seq.full
57 if grep -q IPv4
$tmp.out
; then
58 echo && echo === IPv4 pmwebd testing via python
===
59 $python $pyscript --host localhost
--port $webport | _webapi_response_filter
61 if grep -q IPv6
$tmp.out
; then
62 echo && echo === IPv6 pmwebd testing via python
===
63 $python $pyscript --host $ipv6local --port $webport | _webapi_response_filter
66 echo >>$here/$seq.full
67 echo "=== pmwebd log ===" >>$here/$seq.full
68 cat $tmp.out
>>$here/$seq.full