summaryrefslogtreecommitdiff
path: root/source3/script/tests/functions
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-08-24 03:09:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:01:13 -0500
commit024a46c8fa93a1f219930a329cf7548390a61c2a (patch)
tree158f296378641159b9911a180cdb143549ec5e33 /source3/script/tests/functions
parentcf08e1ce59c9c2562adeaf07b8be581e74f2eadd (diff)
downloadsamba-024a46c8fa93a1f219930a329cf7548390a61c2a.tar.gz
samba-024a46c8fa93a1f219930a329cf7548390a61c2a.tar.bz2
samba-024a46c8fa93a1f219930a329cf7548390a61c2a.zip
r9562: successfully get the samba 3 smbtorture working (as a test case for infrastructre)
(This used to be commit c64f5666b8d1f9fb617b1cf89d6157a0c3fa9da9)
Diffstat (limited to 'source3/script/tests/functions')
-rw-r--r--source3/script/tests/functions40
1 files changed, 40 insertions, 0 deletions
diff --git a/source3/script/tests/functions b/source3/script/tests/functions
index 4cc8d4a2c0..40e185e153 100644
--- a/source3/script/tests/functions
+++ b/source3/script/tests/functions
@@ -40,3 +40,43 @@ stop_smbd()
fi
}
+
+##
+## start/stop smbd daemon
+##
+check_nmbd_running()
+{
+ ## the smbcontrol ping will return a 0 on success
+ smbcontrol $CONFIGURATION nmbd ping 2>&1 > /dev/null
+}
+
+start_nmbd()
+{
+ echo "Starting nmbd...."
+
+ nmbd $CONFIGURATION || return $?
+
+ sleep 1
+
+ # smbcontrol $CONFIGURATION `cat $PIDDIR/nmbd.pid` ping 2>&1 > /dev/null || return $?
+ kill -0 `cat $PIDDIR/nmbd.pid`
+}
+
+stop_nmbd()
+{
+ nmbd_pid=`cat $PIDDIR/nmbd.pid`
+ echo "Shutting down nmbd (pid $nmbd_pid)..."
+
+ ## belt and braces; first kill and then send a shutdown message
+
+ kill -TERM $nmbd_pid 2> /dev/null
+ sleep 1
+
+ ## check to see if smbd is already running
+ kill -0 $nmbd_pid 2> /dev/null
+ if test $? == 0; then
+ echo "Unable to stop nmbd!"
+ exit 2
+ fi
+}
+