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.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
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
27 PMWEBD_INSTALLED
=false
29 FULL_LIST
="pmcd pmie pmlogger pmproxy"
31 .
$PCP_SHARE_DIR/lib
/rc-proc.sh
37 echo "is_chkconfig_on $1 returns true"
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
]
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
]
53 if $PMWEBD_INSTALLED ;
55 FULL_LIST
="pmcd pmie pmlogger pmmgr pmproxy pmwebd"
56 ln -f $seq.out
.4 $seq.out ||
exit 1
58 FULL_LIST
="pmcd pmie pmlogger pmmgr pmproxy"
59 ln -f $seq.out
.3 $seq.out ||
exit 1
64 # real QA test starts here
67 is_chkconfig_on pmie
>>$seq.full
73 is_chkconfig_on
$svc && save
=on
74 echo "initial state for $svc: $save" >>$seq.full
77 echo "=== $svc $state ==="
78 if [ -f $PCP_RC_DIR/$svc ]
80 _change_config
$svc $state
83 # fake output when init script not installed
86 [ $state = off
] && xpect
=false
87 echo "is_chkconfig_on $svc returns $xpect"
90 [ -f $PCP_RC_DIR/$svc ] && _change_config
$svc $save