3 # Test backwards compatibility for pmwebd options configuration.
5 # Copyright (c) 2014 Red Hat.
9 echo "QA output created by $seq"
12 which pmwebd
>/dev
/null
2>&1 || _notrun
"pmwebd not installed"
13 which curl
>/dev
/null
2>&1 || _notrun
"No curl binary installed"
18 [ -f $tmp.backup
] && \
19 $sudo cp $tmp.backup
$PCP_PMWEBDOPTIONS_PATH
23 status
=1 # failure is the default!
24 $sudo rm -rf $tmp.
* $seq.full
25 trap "_cleanup; exit \$status" 0 1 2 3 15
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
40 $sudo cp $tmp.config
$PCP_PMWEBDOPTIONS_PATH
42 $sudo $PCP_RC_DIR/pmwebd start
43 _wait_for_pmwebd
$webport
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