zsh completions: minor tweaks
[pcp.git] / qa / 780
blobc1b6c5e9a5fe2003e1b7fcca47865ecf3b83ec3d
1 #!/bin/sh
2 # PCP QA Test No. 780
3 # Exercise addition of pmwebd Access-Control-Allow-Origin HTTP header.
5 # Copyright (c) 2014 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 . ./common.webapi
12 which pmwebd >/dev/null 2>&1 || _notrun "pmwebd not installed"
13 which curl >/dev/null 2>&1 || _notrun "No curl binary installed"
15 signal=$PCP_BINADM_DIR/pmsignal
16 status=1 # failure is the default!
17 username=`id -u -n`
18 $sudo rm -rf $tmp.* $seq.full
19 trap "cd $here; _cleanup; exit \$status" 0 1 2 3 15
21 _cleanup()
23 [ -z "$webpid" ] || $signal $webpid
24 $sudo rm -fr $tmp.dir
25 $sudo rm -f $tmp.*
28 unset http_proxy
29 unset HTTP_PROXY
30 webport=`_find_free_port`
32 # real QA test starts here
33 pmwebd -U $username -P -l $tmp.out -p $webport 2>$tmp.err &
34 webpid=$!
35 _wait_for_pmwebd $webport
37 echo "pmwebd pid=$webpid port=$webport" >>$seq.full
38 curl -s -S "http://localhost:$webport/pmapi/context?local=anything" -D- 2>&1 | _webapi_header_filter
40 echo "--- pmwebd log ---" >>$seq.full
41 cat $tmp.out >>$seq.full
42 echo "--- pmwebd stderr ---" >>$seq.full
43 cat $tmp.err >>$seq.full
45 # success, all done
46 status=0
47 exit