From 847102c6ca17f7b7d665863b8caa1d85baef46ad Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 7 Mar 2007 04:20:10 +0000 Subject: r21736: Fix the smbclient test to do something more interesting with the last few authentication tests. Now that the tests correctly 'fail', I was able to fix the credentials subsystem to honour USER and PASSWD. To get --machine-pass working, I needed ldb to always load it's static modules, so I put this in ldb_connect(). Andrew Bartlett (This used to be commit 3430d8c072407a1c33c32229095fc9db2142b6fa) --- testprogs/blackbox/test_smbclient.sh | 47 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 15 deletions(-) (limited to 'testprogs') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index 211f0f3c48..e8f90060de 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -59,13 +59,10 @@ echo rm tmpfile | runcmd "Removing file" || failed=`expr $failed + 1` # compare locally testit "Comparing files" diff tmpfile-old tmpfile || failed=`expr $failed + 1` # create directory -echo mkdir bla | runcmd "Creating directory" || failed=`expr $failed + 1` # cd to directory -echo cd bla | runcmd "Changing directory" || failed=`expr $failed + 1` # cd to top level directory -echo cd .. | runcmd "Going back" || failed=`expr $failed + 1` # remove directory -echo rmdir bla | runcmd "Removing directory" || failed=`expr $failed + 1` +echo "mkdir bla; cd bla; cd ..; rmdir bla" | runcmd "Creating directory, Changing directory, Going back, " || failed=`expr $failed + 1` # enable recurse, create nested directory echo "recurse; echo mkdir bla/bloe; exit" | runcmd "Creating nested directory" || failed=`expr $failed + 1` # remove parent directory @@ -97,17 +94,37 @@ echo rm tmpfilex | runcmd "Removing file" || failed=`expr $failed + 1` echo ls | runcmd "List directory with LANMAN1" -m LANMAN1 || failed=`expr $failed + 1` echo ls | runcmd "List directory with LANMAN2" -m LANMAN2 || failed=`expr $failed + 1` -echo ls | testit "Test login with --machine-pass" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass - -echo "password=$PASSWORD\nusername=$USERNAME\ndomain=$DOMAIN" > tmpauthfile - -echo ls | testit "Test login with --authentication-file" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --authentication-file=tmpauthfile - -echo "$PASSWORD" > tmppassfile - -echo ls | PASSWD_FILE="tmppassfile" testit "Test login with PASSWD_FILE" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" - +echo ls | testit "Test login with --machine-pass" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass || failed=`expr $failed + 1` + +( + echo "password=$PASSWORD" + echo "username=$USERNAME" + echo "domain=$DOMAIN" +) > tmpauthfile + +echo ls | testit "Test login with --authentication-file" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --authentication-file=tmpauthfile || failed=`expr $failed + 1` + +PASSWD_FILE="tmppassfile" +echo "$PASSWORD" > $PASSWD_FILE +export PASSWD_FILE +echo ls | testit "Test login with PASSWD_FILE" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` +PASSWD_FILE="" +export PASSWD_FILE +unset PASSWD_FILE + +PASSWD="$PASSWORD" +export PASSWD +echo ls | testit "Test login with PASSWD" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` + +oldUSER=$USER +USER="$USERNAME" +export USER +echo ls | testit "Test login with USER and PASSWD" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" | failed=`expr $failed + 1` +PASSWD= +export PASSWD +unset PASSWD +USER=$oldUSER +export USER rm -f tmpfile tmpfile-old tmpfilex tmpauthfile tmppassfile - exit $failed -- cgit