summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-06-27 13:58:58 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-06-27 13:58:58 +0000
commitdc346a5c6d6b071a67397150f72a530515b5cf53 (patch)
tree615e95f56f36bdbf2c5ef2ce523b2fad6cbfdf73 /testsuite
parent5ac133bac731e3f014df35126dd5ecb87837b8a6 (diff)
downloadsamba-dc346a5c6d6b071a67397150f72a530515b5cf53.tar.gz
samba-dc346a5c6d6b071a67397150f72a530515b5cf53.tar.bz2
samba-dc346a5c6d6b071a67397150f72a530515b5cf53.zip
Jigger around with the tests a bit more
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)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/build_farm/basicsmb-domainsec.test9
-rw-r--r--testsuite/build_farm/basicsmb-listfilesauth.test22
-rw-r--r--testsuite/build_farm/basicsmb-listfilesnpw.test22
-rw-r--r--testsuite/build_farm/basicsmb-serversec.test9
-rw-r--r--testsuite/build_farm/basicsmb-shareguest.test21
-rw-r--r--testsuite/build_farm/basicsmb-sharesec.test9
-rw-r--r--testsuite/build_farm/basicsmb-usersec.test9
-rw-r--r--testsuite/build_farm/basicsmb.fns50
-rw-r--r--testsuite/build_farm/basicsmb.smb.conf.domain2
-rw-r--r--testsuite/build_farm/basicsmb.smb.conf.server2
-rw-r--r--testsuite/build_farm/basicsmb.smb.conf.share1
-rw-r--r--testsuite/build_farm/basicsmb.smb.conf.template12
-rw-r--r--testsuite/build_farm/basicsmb.smb.conf.user1
-rw-r--r--testsuite/build_farm/runlist2
14 files changed, 120 insertions, 51 deletions
diff --git a/testsuite/build_farm/basicsmb-domainsec.test b/testsuite/build_farm/basicsmb-domainsec.test
new file mode 100644
index 0000000000..0674e75bb8
--- /dev/null
+++ b/testsuite/build_farm/basicsmb-domainsec.test
@@ -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
index 4ec72fd2b9..0000000000
--- a/testsuite/build_farm/basicsmb-listfilesauth.test
+++ /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
index a470b29b2e..0000000000
--- a/testsuite/build_farm/basicsmb-listfilesnpw.test
+++ /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
index 0000000000..b45899ab77
--- /dev/null
+++ b/testsuite/build_farm/basicsmb-serversec.test
@@ -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
index 0000000000..7b0175a663
--- /dev/null
+++ b/testsuite/build_farm/basicsmb-shareguest.test
@@ -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
index 0000000000..edef6a9123
--- /dev/null
+++ b/testsuite/build_farm/basicsmb-sharesec.test
@@ -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
index 0000000000..06f2a1c404
--- /dev/null
+++ b/testsuite/build_farm/basicsmb-usersec.test
@@ -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
+
diff --git a/testsuite/build_farm/basicsmb.fns b/testsuite/build_farm/basicsmb.fns
index 0708e2f89a..d10aab5b1e 100644
--- a/testsuite/build_farm/basicsmb.fns
+++ b/testsuite/build_farm/basicsmb.fns
@@ -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
index 0000000000..ddb515362c
--- /dev/null
+++ b/testsuite/build_farm/basicsmb.smb.conf.domain
@@ -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
index 0000000000..5db63b0473
--- /dev/null
+++ b/testsuite/build_farm/basicsmb.smb.conf.server
@@ -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
index 0000000000..8e69cc199a
--- /dev/null
+++ b/testsuite/build_farm/basicsmb.smb.conf.share
@@ -0,0 +1 @@
+ security = share
diff --git a/testsuite/build_farm/basicsmb.smb.conf.template b/testsuite/build_farm/basicsmb.smb.conf.template
index 627b019f3a..095752f14f 100644
--- a/testsuite/build_farm/basicsmb.smb.conf.template
+++ b/testsuite/build_farm/basicsmb.smb.conf.template
@@ -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
index 0000000000..412d79ad02
--- /dev/null
+++ b/testsuite/build_farm/basicsmb.smb.conf.user
@@ -0,0 +1 @@
+ security = user \ No newline at end of file
diff --git a/testsuite/build_farm/runlist b/testsuite/build_farm/runlist
index 6a247e7565..f269fac7f2 100644
--- a/testsuite/build_farm/runlist
+++ b/testsuite/build_farm/runlist
@@ -1 +1 @@
-TEST_ALL="basicsmb-sharelist basicsmb-listfilesauth basicsmb-listfilesnpw"
+TEST_ALL="basicsmb-sharelist basicsmb-sharesec basicsmb-usersec basicsmb-serversec basicsmb-shareguest"