From dc346a5c6d6b071a67397150f72a530515b5cf53 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 27 Jun 2001 13:58:58 +0000 Subject: 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) --- testsuite/build_farm/basicsmb.fns | 50 ++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 6 deletions(-) (limited to 'testsuite/build_farm/basicsmb.fns') 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 +} + -- cgit