Jigger around with the tests a bit more
authorAndrew Bartlett <abartlet@samba.org>
Wed, 27 Jun 2001 13:58:58 +0000 (13:58 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 27 Jun 2001 13:58:58 +0000 (13:58 +0000)
We now test security=share, security=user, security=server for both the
positive and negitive case (good/bad pw) and check that guest shares work for
share level security.

The server level security stuff seems to test positive without actualy
contating a server (another LIBSMB_PROG based smbd) - I will need to look into that...

Andrew Bartlett
(This used to be commit 19fdc553d6ab06e53c21425468f86da56f4d9153)

14 files changed:
testsuite/build_farm/basicsmb-domainsec.test [new file with mode: 0644]
testsuite/build_farm/basicsmb-listfilesauth.test [deleted file]
testsuite/build_farm/basicsmb-listfilesnpw.test [deleted file]
testsuite/build_farm/basicsmb-serversec.test [new file with mode: 0644]
testsuite/build_farm/basicsmb-shareguest.test [new file with mode: 0644]
testsuite/build_farm/basicsmb-sharesec.test [new file with mode: 0644]
testsuite/build_farm/basicsmb-usersec.test [new file with mode: 0644]
testsuite/build_farm/basicsmb.fns
testsuite/build_farm/basicsmb.smb.conf.domain [new file with mode: 0644]
testsuite/build_farm/basicsmb.smb.conf.server [new file with mode: 0644]
testsuite/build_farm/basicsmb.smb.conf.share [new file with mode: 0644]
testsuite/build_farm/basicsmb.smb.conf.template
testsuite/build_farm/basicsmb.smb.conf.user [new file with mode: 0644]
testsuite/build_farm/runlist

diff --git a/testsuite/build_farm/basicsmb-domainsec.test b/testsuite/build_farm/basicsmb-domainsec.test
new file mode 100644 (file)
index 0000000..0674e75
--- /dev/null
@@ -0,0 +1,9 @@
+. basicsmb.fns
+
+password=samba
+security=DOMAIN
+(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
+
+test_listfilesauth $security  || exit 1
+test_listfilesnpw $security  || exit 1
+
diff --git a/testsuite/build_farm/basicsmb-listfilesauth.test b/testsuite/build_farm/basicsmb-listfilesauth.test
deleted file mode 100644 (file)
index 4ec72fd..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-. basicsmb.fns
-
-test_listfilesauth() {
-       echo $prefix/bin/smbclient //localhost/samba -U$whoami%$password -c 'ls'
-       $prefix/bin/smbclient //localhost/samba -U$whoami%$password -c 'ls'
-       status=$?
-       if [ $status = 0 ]; then
-               echo "listed files OK"
-       else 
-               echo "listing files with smbd failed with status $status"
-               return 1
-       fi
-       return 0
-}
-
-password=samba
-
-(test_smb_conf_setup && test_smbpasswd) || exit 1
-
-test_listfilesauth || exit 1
-
-
diff --git a/testsuite/build_farm/basicsmb-listfilesnpw.test b/testsuite/build_farm/basicsmb-listfilesnpw.test
deleted file mode 100644 (file)
index a470b29..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-. basicsmb.fns
-
-test_listfilesnpw() {
-       echo $prefix/bin/smbclient //localhost/samba -U$whoami% -c 'ls'
-       $prefix/bin/smbclient //localhost/samba -U$whoami% -c 'ls'
-       status=$?
-       if [ $status = 0 ]; then
-               echo "smbd listed files in user level security with NO PASSWORD!"
-               return 1
-       else 
-               echo "listing files with smbd failed with status $status (correct)"
-       fi
-       return 0
-}
-
-password=samba
-
-(test_smb_conf_setup && test_smbpasswd) || exit 1
-
-test_listfilesnpw || exit 1
-
-
diff --git a/testsuite/build_farm/basicsmb-serversec.test b/testsuite/build_farm/basicsmb-serversec.test
new file mode 100644 (file)
index 0000000..b45899a
--- /dev/null
@@ -0,0 +1,9 @@
+. basicsmb.fns
+
+password=samba
+security=SERVER
+(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
+
+test_listfilesauth $security  || exit 1
+test_listfilesnpw $security  || exit 1
+
diff --git a/testsuite/build_farm/basicsmb-shareguest.test b/testsuite/build_farm/basicsmb-shareguest.test
new file mode 100644 (file)
index 0000000..7b0175a
--- /dev/null
@@ -0,0 +1,21 @@
+. basicsmb.fns
+
+test_listfilesguestshare() {
+       remote_name=$1
+       echo $prefix/bin/smbclient //$remote_name/guest_share -n buildclient -U$whoami% -c 'ls'
+       $prefix/bin/smbclient //$remote_name/guest_share -n buildclient -U$whoami% -c 'ls'
+       status=$?
+       if [ $status = 0 ]; then
+               echo "smbd listed files correctly (guest share)"
+       else 
+               echo "listing files on a guest share failed with status $status"
+               return 1
+       fi
+       return 0
+}
+
+password=samba
+security=SHARE
+( test_smb_conf_setup && ( test_smbpasswd $password ) ) || exit 1
+
+( test_listfilesguestshare $security ) || exit 1
\ No newline at end of file
diff --git a/testsuite/build_farm/basicsmb-sharesec.test b/testsuite/build_farm/basicsmb-sharesec.test
new file mode 100644 (file)
index 0000000..edef6a9
--- /dev/null
@@ -0,0 +1,9 @@
+. basicsmb.fns
+
+password="samba"
+security="SHARE"
+(test_smb_conf_setup && ( test_smbpasswd $password ) ) || exit 1
+
+(test_listfilesauth $security) || exit 1
+(test_listfilesnpw $security) || exit 1
+
diff --git a/testsuite/build_farm/basicsmb-usersec.test b/testsuite/build_farm/basicsmb-usersec.test
new file mode 100644 (file)
index 0000000..06f2a1c
--- /dev/null
@@ -0,0 +1,9 @@
+. basicsmb.fns
+
+password=samba
+security=USER
+(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
+
+test_listfilesauth $security  || exit 1
+test_listfilesnpw $security  || exit 1
+
index 0708e2f89a22faeab69bc974cd8178110ba6e940..d10aab5b1e787c1f4f99d946cc8e184fdf922428 100644 (file)
@@ -1,21 +1,59 @@
 test_smb_conf_setup() {
        cat basicsmb.smb.conf.template | sed "s|PREFIX|$prefix|g" | sed "s|BUILD_FARM|$pwd|g" > $prefix/lib/smb.conf
-       echo "Setting up smb.conf:"
-       cat $prefix/lib/smb.conf
 
        echo "127.0.0.1    localhost">$prefix/lib/lmhosts
-
+    echo "127.0.0.1    SHARE">>$prefix/lib/lmhosts
+    echo "127.0.0.1    USER">>$prefix/lib/lmhosts
+    echo "127.0.0.1    SERVER">>$prefix/lib/lmhosts
+    echo "127.0.0.1    DOMAIN">>$prefix/lib/lmhosts
+    cp -f basicsmb.smb.conf.share $prefix/lib/smb.conf.share
+    cp -f basicsmb.smb.conf.user $prefix/lib/smb.conf.user
+    cp -f basicsmb.smb.conf.server $prefix/lib/smb.conf.server
+    cp -f basicsmb.smb.conf.domain $prefix/lib/smb.conf.domain
+    touch $prefix/lib/smb.conf.
+    touch $prefix/lib/smb.conf.localhost
 }
 
 test_smbpasswd() {
-       echo "( echo $password ; echo $password; ) | $prefix/bin/smbpasswd -L -s -a $whoami"
+       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
        status=$?
        if [ $status = 0 ]; then
-           echo "smbpasswd correctly set inital password ($password)"
+           echo "smbpasswd correctly set inital password ($test_smbpasswd_password)"
        else
-           echo "smbpasswd failed to set inital password ($password)! (status $status)"
+           echo "smbpasswd failed to set inital password ($test_smbpasswd_password)! (status $status)"
            return 1
        fi
        return 0
 }
+
+test_listfilesauth() {
+       remote_name="$1"
+       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
+               echo "listed files OK"
+       else 
+               echo "listing files with smbd failed with status $status"
+               return 1
+       fi
+       return 0
+}
+
+test_listfilesnpw() {
+       remote_name="$1"
+       echo $prefix/bin/smbclient //$remote_name/samba -n buildclient -U$whoami%  -c 'ls'
+       $prefix/bin/smbclient //$remote_name/samba -n buildclient -U$whoami% -c 'ls'
+       status=$?
+       if [ $status = 0 ]; then
+               echo "smbd listed files with NO PASSWORD on an authenticated share!"
+               return 1
+       else 
+               echo "listing files with smbd failed with status $status (correct)"
+       fi
+       return 0
+}
+
diff --git a/testsuite/build_farm/basicsmb.smb.conf.domain b/testsuite/build_farm/basicsmb.smb.conf.domain
new file mode 100644 (file)
index 0000000..ddb5153
--- /dev/null
@@ -0,0 +1,2 @@
+security=domain
+password server=127.0.0.1
diff --git a/testsuite/build_farm/basicsmb.smb.conf.server b/testsuite/build_farm/basicsmb.smb.conf.server
new file mode 100644 (file)
index 0000000..5db63b0
--- /dev/null
@@ -0,0 +1,2 @@
+security=server
+password server=localhost
diff --git a/testsuite/build_farm/basicsmb.smb.conf.share b/testsuite/build_farm/basicsmb.smb.conf.share
new file mode 100644 (file)
index 0000000..8e69cc1
--- /dev/null
@@ -0,0 +1 @@
+       security = share
index 627b019f3a088af24649564e0afd47b36538aa83..095752f14f1d5e55e020ad88828783f81d30a3eb 100644 (file)
@@ -1,10 +1,16 @@
 [global]
+    netbios name = BUILDFARM
     workgroup = TESTWG
     log level = 3
+    debug timestamp = no
     encrypt passwords = yes
     server string = Samba %v Build Farm Tests
     name resolve order = lmhosts
 
+    domain logons = yes
+
+    include = PREFIX/lib/smb.conf.%L
+
 [test]
     path = PREFIX/testdir
     read only = no
@@ -23,3 +29,9 @@
     path = BUILD_FARM/rsync
     read only = yes
     comment = Rsync Sources
+
+[guest_share]
+    path = PREFIX
+    guest ok = yes
+    read only = yes
+    comment = Unauthenticated share for use in share level test
\ No newline at end of file
diff --git a/testsuite/build_farm/basicsmb.smb.conf.user b/testsuite/build_farm/basicsmb.smb.conf.user
new file mode 100644 (file)
index 0000000..412d79a
--- /dev/null
@@ -0,0 +1 @@
+       security = user
\ No newline at end of file
index 6a247e7565fea62b25e72188cf2afa0c52763ce2..f269fac7f220b292e5c1921ea7898b1263859685 100644 (file)
@@ -1 +1 @@
-TEST_ALL="basicsmb-sharelist basicsmb-listfilesauth basicsmb-listfilesnpw"
+TEST_ALL="basicsmb-sharelist basicsmb-sharesec basicsmb-usersec basicsmb-serversec basicsmb-shareguest"