pmrep: fix archive end time reporting
[pcp.git] / qa / 769
blob6d1125b5d7a664f868490095d04a16b701e6206c
1 #!/bin/sh
2 # PCP QA Test No. 769
3 # Check if the "chkconfig" controls and tests for the init scripts
4 # and as used in the QA tests really work.
6 # Copyright (c) 2014 Ken McDonell. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 # chconfig controls just don't work on some platforms ...
19 [ -f /etc/gentoo-release ] && _notrun "chkconfig does not work for Gentoo"
20 [ -f /etc/slackware-version ] && _notrun "chkconfig does not work for Slackware"
22 status=1 # failure is the default!
23 $sudo rm -rf $tmp.* $seq.full $seq.out
24 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
26 VERBOSE_CONFIG=false
27 PMWEBD_INSTALLED=false
28 PMMGR_INSTALLED=false
29 FULL_LIST="pmcd pmie pmlogger pmproxy"
31 . $PCP_SHARE_DIR/lib/rc-proc.sh
33 _check_chk()
35 if is_chkconfig_on $1
36 then
37 echo "is_chkconfig_on $1 returns true"
38 else
39 echo "is_chkconfig_on $1 returns false"
43 ln -f $seq.out.1 $seq.out || exit 1
44 if [ -f $PCP_BINADM_DIR/pmwebd ]
45 then
46 PMWEBD_INSTALLED=true
47 FULL_LIST="pmcd pmie pmlogger pmproxy pmwebd"
48 ln -f $seq.out.2 $seq.out || exit 1
50 if [ -f $PCP_BINADM_DIR/pmmgr ]
51 then
52 PMMGR_INSTALLED=true
53 if $PMWEBD_INSTALLED ;
54 then
55 FULL_LIST="pmcd pmie pmlogger pmmgr pmproxy pmwebd"
56 ln -f $seq.out.4 $seq.out || exit 1
57 else
58 FULL_LIST="pmcd pmie pmlogger pmmgr pmproxy"
59 ln -f $seq.out.3 $seq.out || exit 1
64 # real QA test starts here
66 VERBOSE_CONFIG=true
67 is_chkconfig_on pmie >>$seq.full
68 VERBOSE_CONFIG=false
70 for svc in $FULL_LIST
72 save=off
73 is_chkconfig_on $svc && save=on
74 echo "initial state for $svc: $save" >>$seq.full
75 for state in off on
77 echo "=== $svc $state ==="
78 if [ -f $PCP_RC_DIR/$svc ]
79 then
80 _change_config $svc $state
81 _check_chk $svc
82 else
83 # fake output when init script not installed
85 xpect=true
86 [ $state = off ] && xpect=false
87 echo "is_chkconfig_on $svc returns $xpect"
89 done
90 [ -f $PCP_RC_DIR/$svc ] && _change_config $svc $save
91 done
93 # success, all done
94 status=0
96 exit