3 # Exercise libpcp_web HTTP client interfaces.
5 # Copyright (c) 2016 Red Hat.
9 echo "QA output created by $seq"
12 which pmwebd
>/dev
/null
2>&1 || _notrun
"pmwebd not installed"
13 [ -f "$PCP_SHARE_DIR/webapps/index.html" ] || _notrun
"No webapps installed"
15 signal
=$PCP_BINADM_DIR/pmsignal
16 status
=1 # failure is the default!
18 $sudo rm -rf $tmp $tmp.
* $seq.full
19 trap "cd $here; _cleanup; exit \$status" 0 1 2 3 15
23 [ -z "$webpid" ] ||
$signal $webpid
30 webport
=`_find_free_port`
32 # real QA test starts here
33 pmwebd
-U $username -P -l $tmp.out
-p $webport 2>$tmp.err
&
35 _wait_for_pmwebd
$webport
37 echo "pmwebd pid=$webpid port=$webport" >>$seq.full
39 echo "== Check simple path fetch" |
tee -a $seq.full
40 $here/src
/httpfetch
"http://localhost:$webport/index.html" 2>&1 >> $seq.full
41 [ $?
-eq 0 ] && echo OK
43 echo "== Exercise http redirect" |
tee -a $seq.full
44 $here/src
/httpfetch
"http://localhost:$webport" 2>&1 >> $seq.full
45 [ $?
-eq 0 ] && echo OK
47 echo "--- pmwebd log ---" >>$seq.full
48 cat $tmp.out
>>$seq.full
49 echo "--- pmwebd stderr ---" >>$seq.full
50 cat $tmp.err
>>$seq.full