--- /dev/null
+. 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
+
+++ /dev/null
-. 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
-
-
+++ /dev/null
-. 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
-
-
--- /dev/null
+. 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
+
--- /dev/null
+. 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
--- /dev/null
+. 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
+
--- /dev/null
+. 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
+
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
+}
+
--- /dev/null
+security=domain
+password server=127.0.0.1
--- /dev/null
+security=server
+password server=localhost
--- /dev/null
+ security = share
[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
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
--- /dev/null
+ security = user
\ No newline at end of file
-TEST_ALL="basicsmb-sharelist basicsmb-listfilesauth basicsmb-listfilesnpw"
+TEST_ALL="basicsmb-sharelist basicsmb-sharesec basicsmb-usersec basicsmb-serversec basicsmb-shareguest"