Updates to the build farm tests:
authorAndrew Bartlett <abartlet@samba.org>
Fri, 15 Nov 2002 13:53:02 +0000 (13:53 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 15 Nov 2002 13:53:02 +0000 (13:53 +0000)
- Get valid/invalid users working
- Test preexec, preexec close

Andrew Bartlett
(This used to be commit 36441899e61a711b8fe03ec7b6f95973b1e69fc5)

testsuite/build_farm/basicsmb-invalidusers.test
testsuite/build_farm/basicsmb-preexec.test [new file with mode: 0644]
testsuite/build_farm/basicsmb.fns
testsuite/build_farm/basicsmb.smb.conf.preexec.template [new file with mode: 0644]
testsuite/build_farm/basicsmb.smb.conf.preexec_cl_fail.template [new file with mode: 0644]
testsuite/build_farm/basicsmb.smb.conf.preexec_close.template [new file with mode: 0644]
testsuite/build_farm/basicsmb.smb.conf.validusers.template [new file with mode: 0644]
testsuite/build_farm/preexec.template [new file with mode: 0644]
testsuite/build_farm/runlist

index 54c9c75..7d67cc2 100644 (file)
@@ -6,3 +6,5 @@ security="invalidusers"
 
 (test_listfilesauth_should_deny $security) || exit 1
 
+security="validusers"
+(test_listfilesauth $security) || exit 1
diff --git a/testsuite/build_farm/basicsmb-preexec.test b/testsuite/build_farm/basicsmb-preexec.test
new file mode 100644 (file)
index 0000000..bc87723
--- /dev/null
@@ -0,0 +1,28 @@
+. basicsmb.fns
+
+password=samba
+(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
+
+rm -f $prefix/testdir/preexec_touch
+
+mode=PREEXEC
+(test_listfilesauth $mode) || exit 1
+
+if [ -f $prefix/testdir/preexec_touch ]; then
+       rm -f $prefix/testdir/preexec_touch
+else
+       exit 1;
+fi
+
+mode=PREEXEC_close
+(test_listfilesauth $mode) || exit 1
+
+if [ -f $prefix/testdir/preexec_touch ]; then
+       rm -f $prefix/testdir/preexec_touch
+else
+       exit 1;
+fi
+
+mode=PREEXEC_cl_fail
+(test_listfilesauth_should_deny $mode) || exit 1
+
index 5a41b8b..bb17770 100644 (file)
 # directory when testing.  Some of them take a -c parameter, but tpot
 # says it's not done consistently.
 
-template_smb_conf_setup() {
-       cat basicsmb.smb.conf$1.template | \
+template_setup() {
+       cat $1.template | \
               sed "s|PREFIX|$prefix|g" | \
              sed "s|BUILD_FARM|$test_root|g" | \
              sed "s|WHOAMI|$whoami|g" | \
              sed "s|LOGLEVEL|$loglevel|g" \
-        > $prefix/lib/smb.conf$1
-       echo "template_smb_conf_setup: Created $prefix/lib/smb.conf$1"
+        > $prefix/$2
+       echo "template_setup: Created $prefix/$2"
+}
+
+template_smb_conf_setup() {
+    template_setup "basicsmb.smb.conf$1" "lib/smb.conf$1"
 }
 
 test_smb_conf_setup() {
@@ -50,7 +54,13 @@ test_smb_conf_setup() {
 
     template_smb_conf_setup 
     template_smb_conf_setup .hostsequiv
+    template_smb_conf_setup .validusers
     template_smb_conf_setup .invalidusers
+    template_smb_conf_setup .preexec
+    template_smb_conf_setup .preexec_close
+    template_smb_conf_setup .preexec_cl_fail
+
+    template_setup preexec lib/preexec
 
        echo "127.0.0.1    localhost">$prefix/lib/lmhosts
        echo "127.0.0.2    BUILDFARM">>$prefix/lib/lmhosts
@@ -59,6 +69,12 @@ test_smb_conf_setup() {
     echo "127.0.0.5    SERVER">>$prefix/lib/lmhosts
     echo "127.0.0.6    DOMAIN">>$prefix/lib/lmhosts
     echo "127.0.0.7    HOSTSEQUIV">>$prefix/lib/lmhosts
+    echo "127.0.0.7    VALIDUSERS">>$prefix/lib/lmhosts
+    echo "127.0.0.7    INVALIDUSERS">>$prefix/lib/lmhosts
+    echo "127.0.0.7    PREEXEC">>$prefix/lib/lmhosts
+    echo "127.0.0.7    PREEXEC_CLOSE">>$prefix/lib/lmhosts
+    echo "127.0.0.7    PREEXEC_CL_FAIL">>$prefix/lib/lmhosts
+
 
        echo "127.0.0.1" > $prefix/lib/hosts.equiv
 
diff --git a/testsuite/build_farm/basicsmb.smb.conf.preexec.template b/testsuite/build_farm/basicsmb.smb.conf.preexec.template
new file mode 100644 (file)
index 0000000..cc34872
--- /dev/null
@@ -0,0 +1 @@
+preexec = /bin/sh PREFIX/lib/preexec
diff --git a/testsuite/build_farm/basicsmb.smb.conf.preexec_cl_fail.template b/testsuite/build_farm/basicsmb.smb.conf.preexec_cl_fail.template
new file mode 100644 (file)
index 0000000..5578e71
--- /dev/null
@@ -0,0 +1,2 @@
+preexec close = yes
+preexec = /bin/sh PREFIX/lib/preexec_does_not_exist
\ No newline at end of file
diff --git a/testsuite/build_farm/basicsmb.smb.conf.preexec_close.template b/testsuite/build_farm/basicsmb.smb.conf.preexec_close.template
new file mode 100644 (file)
index 0000000..3aac699
--- /dev/null
@@ -0,0 +1,2 @@
+preexec close = yes
+preexec = /bin/sh PREFIX/lib/preexec
diff --git a/testsuite/build_farm/basicsmb.smb.conf.validusers.template b/testsuite/build_farm/basicsmb.smb.conf.validusers.template
new file mode 100644 (file)
index 0000000..d4a85e0
--- /dev/null
@@ -0,0 +1 @@
+      valid users = WHOAMI
diff --git a/testsuite/build_farm/preexec.template b/testsuite/build_farm/preexec.template
new file mode 100644 (file)
index 0000000..e417d6a
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+echo "Test worked" > PREFIX/testdir/preexec_touch
index a7d4808..bdf92f8 100644 (file)
@@ -3,6 +3,7 @@ basicsmb-sharesec basicsmb-usersec \
 basicsmb-serversec basicsmb-domainsec basicsmb-domainsec-nt4 \
 basicsmb-shareguest basicsmb-hostsequiv basicsmb-invalidusers \
 basicsmb-hostsdeny basicsmb-remote-pass-change \
+basicsmb-preexec \
 torture-FDPASS torture-LOCK1 torture-LOCK2 \
 torture-LOCK3 torture-LOCK4 torture-LOCK5 \
 torture-UNLINK torture-BROWSE torture-ATTR \