1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

tests/eventscripts: Override background_with_logging(), just prepend "&"

That is, output that goes through background_with_logging() just gets
"&" prepended to each line.  This is cleaner than having the tests
grovel through logs.

Update some 49.winbind/50.samba tests to deal with this.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3ba933d806106d12bc48b83b22d0f314d9d1e5e5)
This commit is contained in:
Martin Schwenke 2013-08-02 16:03:42 +10:00 committed by Amitay Isaacs
parent df539a66cb
commit 2afb5632c7
6 changed files with 34 additions and 31 deletions

View File

@ -9,9 +9,8 @@ setup_winbind "down"
export CTDB_SERVICE_AUTOSTARTSTOP="yes"
export CTDB_MANAGED_SERVICES="foo winbind bar"
ok 'Starting service "winbind" - now managed'
ok <<EOF
Starting service "winbind" - now managed
&Starting winbind: OK
EOF
simple_test
# This depends on output in the log file from the above test
ok 'Starting winbind: OK'
check_ctdb_logfile

View File

@ -10,9 +10,8 @@ export CTDB_SERVICE_AUTOSTARTSTOP="yes"
export CTDB_MANAGED_SERVICES="foo"
unset CTDB_MANAGES_WINBIND
ok 'Stopping service "winbind" - no longer managed'
ok <<EOF
Stopping service "winbind" - no longer managed
&Stopping winbind: OK
EOF
simple_test
# This depends on output in the log file from the above test
ok 'Stopping winbind: OK'
check_ctdb_logfile

View File

@ -9,9 +9,8 @@ setup_samba "down"
export CTDB_SERVICE_AUTOSTARTSTOP="yes"
export CTDB_MANAGED_SERVICES="foo samba winbind bar"
ok 'Starting service "samba" - now managed'
ok <<EOF
Starting service "samba" - now managed
&Starting smb: OK
EOF
simple_test
# This depends on output in the log file from the above test
ok 'Starting smb: OK'
check_ctdb_logfile

View File

@ -10,9 +10,8 @@ export CTDB_SERVICE_AUTOSTARTSTOP="yes"
export CTDB_MANAGED_SERVICES="foo"
unset CTDB_MANAGES_SAMBA
ok 'Stopping service "samba" - no longer managed'
ok <<EOF
Stopping service "samba" - no longer managed
&Stopping smb: OK
EOF
simple_test
# This depends on output in the log file from the above test
ok 'Stopping smb: OK'
check_ctdb_logfile

View File

@ -48,5 +48,11 @@ get_proc ()
# Always succeeds
iptables () { : ; }
# Do not actually background - we want to see the output
background_with_logging ()
{
"$@" 2>&1 </dev/null | sed -e 's@^@\&@'
}
CTDB_INIT_STYLE="redhat"
PATH="${EVENTSCRIPTS_PATH}:$PATH"

View File

@ -701,8 +701,12 @@ program $_pn version $_ver is not available"
_opts="${STATD_HOSTNAME:+ -n }${STATD_HOSTNAME}"
;;
esac
case "${_progname}${_action#restart}" in
nfsd*)
case "$_action" in
*:b) _bg="&" ;;
*) _bg="" ;;
esac
case "$_progname" in
nfsd)
_t="\
Trying to restart NFS service"
@ -710,23 +714,20 @@ Trying to restart NFS service"
for _pid in $FAKE_NFSD_THREAD_PIDS ; do
_t="\
$_t
Stack trace for stuck nfsd thread [${_pid}]:
[<ffffffff87654321>] fake_stack_trace_for_pid_${_pid}/stack+0x0/0xff"
${_bg}Stack trace for stuck nfsd thread [${_pid}]:
${_bg}[<ffffffff87654321>] fake_stack_trace_for_pid_${_pid}/stack+0x0/0xff"
done
fi
_t="\
${_t}
Starting nfslock: OK
Starting nfs: OK"
${_bg}Starting nfslock: OK
${_bg}Starting nfs: OK"
;;
nfsd:b)
_t="Trying to restart NFS service"
;;
lockd|lockd:b)
lockd)
_t="\
Trying to restart lock manager service
Starting nfslock: OK"
${_bg}Starting nfslock: OK"
;;
*)
_t="Trying to restart $_progname [${_p}${_opts}]"