diff options
-rwxr-xr-x | source4/selftest/samba4_tests.sh | 1 | ||||
-rw-r--r-- | testprogs/blackbox/ndrdump/samr-CreateUser-in.dat | bin | 0 -> 60 bytes | |||
-rw-r--r-- | testprogs/blackbox/ndrdump/samr-CreateUser-out.dat | bin | 0 -> 32 bytes | |||
-rwxr-xr-x | testprogs/blackbox/test_kinit.sh | 8 | ||||
-rw-r--r-- | testprogs/blackbox/test_ndrdump.sh | 33 | ||||
-rwxr-xr-x | testprogs/blackbox/test_smbclient.sh | 28 |
6 files changed, 68 insertions, 2 deletions
diff --git a/source4/selftest/samba4_tests.sh b/source4/selftest/samba4_tests.sh index d52c240b93..ed5e46cf03 100755 --- a/source4/selftest/samba4_tests.sh +++ b/source4/selftest/samba4_tests.sh @@ -265,6 +265,7 @@ fi bbdir=$incdir/../../testprogs/blackbox +plantest "blackbox.ndrdump" dc $bbdir/test_ndrdump.sh plantest "blackbox.smbclient" dc $bbdir/test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" plantest "blackbox.kinit" dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" $CONFIGURATION plantest "blackbox.cifsdd" dc $bbdir/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" diff --git a/testprogs/blackbox/ndrdump/samr-CreateUser-in.dat b/testprogs/blackbox/ndrdump/samr-CreateUser-in.dat Binary files differnew file mode 100644 index 0000000000..a5840e1f7f --- /dev/null +++ b/testprogs/blackbox/ndrdump/samr-CreateUser-in.dat diff --git a/testprogs/blackbox/ndrdump/samr-CreateUser-out.dat b/testprogs/blackbox/ndrdump/samr-CreateUser-out.dat Binary files differnew file mode 100644 index 0000000000..cf9131dba9 --- /dev/null +++ b/testprogs/blackbox/ndrdump/samr-CreateUser-out.dat diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index dbcdcf1112..29582055ee 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -86,6 +86,14 @@ testit "kinit with user password" $samba4bindir/samba4kinit --password-file=./tm test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` +NEWUSERPASS=testPaSS@34% +testit "change user password" $VALGRIND $net password change -W$DOMAIN -U$DOMAIN\\nettestuser%$USERPASS $CONFIGURATION -k no $NEWUSERPASS $@ || failed=`expr $failed + 1` + +echo $NEWUSERPASS > ./tmpuserpassfile +testit "kinit with user password" $samba4bindir/samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1` + +test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` + KRB5CCNAME="$PREFIX/tmpccache" export KRB5CCNAME diff --git a/testprogs/blackbox/test_ndrdump.sh b/testprogs/blackbox/test_ndrdump.sh new file mode 100644 index 0000000000..38c33ad3c1 --- /dev/null +++ b/testprogs/blackbox/test_ndrdump.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# Blackbox tests for masktest +# Copyright (C) 2008 Andrew Tridgell +# Copyright (C) 2008 Andrew Bartlett +# based on test_smbclient.sh + +failed=0 + +samba4bindir=`dirname $0`/../../source/bin +ndrdump=$samba4bindir/ndrdump +files=`dirname $0`/ndrdump + +testit() { + name="$1" + shift + cmdline="$*" + echo "test: $name" + $cmdline + status=$? + if [ x$status = x0 ]; then + echo "success: $name" + else + echo "failure: $name" + fi + return $status +} + +testit "ndrdump with in" $VALGRIND $ndrdump samr samr_CreateUser in $files/samr-CreateUser-in.dat $@ || failed=`expr $failed + 1` +testit "ndrdump with out" $VALGRIND $ndrdump samr samr_CreateUser out $files/samr-CreateUser-out.dat $@ || failed=`expr $failed + 1` +testit "ndrdump with --context-file" $VALGRIND $ndrdump --context-file $files/samr-CreateUser-in.dat samr samr_CreateUser out $files/samr-CreateUser-out.dat $@ || failed=`expr $failed + 1` +testit "ndrdump with validate" $VALGRIND $ndrdump --validate samr samr_CreateUser in $files/samr-CreateUser-in.dat $@ || failed=`expr $failed + 1` + +exit $failed diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index a803d83363..4df64cac94 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -86,11 +86,29 @@ testit "Comparing files" diff tmpfile-old tmpfile || failed=`expr $failed + 1` runcmd "Creating directory, Changing directory, Going back" 'mkdir bla; cd bla; cd ..; rmdir bla' || failed=`expr $failed + 1` # enable recurse, create nested directory runcmd "Creating nested directory" 'mkdir bla/bloe' || failed=`expr $failed + 1` -# remove parent directory -runcmd "Removing directory" 'rmdir bla/bloe' || failed=`expr $failed + 1` # remove child directory +runcmd "Removing directory" 'rmdir bla/bloe' || failed=`expr $failed + 1` +# remove parent directory runcmd "Removing directory" 'rmdir bla'|| failed=`expr $failed + 1` +# enable recurse, create nested directory +runcmd "Creating nested directory" 'mkdir bla' || failed=`expr $failed + 1` +# rename bla to bla2 +runcmd "rename of nested directory" 'rename bla bla2' || failed=`expr $failed + 1` +# deltree +runcmd "deltree of nested directory" 'deltree bla2' || failed=`expr $failed + 1` # run fsinfo +runcmd "Getting file system info" 'fsinfo allocation'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo volume'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo volumeinfo'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo sizeinfo'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo deviceinfo'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo attributeinfo'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo volume-information'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo size-information'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo device-information'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo attribute-information'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo quota-information'|| failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo fullsize-information'|| failed=`expr $failed + 1` runcmd "Getting file system info" 'fsinfo objectid'|| failed=`expr $failed + 1` # put that file @@ -98,6 +116,7 @@ runcmd "Putting file" 'put tmpfile'|| failed=`expr $failed + 1` # get that file mv tmpfile tmpfile-old runcmd "Getting file" 'get tmpfile'|| failed=`expr $failed + 1` +runcmd "Getting file EA info" 'eainfo tmpfile'|| failed=`expr $failed + 1` # remove that file runcmd "Removing file" 'rm tmpfile' || failed=`expr $failed + 1` # compare locally @@ -111,6 +130,11 @@ testit "Comparing files" diff tmpfilex tmpfile || failed=`expr $failed + 1` # remove that file runcmd "Removing file" 'rm tmpfilex'|| failed=`expr $failed + 1` +runcmd "Lookup name" "lookup $DOMAIN\\$USERNAME" || failed=`expr $failed + 1` + +#Fails unless there are privilages +#runcmd "Lookup privs of name" "privileges $DOMAIN\\$USERNAME" || failed=`expr $failed + 1` + # do some simple operations using old protocol versions runcmd "List directory with LANMAN1" 'ls' -m LANMAN1 || failed=`expr $failed + 1` runcmd "List directory with LANMAN2" 'ls' -m LANMAN2 || failed=`expr $failed + 1` |