python api: fix syntax error in recent context changes
[pcp.git] / qa / 727
blob53bbcc5566d274c25fa52cf9a2a3a7a28c2ebfe6
1 #!/bin/sh
2 # PCP QA Test No. 727
3 # Check that pmwebd advertises its presence using avahi
5 # Copyright (c) 2014-2016 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 . ./common.avahi
12 . ./common.webapi
14 avahi_notrun_checks
15 [ -x $PCP_RC_DIR/pmwebd ] || _notrun "PCP web services not installed"
16 PCP_PMWEBDOPTIONS_PATH=$PCP_SYSCONF_DIR/pmwebd/pmwebd.options
18 _cleanup()
20 # ensure we do not leave local-only settings enabled
21 _restore_config $PCP_PMWEBDOPTIONS_PATH
22 avahi_cleanup
25 status=1 # failure is the default!
26 $sudo rm -rf $tmp.* $seq.full
27 trap "_cleanup; exit \$status" 0 1 2 3 15
29 # real QA test starts here
30 service=pmwebd
31 _save_config $PCP_PMWEBDOPTIONS_PATH
33 avahi_service
34 _wait_for_pmwebd_logfile $PCP_LOG_DIR/pmwebd/pmwebd.log 44323
35 avahi_verify
37 # check -S (service discovery disabling) option works
38 cp $PCP_PMWEBDOPTIONS_PATH $tmp.conf
39 echo 'OPTIONS="$OPTIONS -S"' >> $tmp.conf
40 $sudo mv $tmp.conf $PCP_PMWEBDOPTIONS_PATH
42 avahi_service
43 _wait_for_pmwebd_logfile $PCP_LOG_DIR/pmwebd/pmwebd.log 44323
44 avahi_verify "Verify $service avahi discovery disabling option"
46 status=0
47 exit