Backport changes from head to shorten the filenames of the test cases.
[ira/wip.git] / testsuite / build_farm / basicsmb.fns
index dac735a10d1a57ae4a4505892b12c8b59dfc7114..4410feff3ae5704660ba63a34b8be25acc5ec60a 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 template/$1 | \
               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() {
@@ -48,9 +52,18 @@ test_smb_conf_setup() {
        exit 1
     esac
 
+#   Please keep these names under 15 characters,
+#   so that the final name is 31 characters or fewer.
+
     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_fl
+
+    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 +72,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
 
@@ -75,7 +94,7 @@ test_smbpasswd() {
        test_smbpasswd_password="$1"
        rm -f $prefix/private/smbpasswd
        echo "( echo $test_smbpasswd_password ; echo $test_smbpasswd_password; ) | $prefix/bin/smbpasswd -L -s -a $whoami"
-       ( echo $password ; echo $password; ) | $prefix/bin/smbpasswd -L -s -a $whoami
+       ( echo $test_smbpasswd_password; echo $test_smbpasswd_password; ) | $prefix/bin/smbpasswd -L -s -a $whoami
        status=$?
        if [ $status = 0 ]; then
            echo "smbpasswd correctly set initial password ($test_smbpasswd_password)"
@@ -87,16 +106,15 @@ test_smbpasswd() {
 }
 
 test_smbpasswd_remote() {
-       test_smbpasswd_password="$1"
-       test_smbpasswd_newpassword="$2"
-       rm -f $prefix/private/smbpasswd
-       echo "( echo $test_smbpasswd_password; echo $test_smbpasswd_newpassword ; echo $test_smbpasswd_newpassword; ) | $prefix/bin/smbpasswd -r localhost -s -U $whoami"
-       ( echo $test_smbpasswd_password; echo $test_smbpasswd_newpassword ; echo $test_smbpasswd_newpassword; ) | $prefix/bin/smbpasswd -r localhost -s -U $whoami
+       test_smbpasswd_rem_password="$1"
+       test_smbpasswd_rem_newpassword="$2"
+       echo "( echo $test_smbpasswd_rem_password; echo $test_smbpasswd_rem_newpassword; echo $test_smbpasswd_rem_newpassword; ) | $prefix/bin/smbpasswd -r localhost -s -U $whoami"
+       ( echo $test_smbpasswd_rem_password; echo $test_smbpasswd_rem_newpassword; echo $test_smbpasswd_rem_newpassword; ) | $prefix/bin/smbpasswd -r localhost -s -U $whoami
        status=$?
        if [ $status = 0 ]; then
-           echo "smbpasswd correctly remotely changed password ($test_smbpasswd_password -> $test_smbpasswd_newpassword)"
+           echo "smbpasswd correctly remotely changed password ($test_smbpasswd_rem_password -> $test_smbpasswd_rem_newpassword)"
        else
-           echo "smbpasswd failed to remotely changed password ($test_smbpasswd_password -> $test_smbpasswd_newpassword)! (status $status)"
+           echo "smbpasswd failed to remotely changed password ($test_smbpasswd_rem_password -> $test_smbpasswd_rem_newpassword)! (status $status)"
            return 1
        fi
        return 0
@@ -104,7 +122,6 @@ test_smbpasswd_remote() {
 
 test_smbpasswd_local() {
        test_smbpasswd_newpassword="$2"
-       rm -f $prefix/private/smbpasswd
        echo "( echo $test_smbpasswd_newpassword ; echo $test_smbpasswd_newpassword; ) | $prefix/bin/smbpasswd -L -s $whoami"
        ( echo $test_smbpasswd_newpassword ; echo $test_smbpasswd_newpassword; ) | $prefix/bin/smbpasswd -L -s $whoami
        status=$?
@@ -119,7 +136,7 @@ test_smbpasswd_local() {
 
 test_listfilesauth() {
        remote_name="$1"
-       echo $prefix/bin/smbclient//$remote_name/samba  -n buildclient -U$whoami%$password -c 'ls'
+       echo $prefix/bin/smbclient //$remote_name/samba  -n buildclient -U$whoami%$password -c 'ls'
        $prefix/bin/smbclient //$remote_name/samba  -n buildclient -U$whoami%$password -c 'ls'
        status=$?
        if [ $status = 0 ]; then