pmrep: update TODO, man page
[pcp.git] / qa / 782
blobe736e2d815d1b9f2896b30a6b4fcc72f66467dbd
1 #!/bin/sh
2 # PCP QA Test No. 782
3 # Test backwards compatibility for pmwebd options configuration.
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 _cleanup()
17 cd $here
18 [ -f $tmp.backup ] && \
19 $sudo cp $tmp.backup $PCP_PMWEBDOPTIONS_PATH
20 $sudo rm -rf $tmp.*
23 status=1 # failure is the default!
24 $sudo rm -rf $tmp.* $seq.full
25 trap "_cleanup; exit \$status" 0 1 2 3 15
27 unset http_proxy
28 unset HTTP_PROXY
29 webport=`_find_free_port`
31 # real QA test starts here
32 $sudo $PCP_RC_DIR/pmwebd stop >/dev/null 2>&1
33 $sudo cp $PCP_PMWEBDOPTIONS_PATH $tmp.backup
35 # create an old-format configuration file
36 cat <<EOF >$tmp.config
37 -p $webport
39 EOF
40 $sudo cp $tmp.config $PCP_PMWEBDOPTIONS_PATH
42 $sudo $PCP_RC_DIR/pmwebd start
43 _wait_for_pmwebd $webport
45 echo
46 echo "Verifying pmwebd started with old configuration:"
47 curl -s -S "http://localhost:$webport/pmapi/context?local=anything" -D- 2>&1 | _webapi_header_filter
49 # new-format configuration file via _cleanup
50 $sudo cp $tmp.backup $PCP_PMWEBDOPTIONS_PATH
51 $sudo rm -f $tmp.backup
52 $sudo $PCP_RC_DIR/pmwebd restart
53 _wait_for_pmwebd 44323
55 # success, all done
56 status=0
57 exit