From d9665a737b978d0fcca1fd23ab04858e2fa81284 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 14 Jan 2007 01:33:16 +0000 Subject: r20746: Don't report each individual test in test_smbclient as a single testsuite. Create separate directory for blackbox tests. (This used to be commit 7e6357f21350d264ebedabd34f2b8f42fc0427ff) --- testprogs/blackbox/test_smbclient.sh | 102 +++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 testprogs/blackbox/test_smbclient.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh new file mode 100755 index 0000000000..1d28fa2f71 --- /dev/null +++ b/testprogs/blackbox/test_smbclient.sh @@ -0,0 +1,102 @@ +#!/bin/sh + +if [ $# -lt 5 ]; then +cat <tmpfile< Date: Sun, 14 Jan 2007 01:39:34 +0000 Subject: r20747: Move cifsdd to blackbox section (This used to be commit 96ac1c62eef29e8c8c1df9719b6785134efe525c) --- testprogs/blackbox/test_cifsdd.sh | 90 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100755 testprogs/blackbox/test_cifsdd.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_cifsdd.sh b/testprogs/blackbox/test_cifsdd.sh new file mode 100755 index 0000000000..d216695821 --- /dev/null +++ b/testprogs/blackbox/test_cifsdd.sh @@ -0,0 +1,90 @@ +#!/bin/sh + +# Basic script to make sure that cifsdd can do both local and remote I/O. + +if [ $# -lt 4 ]; then +cat < /dev/null + +ls -l $sourcepath + +for bs in 512 4k 48k ; do + +echo "Testing $bs block size ..." + +# Check whether we can do local IO +runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs +compare "Checking local differences" $sourcepath $destpath + +# Check whether we can do a round trip +runcopy "Testing local -> remote copy" \ + if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs +runcopy "Testing remote -> local copy" \ + if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs +compare "Checking differences" $sourcepath $destpath + +# Check that copying within the remote server works +runcopy "Testing local -> remote copy" \ + if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs +runcopy "Testing remote -> remote copy" \ + if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs +runcopy "Testing remote -> local copy" \ + if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs +compare "Checking differences" $sourcepath $destpath + +done + +rm -f $sourcepath $destpath + +exit $failed -- cgit From 109d97a38ffdc534f55d5f9ab8484566c918d580 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 22 Jan 2007 23:09:07 +0000 Subject: r20958: Inspired by the lcov output, check the PASSWD_FILE and --authentication-file options to smbclient. Andrew Bartlett (This used to be commit f85e57a71e639c63d89dd2d4c11632e36d0e8ba6) --- testprogs/blackbox/test_smbclient.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index 1d28fa2f71..211f0f3c48 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -97,6 +97,17 @@ 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` -rm -f tmpfile tmpfile-old tmpfilex +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" + + +rm -f tmpfile tmpfile-old tmpfilex tmpauthfile tmppassfile exit $failed -- cgit From 48bb9bc6cd4dba3b07b0013e59ae5559f566a32e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 25 Jan 2007 12:39:13 +0000 Subject: r21017: Actually run tests during test phase rather than when generating the recipe. (This used to be commit b975ce3a471d29fb2c0691c65993f9dfeb066d79) --- testprogs/blackbox/test_cifsdd.sh | 4 +-- testprogs/blackbox/test_ldb.sh | 76 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 3 deletions(-) create mode 100755 testprogs/blackbox/test_ldb.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_cifsdd.sh b/testprogs/blackbox/test_cifsdd.sh index d216695821..588c308f9c 100755 --- a/testprogs/blackbox/test_cifsdd.sh +++ b/testprogs/blackbox/test_cifsdd.sh @@ -37,8 +37,6 @@ testit() { return $status } - - runcopy() { message="$1" shift @@ -48,7 +46,7 @@ runcopy() { } compare() { - tesit "$1" cmp "$2" "$3" + testit "$1" cmp "$2" "$3" } sourcepath=tempfile.src.$$ diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh new file mode 100755 index 0000000000..d46f371353 --- /dev/null +++ b/testprogs/blackbox/test_ldb.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +p=$1 +shift 1 +options="$*" + +check() { + name="$1" + shift + cmdline="$*" + echo "test: $name" + $cmdline + status=$? + if [ x$status = x0 ]; then + echo "success: $name" + else + echo "failure: $name" + failed=`expr $failed + 1` + fi + return $status +} + + + +check "RootDSE" bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1` + +echo "Getting defaultNamingContext" +BASEDN=`bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'` +echo "BASEDN is $BASEDN" + +check "Listing Users" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=user)' sAMAccountName || failed=`expr $failed + 1` + +check "Listing Groups" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1` + +nentries=`bin/ldbsearch $options -H $p://$SERVER $CONFIGURATION '(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))' sAMAccountName | grep sAMAccountName | wc -l` +echo "Found $nentries entries" +if [ $nentries -lt 10 ]; then +echo "Should have found at least 10 entries" +failed=`expr $failed + 1` +fi + +echo "Check rootDSE for Controls" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER -s base -b "" '(objectclass=*)' | grep -i supportedControl | wc -l` +if [ $nentries -lt 4 ]; then +echo "Should have found at least 4 entries" +failed=`expr $failed + 1` +fi + +echo "Test Paged Results Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=paged_results:1:5 '(objectclass=user)' | grep sAMAccountName | wc -l` +if [ $nentries -lt 1 ]; then +echo "Paged Results Control test returned 0 items" +failed=`expr $failed + 1` +fi + +echo "Test Server Sort Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=server_sort:1:0:sAMAccountName '(objectclass=user)' | grep sAMAccountName | wc -l` +if [ $nentries -lt 1 ]; then +echo "Server Sort Control test returned 0 items" +failed=`expr $failed + 1` +fi + +echo "Test Extended DN Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:0 '(objectclass=user)' | grep sAMAccountName | wc -l` +if [ $nentries -lt 1 ]; then +echo "Extended DN Control test returned 0 items" +failed=`expr $failed + 1` +fi + +echo "Test Attribute Scope Query Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l` +if [ $nentries -lt 1 ]; then +echo "Attribute Scope Query test returned 0 items" +failed=`expr $failed + 1` +fi +exit $failed -- cgit From 000a094318989eb5a221515e7870e71f28e36133 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 5 Mar 2007 13:51:05 +0000 Subject: r21700: Run mktestsetup as an external program. This guarantees that it can be used for other selftest implementations (in particular the perl one I've been working on). (This used to be commit aa29907327a91a64c769b1f2712f553e13964418) --- testprogs/blackbox/test_ldb.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index d46f371353..32e80e1995 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -1,7 +1,8 @@ #!/bin/sh p=$1 -shift 1 +SERVER=$2 +shift 2 options="$*" check() { -- cgit From 72d88d158a6e82392116bab09ce8704115072d07 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 5 Mar 2007 21:28:55 +0000 Subject: r21707: Finally merge my (long-living) perlselftest branch. This changes the main selftest code to be in perl rather than in shell script. The selftest script is now no longer a black box but a regular executable that takes --help. This adds the following features: * "make test TESTS=foo" will run only the tests that match the regex "foo" * ability to deal with expected failures. the suite will not warn about tests that fail and are known to fail, but will warn about other failing tests and tests that are succeeding tests but incorrectly marked as failing. * ability to print a summary with all failures at the end of the run It also opens up the way to the following features, which I hope to implement later: * "environments", for example having a complete domains with DCs and domain members in a testenvironment * only set up smbd if necessary (not when running LOCAL tests, for example) * different mktestsetup scripts per target. except for the mktestsetup script, we can use the same infrastructure for samba 3 or windows. (This used to be commit 38f867880beb40c691e9713f854426031310629c) --- testprogs/blackbox/test_ldb.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index 32e80e1995..2c2ac10fdb 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -21,8 +21,6 @@ check() { return $status } - - check "RootDSE" bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1` echo "Getting defaultNamingContext" -- cgit 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/blackbox') 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 From f3303bc8f6c175759e064f08924bb730c14d319b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 11 Apr 2007 12:10:40 +0000 Subject: r22170: To get the smbclient blackbox test to pass again, we need to get the private dir to contain a valid machine account. It isn't really valid it use the DC's account any more, so extend this script to also join the domain. This nicely tests out some previously untested code too! Andrew Bartlett (This used to be commit 12f4e6033ed11a010211a4295424588f44f7e5e0) --- testprogs/blackbox/test_smbclient.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index e8f90060de..a3bd958cc8 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -37,6 +37,8 @@ runcmd() { return $? } +testit "domain join" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` + # Generate random file cat >tmpfile< Date: Thu, 12 Apr 2007 10:25:01 +0000 Subject: r22187: Test kerberos logins in the smbclient blackbox tests, including with a machine account. Andrew Bartlett (This used to be commit 16a2bb87a80ffb921f267492f453eb3457666315) --- testprogs/blackbox/test_smbclient.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index a3bd958cc8..413b680a52 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -96,7 +96,9 @@ 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 || failed=`expr $failed + 1` +echo ls | testit "Test login with --machine-pass without kerberos" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass -k no || failed=`expr $failed + 1` + +echo ls | testit "Test login with --machine-pass and kerberos" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass -k yes || failed=`expr $failed + 1` ( echo "password=$PASSWORD" -- cgit From b0cbe9ae4a5768c768d69c68a06e1a41b7d26985 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 16 Apr 2007 04:55:52 +0000 Subject: r22235: Test kinit, and PKINIT functionality by means of a new blackbox test. Andrew Bartlett (This used to be commit 7f27bfc3568bc09b2b9cb9ba03aae55a03e08f9a) --- testprogs/blackbox/test_kinit.sh | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 testprogs/blackbox/test_kinit.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh new file mode 100644 index 0000000000..635662a550 --- /dev/null +++ b/testprogs/blackbox/test_kinit.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +if [ $# -lt 5 ]; then +cat < ./tmppassfile +testit "kinit with password" samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM || failed=`expr $failed + 1` +testit "kinit with pkinit" samba4kinit --request-pac --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1` + +echo ls | testit "Test login with kerberos ccache" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -k yes || failed=`expr $failed + 1` + +testit "domain join with kerberos ccache" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -k yes $@ + +rm -f tmpccfile tmppassfile +exit $failed -- cgit From aacabe9c5731009458900c1d6dce9669b3e987be Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 16 Apr 2007 22:19:51 +0000 Subject: r22284: Make this script executable (This used to be commit b0cbf169366e3624f4d8c2b1a65e478e72734871) --- testprogs/blackbox/test_kinit.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 testprogs/blackbox/test_kinit.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh old mode 100644 new mode 100755 -- cgit From 5a74acbb177efb5ea1d555383d70174ffe0b2129 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 28 May 2007 14:24:36 +0000 Subject: r23174: merge text (This used to be commit a6293ab5cb31a73f23adebacc68d2d383fa62e22) --- testprogs/blackbox/test_smbclient.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index 413b680a52..dfe13a3d4f 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -1,4 +1,7 @@ #!/bin/sh +# Blackbox tests for smbclient +# Copyright (C) 2006-2007 Jelmer Vernooij +# Copyright (C) 2006-2007 Andrew Bartlett if [ $# -lt 5 ]; then cat < Date: Thu, 12 Jul 2007 06:15:47 +0000 Subject: r23849: ldap_server: Provide more info in debug traces blackbox tests: increase test coverage by running more options. Andrew Bartlett (This used to be commit 46abf82675ea0ce06a162be5d733da0c236880c2) --- testprogs/blackbox/test_ldb.sh | 11 +++++++++++ testprogs/blackbox/test_smbclient.sh | 2 ++ 2 files changed, 13 insertions(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index 2c2ac10fdb..6ebb6c143b 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -1,7 +1,16 @@ #!/bin/sh +if [ $# -lt 2 ]; then +cat < Date: Thu, 19 Jul 2007 06:40:42 +0000 Subject: r23964: Update blackbox selftest scripts to cover more code, and to more consistantly report errors. (Some were being lost due to the "echo foo | cmd" calling convention). Andrew Bartlett (This used to be commit d0a994d0ce7b1d4a33bbca5348c2da868401971f) --- testprogs/blackbox/test_kinit.sh | 52 ++++++++++++++++++++++++----- testprogs/blackbox/test_smbclient.sh | 63 ++++++++++++++++++++---------------- 2 files changed, 80 insertions(+), 35 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index 635662a550..6702ea2037 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -1,8 +1,11 @@ #!/bin/sh +# Blackbox tests for kinit and kerberos integration with smbclient etc +# Copyright (C) 2006-2007 Jelmer Vernooij +# Copyright (C) 2006-2007 Andrew Bartlett if [ $# -lt 5 ]; then cat < ./tmppassfile -testit "kinit with password" samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM || failed=`expr $failed + 1` -testit "kinit with pkinit" samba4kinit --request-pac --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1` +testit "kinit with password" bin/samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM || failed=`expr $failed + 1` +testit "kinit with pkinit" bin/samba4kinit --request-pac --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1` + +test_smbclient "Test login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` + +testit "domain join with kerberos ccache" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1` + +testit "add user with kerberos ccache" $VALGRIND bin/net user add nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` +USERPASS=testPass@12% + +testit "set user password with kerberos ccache" $VALGRIND bin/net password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` -echo ls | testit "Test login with kerberos ccache" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -k yes || failed=`expr $failed + 1` +#KRB5CCNAME=`pwd`/tmpuserccache +#export KRB5CCNAME +# +#testit "kinit with user password" bin/samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1` +# +#KRB5CCNAME=`pwd`/tmpccache +#export KRB5CCNAME -testit "domain join with kerberos ccache" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -k yes $@ +testit "del user with kerberos ccache" $VALGRIND bin/net user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` -rm -f tmpccfile tmppassfile +rm -f tmpccfile tmppassfile tmpuserccache exit $failed diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index 05d4b19bed..f92445d64a 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -35,9 +35,18 @@ testit() { runcmd() { name="$1" + cmd="$2" shift - testit "$name" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ - return $? + shift + echo "test: $name" + $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -c "$cmd" -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ + status=$? + if [ x$status = x0 ]; then + echo "success: $name" + else + echo "failure: $name" + fi + return $status } testit "share and server list" $VALGRIND bin/smbclient -L $SERVER $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` @@ -53,59 +62,59 @@ blah EOF # put that file -echo mput tmpfile | runcmd "MPutting file" || failed=`expr $failed + 1` +runcmd "MPutting file" 'mput tmpfile' || failed=`expr $failed + 1` # check file info -echo altname tmpfile | runcmd "Getting alternative name" || failed=`expr $failed + 1` +runcmd "Getting alternative name" 'altname tmpfile'|| failed=`expr $failed + 1` # run allinfo on that file -echo allinfo tmpfile | runcmd "Checking info on file" || failed=`expr $failed + 1` +runcmd "Checking info on file" 'allinfo tmpfile'|| failed=`expr $failed + 1` # get that file mv tmpfile tmpfile-old -echo mget tmpfile | runcmd "MGetting file" || failed=`expr $failed + 1` +runcmd "MGetting file" 'mget tmpfile' || failed=`expr $failed + 1` # remove that file -echo rm tmpfile | runcmd "Removing file" || failed=`expr $failed + 1` +runcmd "Removing file" 'rm tmpfile' || failed=`expr $failed + 1` # compare locally testit "Comparing files" diff tmpfile-old tmpfile || failed=`expr $failed + 1` # create directory # cd to directory # cd to top level directory # remove directory -echo "mkdir bla; cd bla; cd ..; rmdir bla" | runcmd "Creating directory, Changing directory, Going back, " || 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 -echo "recurse; echo mkdir bla/bloe; exit" | runcmd "Creating nested directory" || failed=`expr $failed + 1` +runcmd "Creating nested directory" 'mkdir bla/bloe' || failed=`expr $failed + 1` # remove parent directory -echo rmdir bla/bloe | runcmd "Removing directory" || failed=`expr $failed + 1` +runcmd "Removing directory" 'rmdir bla/bloe' || failed=`expr $failed + 1` # remove child directory -echo rmdir bla | runcmd "Removing directory" || failed=`expr $failed + 1` +runcmd "Removing directory" 'rmdir bla'|| failed=`expr $failed + 1` # run fsinfo -echo fsinfo objectid | runcmd "Getting file system info" || failed=`expr $failed + 1` +runcmd "Getting file system info" 'fsinfo objectid'|| failed=`expr $failed + 1` # put that file -echo put tmpfile | runcmd "Putting file" || failed=`expr $failed + 1` +runcmd "Putting file" 'put tmpfile'|| failed=`expr $failed + 1` # get that file mv tmpfile tmpfile-old -echo get tmpfile | runcmd "Getting file" || failed=`expr $failed + 1` +runcmd "Getting file" 'get tmpfile'|| failed=`expr $failed + 1` # remove that file -echo rm tmpfile | runcmd "Removing file" || failed=`expr $failed + 1` +runcmd "Removing file" 'rm tmpfile' || failed=`expr $failed + 1` # compare locally testit "Comparing files" diff tmpfile-old tmpfile || failed=`expr $failed + 1` # put that file -echo put tmpfile tmpfilex | runcmd "Putting file with different name" || failed=`expr $failed + 1` +runcmd "Putting file with different name" 'put tmpfile tmpfilex' || failed=`expr $failed + 1` # get that file -echo get tmpfilex | runcmd "Getting file again" || failed=`expr $failed + 1` +runcmd "Getting file again" 'get tmpfilex' || failed=`expr $failed + 1` # compare locally testit "Comparing files" diff tmpfilex tmpfile || failed=`expr $failed + 1` # remove that file -echo rm tmpfilex | runcmd "Removing file" || failed=`expr $failed + 1` +runcmd "Removing file" 'rm tmpfilex'|| failed=`expr $failed + 1` # do some simple operations using old protocol versions -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` +runcmd "List directory with LANMAN1" 'ls' -m LANMAN1 || failed=`expr $failed + 1` +runcmd "List directory with LANMAN2" 'ls' -m LANMAN2 || failed=`expr $failed + 1` -echo pwd | runcmd "Print current working directory" || failed=`expr $failed + 1` +runcmd "Print current working directory" 'pwd'|| failed=`expr $failed + 1` -echo ls | testit "Test login with --machine-pass without kerberos" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass -k no || failed=`expr $failed + 1` +testit "Test login with --machine-pass without kerberos" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k no || failed=`expr $failed + 1` -echo ls | testit "Test login with --machine-pass and kerberos" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass -k yes || failed=`expr $failed + 1` +testit "Test login with --machine-pass and kerberos" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k yes || failed=`expr $failed + 1` ( echo "password=$PASSWORD" @@ -113,24 +122,24 @@ echo ls | testit "Test login with --machine-pass and kerberos" $VALGRIND bin/smb 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` +testit "Test login with --authentication-file" $VALGRIND bin/smbclient -c 'ls' $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` +testit "Test login with PASSWD_FILE" $VALGRIND bin/smbclient -c 'ls' $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` +testit "Test login with PASSWD" $VALGRIND bin/smbclient -c 'ls' $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` +testit "Test login with USER and PASSWD" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" | failed=`expr $failed + 1` PASSWD= export PASSWD unset PASSWD -- cgit From bb681188407055a7ea77cdaa76600dac37ae3096 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 19 Jul 2007 06:44:18 +0000 Subject: r23965: Add testing the 'net time' command to the script. Andrew Bartlett (This used to be commit 4fab53432a3599cf62a7ebef977bc33ef5a5f734) --- testprogs/blackbox/test_kinit.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index 6702ea2037..09777df16d 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -61,6 +61,7 @@ testit "kinit with pkinit" bin/samba4kinit --request-pac --pk-user=FILE:$PREFIX/ test_smbclient "Test login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` testit "domain join with kerberos ccache" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1` +testit "check time with kerberos ccache" $VALGRIND bin/net time $SERVER $CONFIGURATION -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1` testit "add user with kerberos ccache" $VALGRIND bin/net user add nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` USERPASS=testPass@12% -- cgit From f1f4f665b01aec093de9e93f399070f44f65a551 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Aug 2007 18:31:27 +0000 Subject: r24335: Fix -N support. (This used to be commit 18ea767d396bf6d956fd83ee3d2687d98897ae36) --- testprogs/blackbox/test_smbclient.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index f92445d64a..b2787e5260 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -51,6 +51,8 @@ runcmd() { testit "share and server list" $VALGRIND bin/smbclient -L $SERVER $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` +testit "share and server list anonymously" $VALGRIND bin/smbclient -N -L $SERVER $CONFIGURATION $@ || failed=`expr $failed + 1` + testit "domain join" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` # Generate random file -- cgit From 4da477d4fa891703497608c6b93402c4fc278f95 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 12 Aug 2007 00:50:25 +0000 Subject: r24339: Move output functions to separate files. (This used to be commit f4ff4c5f61189c71ab60a5455272302add9e1d97) --- testprogs/blackbox/test_smbclient.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index b2787e5260..5431e4ce59 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -141,7 +141,7 @@ testit "Test login with PASSWD" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION / oldUSER=$USER USER="$USERNAME" export USER -testit "Test login with USER and PASSWD" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" | failed=`expr $failed + 1` +testit "Test login with USER and PASSWD" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=`expr $failed + 1` PASSWD= export PASSWD unset PASSWD -- cgit From 0eb3ee32049eb5b76308e8ef4dc6af3db544afbb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 15 Aug 2007 13:14:38 +0000 Subject: r24459: Fix up ldap.js and test_ldb.sh to test the domain_scope control, and to test the behaviour of objectCategory=user searches. It turns out (thanks to a hint on http://blog.joeware.net/2005/12/08/147/) that objectCategory=user maps into objectCategory=CN=Person,... (by the defaultObjectCategory of that objectclass). Simplify the entryUUID module by using the fact that we now set the DN as the canoncical form of objectCategory. Andrew Bartlett (This used to be commit b474be9507df51982a604289215bb1868124fc24) --- testprogs/blackbox/test_ldb.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index 6ebb6c143b..8a019e18b7 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -77,6 +77,13 @@ echo "Extended DN Control test returned 0 items" failed=`expr $failed + 1` fi +echo "Test Domain scope Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=domain_scope:1 '(objectclass=user)' | grep sAMAccountName | wc -l` +if [ $nentries -lt 1 ]; then +echo "Extended Domain scope Control test returned 0 items" +failed=`expr $failed + 1` +fi + echo "Test Attribute Scope Query Control" nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l` if [ $nentries -lt 1 ]; then -- cgit From 8d6b9f2b883ff54898d1925fcf5e07c5704ba1e7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 27 Aug 2007 00:36:26 +0000 Subject: r24691: All smbclient blackbox tests pass. (This used to be commit c3a138627487ec0ed5a4c4c4457df35275f4cada) --- testprogs/blackbox/test_smbclient.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index 5431e4ce59..35f2570d31 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -80,7 +80,7 @@ testit "Comparing files" diff tmpfile-old tmpfile || failed=`expr $failed + 1` # cd to directory # cd to top level directory # remove directory -runcmd "Creating directory, Changing directory, Going back, " 'mkdir bla; cd bla; cd ..; rmdir bla' || 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 -- cgit From 666a833d2e5927cdeefcb499799b384ea26848c8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 27 Aug 2007 01:46:09 +0000 Subject: r24693: Test search options in ldb blackbox testing. Andrew Bartlett (This used to be commit 9f45b5553a53d2e8a1c2643bf58fb90db8217b66) --- testprogs/blackbox/test_ldb.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index 8a019e18b7..fd925fc99b 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -90,4 +90,13 @@ if [ $nentries -lt 1 ]; then echo "Attribute Scope Query test returned 0 items" failed=`expr $failed + 1` fi + +echo "Test Search Options Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=search_options:1:2 '(objectclass=crossRef)' | grep crossRef | wc -l` +if [ $nentries -lt 1 ]; then +echo "Search Options Control Query test returned 0 items" +failed=`expr $failed + 1` +fi + + exit $failed -- cgit From a73a8d4b9d09b5bb98b58f23196bd44263158cde Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 27 Aug 2007 14:36:22 +0000 Subject: r24706: Move nmblookup tests to separate blackbox testsuite. (This used to be commit aeb2e714f22abe68f89218967a55d7abd2d04ae1) --- testprogs/blackbox/test_nmblookup.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 testprogs/blackbox/test_nmblookup.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_nmblookup.sh b/testprogs/blackbox/test_nmblookup.sh new file mode 100755 index 0000000000..ad9b3ba799 --- /dev/null +++ b/testprogs/blackbox/test_nmblookup.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# Blackbox tests for nmblookup + +NETBIOSNAME=$1 +NETBIOSALIAS=$2 +SERVER=$3 +SERVER_IP=$4 +shift 4 +TORTURE_OPTIONS=$* + +failed=0 + +testit() { + name="$1" + shift + cmdline="$*" + echo "test: $name" + $cmdline + status=$? + if [ x$status = x0 ]; then + echo "success: $name" + else + echo "failure: $name" + failed=`expr $failed + 1` + fi + return $status +} + +testit "nmblookup -U \$SERVER_IP \$SERVER" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $SERVER +testit "nmblookup -U \$SERVER_IP \$NETBIOSNAME" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSNAME +testit "nmblookup -U \$SERVER_IP \$NETBIOSALIAS" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSALIAS +testit "nmblookup \$SERVER" bin/nmblookup $TORTURE_OPTIONS $SERVER +testit "nmblookup \$NETBIOSNAME" bin/nmblookup $TORTURE_OPTIONS $NETBIOSNAME +testit "nmblookup \$NETBIOSALIAS" bin/nmblookup $TORTURE_OPTIONS $NETBIOSALIAS + +exit $failed -- cgit From bf4f1307ab8a6c29b70f6ccf0cf4e34fa3629819 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Sep 2007 00:04:27 +0000 Subject: r24876: Use more absolute paths to samba4 binaries. (This used to be commit 8616bfa0ae5762ae45b8339c84b8e4ae499f5897) --- testprogs/blackbox/test_cifsdd.sh | 3 ++- testprogs/blackbox/test_kinit.sh | 21 +++++++++++++-------- testprogs/blackbox/test_smbclient.sh | 21 ++++++++++++--------- 3 files changed, 27 insertions(+), 18 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_cifsdd.sh b/testprogs/blackbox/test_cifsdd.sh index 588c308f9c..23df04c84c 100755 --- a/testprogs/blackbox/test_cifsdd.sh +++ b/testprogs/blackbox/test_cifsdd.sh @@ -14,7 +14,8 @@ USERNAME=$2 PASSWORD=$3 DOMAIN=$4 -DD=bin/cifsdd +samba4bindir=`dirname $0`/../../source/bin +DD=$samba4bindir/cifsdd SHARE=tmp DEBUGLEVEL=1 diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index 09777df16d..db12fba2f8 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -19,6 +19,11 @@ PREFIX=$6 shift 6 failed=0 +samba4bindir=`dirname $0`/../../source/bin +smbclient=$samba4bindir/smbclient +samba4kinit=$samba4bindir/samba4kinit +net=$samba4bindir/net + testit() { name="$1" shift @@ -41,7 +46,7 @@ test_smbclient() { shift shift echo "test: $name" - $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -c "$cmd" -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ + $VALGRIND $smbclient $CONFIGURATION //$SERVER/tmp -c "$cmd" -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ status=$? if [ x$status = x0 ]; then echo "success: $name" @@ -55,18 +60,18 @@ KRB5CCNAME=`pwd`/tmpccache export KRB5CCNAME echo $PASSWORD > ./tmppassfile -testit "kinit with password" bin/samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM || failed=`expr $failed + 1` -testit "kinit with pkinit" bin/samba4kinit --request-pac --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1` +testit "kinit with password" $samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM || failed=`expr $failed + 1` +testit "kinit with pkinit" $samba4kinit --request-pac --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1` test_smbclient "Test login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` -testit "domain join with kerberos ccache" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1` -testit "check time with kerberos ccache" $VALGRIND bin/net time $SERVER $CONFIGURATION -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1` +testit "domain join with kerberos ccache" $VALGRIND $net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1` +testit "check time with kerberos ccache" $VALGRIND $net time $SERVER $CONFIGURATION -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1` -testit "add user with kerberos ccache" $VALGRIND bin/net user add nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` +testit "add user with kerberos ccache" $VALGRIND $net user add nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` USERPASS=testPass@12% -testit "set user password with kerberos ccache" $VALGRIND bin/net password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` +testit "set user password with kerberos ccache" $VALGRIND $net password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` #KRB5CCNAME=`pwd`/tmpuserccache #export KRB5CCNAME @@ -76,7 +81,7 @@ testit "set user password with kerberos ccache" $VALGRIND bin/net password set $ #KRB5CCNAME=`pwd`/tmpccache #export KRB5CCNAME -testit "del user with kerberos ccache" $VALGRIND bin/net user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` +testit "del user with kerberos ccache" $VALGRIND $net user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` rm -f tmpccfile tmppassfile tmpuserccache exit $failed diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index 35f2570d31..bd3df0b254 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -18,6 +18,9 @@ PREFIX=$5 shift 5 failed=0 +samba4bindir=`dirname $0`/../../source/bin +smbclient=$samba4bindir/smbclient + testit() { name="$1" shift @@ -39,7 +42,7 @@ runcmd() { shift shift echo "test: $name" - $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -c "$cmd" -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ + $VALGRIND $smbclient $CONFIGURATION //$SERVER/tmp -c "$cmd" -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ status=$? if [ x$status = x0 ]; then echo "success: $name" @@ -49,9 +52,9 @@ runcmd() { return $status } -testit "share and server list" $VALGRIND bin/smbclient -L $SERVER $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` +testit "share and server list" $VALGRIND $smbclient -L $SERVER $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` -testit "share and server list anonymously" $VALGRIND bin/smbclient -N -L $SERVER $CONFIGURATION $@ || failed=`expr $failed + 1` +testit "share and server list anonymously" $VALGRIND $smbclient -N -L $SERVER $CONFIGURATION $@ || failed=`expr $failed + 1` testit "domain join" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` @@ -114,9 +117,9 @@ runcmd "List directory with LANMAN2" 'ls' -m LANMAN2 || failed=`expr $failed + 1 runcmd "Print current working directory" 'pwd'|| failed=`expr $failed + 1` -testit "Test login with --machine-pass without kerberos" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k no || failed=`expr $failed + 1` +testit "Test login with --machine-pass without kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k no || failed=`expr $failed + 1` -testit "Test login with --machine-pass and kerberos" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k yes || failed=`expr $failed + 1` +testit "Test login with --machine-pass and kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k yes || failed=`expr $failed + 1` ( echo "password=$PASSWORD" @@ -124,24 +127,24 @@ testit "Test login with --machine-pass and kerberos" $VALGRIND bin/smbclient -c echo "domain=$DOMAIN" ) > tmpauthfile -testit "Test login with --authentication-file" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --authentication-file=tmpauthfile || failed=`expr $failed + 1` +testit "Test login with --authentication-file" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --authentication-file=tmpauthfile || failed=`expr $failed + 1` PASSWD_FILE="tmppassfile" echo "$PASSWORD" > $PASSWD_FILE export PASSWD_FILE -testit "Test login with PASSWD_FILE" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` +testit "Test login with PASSWD_FILE" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` PASSWD_FILE="" export PASSWD_FILE unset PASSWD_FILE PASSWD="$PASSWORD" export PASSWD -testit "Test login with PASSWD" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` +testit "Test login with PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` oldUSER=$USER USER="$USERNAME" export USER -testit "Test login with USER and PASSWD" $VALGRIND bin/smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=`expr $failed + 1` +testit "Test login with USER and PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=`expr $failed + 1` PASSWD= export PASSWD unset PASSWD -- cgit From 364266e22a08e730f2442cf87ec385620cff2700 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 29 Nov 2007 08:00:04 +0100 Subject: r26192: Handle, test and implement the style of extended_dn requiest that MMC uses. It appears that the control value is optional, implying type 0 responses. Failing to parse this was causing LDAP disconnects with 'unavailable critical extension'. Andrew Bartlett (This used to be commit 833dfc2f2af84c45f954e428c9ea6babf100ba92) --- testprogs/blackbox/test_ldb.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index fd925fc99b..e35d3547d9 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -71,11 +71,21 @@ failed=`expr $failed + 1` fi echo "Test Extended DN Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1 '(objectclass=user)' | grep sAMAccountName | wc -l` +if [ $nentries -lt 1 ]; then +echo "Extended DN Control test returned 0 items" +failed=`expr $failed + 1` +fi nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:0 '(objectclass=user)' | grep sAMAccountName | wc -l` if [ $nentries -lt 1 ]; then echo "Extended DN Control test returned 0 items" failed=`expr $failed + 1` fi +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:1 '(objectclass=user)' | grep sAMAccountName | wc -l` +if [ $nentries -lt 1 ]; then +echo "Extended DN Control test returned 0 items" +failed=`expr $failed + 1` +fi echo "Test Domain scope Control" nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=domain_scope:1 '(objectclass=user)' | grep sAMAccountName | wc -l` -- cgit From 95f83d904040a3d55abfb9fa080aede269663227 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 13 Jan 2008 02:45:55 +0100 Subject: tests.blackbox: Avoid my local Kerberos setup from interfering with the blackbox.smbclient test. (This used to be commit 1d703dcf3a888e4c8301a4f53a289ff18bf89f75) --- testprogs/blackbox/test_smbclient.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index bd3df0b254..5d5edfeee4 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -144,12 +144,14 @@ testit "Test login with PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$S oldUSER=$USER USER="$USERNAME" export USER -testit "Test login with USER and PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=`expr $failed + 1` +testit "Test login with USER and PASSWD" $VALGRIND $smbclient -k no -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=`expr $failed + 1` PASSWD= export PASSWD unset PASSWD USER=$oldUSER export USER +printenv + rm -f tmpfile tmpfile-old tmpfilex tmpauthfile tmppassfile exit $failed -- cgit From 7b061619047f76f57c26ac1fc4fb530cadf0337b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 13 Jan 2008 04:50:33 +0100 Subject: Remove accidently committed debugging statement. (This used to be commit 9ad2de6e9900aadc3171c5376972ce4d3ed3fb24) --- testprogs/blackbox/test_smbclient.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index 5d5edfeee4..a803d83363 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -151,7 +151,5 @@ unset PASSWD USER=$oldUSER export USER -printenv - rm -f tmpfile tmpfile-old tmpfilex tmpauthfile tmppassfile exit $failed -- cgit From 85c70212161f8cad3510ad81dce0d2e19e9d25fe Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 16 Jan 2008 08:58:07 +1100 Subject: Test the behaviour of mixed domain_scope and search_options controls. Andrew Bartlett (This used to be commit 89053bc564f1d736da48fbe20e7f8f244b0c67fa) --- testprogs/blackbox/test_ldb.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index e35d3547d9..4067a7fc43 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -108,5 +108,12 @@ echo "Search Options Control Query test returned 0 items" failed=`expr $failed + 1` fi +echo "Test Search Options Control with Domain Scope Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=search_options:1:2,domain_scope:1 '(objectclass=crossRef)' | grep crossRef | wc -l` +if [ $nentries -lt 1 ]; then +echo "Search Options Control Query test returned 0 items" +failed=`expr $failed + 1` +fi + exit $failed -- cgit From 066912ba806733587a1948235e8026107ac563a6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 8 Feb 2008 00:34:29 +0100 Subject: Put temporary test files in test directory. (This used to be commit 16382999bebf158996e16219e7053ef4821550c1) --- testprogs/blackbox/test_kinit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index db12fba2f8..d4eff07c8d 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -56,7 +56,7 @@ test_smbclient() { return $status } -KRB5CCNAME=`pwd`/tmpccache +KRB5CCNAME="$PREFIX/tmpccache" export KRB5CCNAME echo $PASSWORD > ./tmppassfile -- cgit From b5bfabf1526f094942f986f8c8f7019b64db6c2f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 9 Feb 2008 17:17:21 +0100 Subject: Move nmblookup blackbox test closer to the code it tests. (This used to be commit 3f24136b56d281580410bf69841c6dece5508d17) --- testprogs/blackbox/test_nmblookup.sh | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100755 testprogs/blackbox/test_nmblookup.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_nmblookup.sh b/testprogs/blackbox/test_nmblookup.sh deleted file mode 100755 index ad9b3ba799..0000000000 --- a/testprogs/blackbox/test_nmblookup.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Blackbox tests for nmblookup - -NETBIOSNAME=$1 -NETBIOSALIAS=$2 -SERVER=$3 -SERVER_IP=$4 -shift 4 -TORTURE_OPTIONS=$* - -failed=0 - -testit() { - name="$1" - shift - cmdline="$*" - echo "test: $name" - $cmdline - status=$? - if [ x$status = x0 ]; then - echo "success: $name" - else - echo "failure: $name" - failed=`expr $failed + 1` - fi - return $status -} - -testit "nmblookup -U \$SERVER_IP \$SERVER" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $SERVER -testit "nmblookup -U \$SERVER_IP \$NETBIOSNAME" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSNAME -testit "nmblookup -U \$SERVER_IP \$NETBIOSALIAS" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSALIAS -testit "nmblookup \$SERVER" bin/nmblookup $TORTURE_OPTIONS $SERVER -testit "nmblookup \$NETBIOSNAME" bin/nmblookup $TORTURE_OPTIONS $NETBIOSNAME -testit "nmblookup \$NETBIOSALIAS" bin/nmblookup $TORTURE_OPTIONS $NETBIOSALIAS - -exit $failed -- cgit From 63c099c51a71afad67dce2d2df842b934412117b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 15 Feb 2008 14:27:06 +1100 Subject: added blackbox testing for locktest (This used to be commit af6484f78d273407dd9b264bc4adb33497eee48b) --- testprogs/blackbox/test_locktest.sh | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 testprogs/blackbox/test_locktest.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_locktest.sh b/testprogs/blackbox/test_locktest.sh new file mode 100755 index 0000000000..60597ba83f --- /dev/null +++ b/testprogs/blackbox/test_locktest.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# Blackbox tests for locktest +# Copyright (C) 2008 Andrew Tridgell +# based on test_smbclient.sh + +if [ $# -lt 4 ]; then +cat < Date: Fri, 15 Feb 2008 14:55:31 +1100 Subject: converted locktest to use popt and cmdline utility code (This used to be commit 625ea49a95cbdb507ea5b191f75ffa27e25cdb90) --- testprogs/blackbox/test_locktest.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_locktest.sh b/testprogs/blackbox/test_locktest.sh index 60597ba83f..c08b408107 100755 --- a/testprogs/blackbox/test_locktest.sh +++ b/testprogs/blackbox/test_locktest.sh @@ -3,9 +3,9 @@ # Copyright (C) 2008 Andrew Tridgell # based on test_smbclient.sh -if [ $# -lt 4 ]; then +if [ $# -lt 5 ]; then cat < Date: Fri, 15 Feb 2008 15:33:10 +1100 Subject: added a blackbox test for masktest (This used to be commit 05a110123df2372418e2ef2fd8f269b92054069c) --- testprogs/blackbox/test_masktest.sh | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 testprogs/blackbox/test_masktest.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_masktest.sh b/testprogs/blackbox/test_masktest.sh new file mode 100755 index 0000000000..ef429a1fb0 --- /dev/null +++ b/testprogs/blackbox/test_masktest.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# Blackbox tests for masktest +# Copyright (C) 2008 Andrew Tridgell +# based on test_smbclient.sh + +if [ $# -lt 5 ]; then +cat < Date: Fri, 15 Feb 2008 16:42:22 +1100 Subject: added blackbox testing of gentest (This used to be commit 716345fd38dfd8c6e610fbd6ba84c4f33e3edbb9) --- testprogs/blackbox/test_gentest.sh | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 testprogs/blackbox/test_gentest.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_gentest.sh b/testprogs/blackbox/test_gentest.sh new file mode 100755 index 0000000000..89cc8c2795 --- /dev/null +++ b/testprogs/blackbox/test_gentest.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# Blackbox tests for gentest +# Copyright (C) 2008 Andrew Tridgell +# based on test_smbclient.sh + +if [ $# -lt 4 ]; then +cat < st/gentest.ignore +all_info.out.fname +internal_information.out.file_id +EOF + +testit "gentest" $VALGRIND $gentest //$SERVER/test1 //$SERVER/test2 --num-ops=100 --ignore=st/gentest.ignore -W "$DOMAIN" -U"$USERNAME%$PASSWORD" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` + +/bin/rm -f st/gentest.ignore + +exit $failed -- cgit From 142fbfb3c1f9f8cda7f0edaa801f8345f23d805f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 28 Mar 2008 21:57:15 +1100 Subject: Fix and test python scripts and kerberos This fixes up the python credentials interface in a number of areas, with the aim of supporting '-k yes' as a command line option. (This enables the use of kerberos). As such, I've had to change the get_credentials call to take a loadparm context, so that the credentials can be initialised correctly. The test_kinit script has been modified to prove that this continues to work, as well as to provide greater code coverage of the kerberos paths. Andrew Bartlett (This used to be commit 727ef40c2b56910028ef3c1092b8eab1bfa6ce63) --- testprogs/blackbox/test_kinit.sh | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index d4eff07c8d..dbcdcf1112 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -23,6 +23,7 @@ samba4bindir=`dirname $0`/../../source/bin smbclient=$samba4bindir/smbclient samba4kinit=$samba4bindir/samba4kinit net=$samba4bindir/net +enableaccount="$samba4bindir/smbpython `dirname $0`/../../source/setup/enableaccount" testit() { name="$1" @@ -60,8 +61,10 @@ KRB5CCNAME="$PREFIX/tmpccache" export KRB5CCNAME echo $PASSWORD > ./tmppassfile +#testit "kinit with keytab" $samba4kinit --keytab=$PREFIX/dc/private/secrets.keytab $SERVER\$@$REALM || failed=`expr $failed + 1` testit "kinit with password" $samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM || failed=`expr $failed + 1` -testit "kinit with pkinit" $samba4kinit --request-pac --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1` +testit "kinit with pkinit" $samba4kinit --request-pac --renewable --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1` +testit "kinit renew ticket" $samba4kinit --request-pac -R test_smbclient "Test login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` @@ -70,18 +73,23 @@ testit "check time with kerberos ccache" $VALGRIND $net time $SERVER $CONFIGURAT testit "add user with kerberos ccache" $VALGRIND $net user add nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` USERPASS=testPass@12% +echo $USERPASS > ./tmpuserpassfile testit "set user password with kerberos ccache" $VALGRIND $net password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` -#KRB5CCNAME=`pwd`/tmpuserccache -#export KRB5CCNAME -# -#testit "kinit with user password" bin/samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1` -# -#KRB5CCNAME=`pwd`/tmpccache -#export KRB5CCNAME +testit "enable user with kerberos cache" $VALGRIND $enableaccount nettestuser -H ldap://$SERVER -k yes $@ || failed=`expr $failed + 1` -testit "del user with kerberos ccache" $VALGRIND $net user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` +KRB5CCNAME="$PREFIX/tmpuserccache" +export KRB5CCNAME + +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 + +testit "del user with kerberos ccache" $VALGRIND $net user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` -rm -f tmpccfile tmppassfile tmpuserccache +rm -f tmpccfile tmppassfile tmpuserpassfile tmpuserccache exit $failed -- cgit From afaba23131dc079be3cd92e87495ec8b2ebdc4ae Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 15 Apr 2008 09:13:32 +0200 Subject: Add blackbox test for ndrdump, to ensure it at least does not segfault. Andrew Bartlett (This used to be commit d2fe61a13a8368ceae30c6e7320c8d3d62fbc485) --- testprogs/blackbox/ndrdump/samr-CreateUser-in.dat | Bin 0 -> 60 bytes testprogs/blackbox/ndrdump/samr-CreateUser-out.dat | Bin 0 -> 32 bytes testprogs/blackbox/test_ndrdump.sh | 33 +++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 testprogs/blackbox/ndrdump/samr-CreateUser-in.dat create mode 100644 testprogs/blackbox/ndrdump/samr-CreateUser-out.dat create mode 100644 testprogs/blackbox/test_ndrdump.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/ndrdump/samr-CreateUser-in.dat b/testprogs/blackbox/ndrdump/samr-CreateUser-in.dat new file mode 100644 index 0000000000..a5840e1f7f Binary files /dev/null and b/testprogs/blackbox/ndrdump/samr-CreateUser-in.dat differ diff --git a/testprogs/blackbox/ndrdump/samr-CreateUser-out.dat b/testprogs/blackbox/ndrdump/samr-CreateUser-out.dat new file mode 100644 index 0000000000..cf9131dba9 Binary files /dev/null and b/testprogs/blackbox/ndrdump/samr-CreateUser-out.dat differ 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 -- cgit From 5a18f0d82b0c9518d5f1a5792cbbb7a49b60a88b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 15 Apr 2008 10:05:29 +0200 Subject: Test a few more bits of smbclient (This used to be commit 24a2409d725953ed5f62c652acc929ee7ddf9a19) --- testprogs/blackbox/test_smbclient.sh | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'testprogs/blackbox') 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` -- cgit From c7d95967643e3acac0b2f03b107f90d44a99ed66 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 15 Apr 2008 10:40:06 +0200 Subject: Test password change with 'net password change'. Andrew Bartlett (This used to be commit 695cee0349f561625e4bbfa3a142a5e35f7eb4bf) --- testprogs/blackbox/test_kinit.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'testprogs/blackbox') 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 -- cgit From 3413cfefb836c6a24fa740c13817a65fe264f2da Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Tue, 15 Apr 2008 17:04:36 +0200 Subject: blackbox: Add many more tests for wbinfo (This used to be commit 0a2942f6e948177fcc671eae705e6e61644de81c) --- testprogs/blackbox/test_wbinfo.sh | 199 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100755 testprogs/blackbox/test_wbinfo.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_wbinfo.sh b/testprogs/blackbox/test_wbinfo.sh new file mode 100755 index 0000000000..2ca4f23a2a --- /dev/null +++ b/testprogs/blackbox/test_wbinfo.sh @@ -0,0 +1,199 @@ +#!/bin/sh +# Blackbox test for wbinfo +if [ $# -lt 4 ]; then +cat < Date: Wed, 16 Apr 2008 00:05:12 +0200 Subject: Fix executable bit on blackbox ndrdump tests. (This used to be commit a3f0e4151bd87399a8bab9b71bad36bdc53c365c) --- testprogs/blackbox/test_ndrdump.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 testprogs/blackbox/test_ndrdump.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_ndrdump.sh b/testprogs/blackbox/test_ndrdump.sh old mode 100644 new mode 100755 -- cgit From 83c8d6cc89feeec797b9185fb967b24c9c088950 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 16 Apr 2008 01:10:20 +0200 Subject: Fix -r test, knownfailure return code. (This used to be commit 4f0954905a902381e66eec74fd30ff7adde232b8) --- testprogs/blackbox/test_wbinfo.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_wbinfo.sh b/testprogs/blackbox/test_wbinfo.sh index 2ca4f23a2a..b309b302dd 100755 --- a/testprogs/blackbox/test_wbinfo.sh +++ b/testprogs/blackbox/test_wbinfo.sh @@ -56,8 +56,10 @@ knownfail() { status=$? if [ x$status = x0 ]; then echo "failure: $name [unexpected success]" + status=1 else echo "knownfail: $name" + status=0 fi return $status } @@ -178,7 +180,7 @@ testit "wbinfo -i against $TARGET" $wbinfo -i "$DOMAIN/$USERNAME" || failed=`exp # this does not work knownfail "wbinfo --uid-info against $TARGET" $wbinfo --uid-info $admin_sid knownfail "wbinfo --group-info against $TARGET" $wbinfo --group-info "S-1-22-2-0" -knownfail "wbinfo -r against $TARGET" $wbinfo "$DOMAIN/$USERNAME" +knownfail "wbinfo -r against $TARGET" $wbinfo -r "$DOMAIN/$USERNAME" testit "wbinfo --user-domgroups against $TARGET" $wbinfo --user-domgroups $admin_sid || failed=`expr $failed + 1` -- cgit From f540669c48f96a65cd25edeb0c1e63bcc801dfed Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 16 Apr 2008 12:34:53 +0200 Subject: Use library for subunit test functions. (This used to be commit 690924dc7f43b69b9c4cfc1dd0c9c6e83d333518) --- testprogs/blackbox/subunit.sh | 67 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 testprogs/blackbox/subunit.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/subunit.sh b/testprogs/blackbox/subunit.sh new file mode 100755 index 0000000000..7a6b21e540 --- /dev/null +++ b/testprogs/blackbox/subunit.sh @@ -0,0 +1,67 @@ +# +# subunit.sh: shell functions to report test status via the subunit protocol. +# Copyright (C) 2006 Robert Collins +# Copyright (C) 2008 Jelmer Vernooij +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +subunit_start_test () { + # emit the current protocol start-marker for test $1 + echo "test: $1" +} + + +subunit_pass_test () { + # emit the current protocol test passed marker for test $1 + echo "success: $1" +} + + +subunit_fail_test () { + # emit the current protocol fail-marker for test $1, and emit stdin as + # the error text. + # we use stdin because the failure message can be arbitrarily long, and this + # makes it convenient to write in scripts (using < Date: Wed, 16 Apr 2008 14:52:29 +0200 Subject: Use the subunit shell library. (This used to be commit 49367e044e3ab94639ab3209bfd06c6286b44b59) --- testprogs/blackbox/test_cifsdd.sh | 24 ++++-------------------- testprogs/blackbox/test_gentest.sh | 15 +-------------- testprogs/blackbox/test_kinit.sh | 16 +--------------- testprogs/blackbox/test_ldb.sh | 2 ++ testprogs/blackbox/test_locktest.sh | 15 +-------------- testprogs/blackbox/test_masktest.sh | 15 +-------------- testprogs/blackbox/test_ndrdump.sh | 17 ++--------------- testprogs/blackbox/test_smbclient.sh | 15 +-------------- testprogs/blackbox/test_wbinfo.sh | 15 +-------------- 9 files changed, 14 insertions(+), 120 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_cifsdd.sh b/testprogs/blackbox/test_cifsdd.sh index 23df04c84c..43564a0c77 100755 --- a/testprogs/blackbox/test_cifsdd.sh +++ b/testprogs/blackbox/test_cifsdd.sh @@ -14,40 +14,24 @@ USERNAME=$2 PASSWORD=$3 DOMAIN=$4 +. `dirname $0`/subunit.sh + samba4bindir=`dirname $0`/../../source/bin DD=$samba4bindir/cifsdd SHARE=tmp DEBUGLEVEL=1 -failed=0 - -testit() { - name="$1" - shift - cmdline="$*" - echo "test: $name" - $cmdline - status=$? - if [ x$status = x0 ]; then - echo "success: $name" - else - echo "failure: $name" - failed=`expr $failed + 1` - fi - return $status -} - runcopy() { message="$1" shift testit "$message" $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL -W "$DOMAIN" -U "$USERNAME"%"$PASSWORD" \ - "$@" + "$@" || failed=`expr $failed + 1` } compare() { - testit "$1" cmp "$2" "$3" + testit "$1" cmp "$2" "$3" || failed=`expr $failed + 1` } sourcepath=tempfile.src.$$ diff --git a/testprogs/blackbox/test_gentest.sh b/testprogs/blackbox/test_gentest.sh index 89cc8c2795..ec6f0e422b 100755 --- a/testprogs/blackbox/test_gentest.sh +++ b/testprogs/blackbox/test_gentest.sh @@ -20,20 +20,7 @@ failed=0 samba4bindir=`dirname $0`/../../source/bin gentest=$samba4bindir/gentest -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 -} +. `dirname $0`/subunit.sh cat < st/gentest.ignore all_info.out.fname diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index 29582055ee..db4b65f327 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -25,21 +25,7 @@ samba4kinit=$samba4bindir/samba4kinit net=$samba4bindir/net enableaccount="$samba4bindir/smbpython `dirname $0`/../../source/setup/enableaccount" -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 -} - +. `dirname $0`/subunit.sh test_smbclient() { name="$1" diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index 4067a7fc43..8e1af99719 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -14,6 +14,8 @@ PREFIX=$3 shift 2 options="$*" +. `dirname $0`/subunit.sh + check() { name="$1" shift diff --git a/testprogs/blackbox/test_locktest.sh b/testprogs/blackbox/test_locktest.sh index c08b408107..88fa0ef892 100755 --- a/testprogs/blackbox/test_locktest.sh +++ b/testprogs/blackbox/test_locktest.sh @@ -21,20 +21,7 @@ failed=0 samba4bindir=`dirname $0`/../../source/bin locktest=$samba4bindir/locktest -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 -} +. `dirname $0`/subunit.sh testit "locktest" $VALGRIND $locktest //$SERVER/test1 //$SERVER/test2 --num-ops=100 -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` diff --git a/testprogs/blackbox/test_masktest.sh b/testprogs/blackbox/test_masktest.sh index ef429a1fb0..c1f765c1dd 100755 --- a/testprogs/blackbox/test_masktest.sh +++ b/testprogs/blackbox/test_masktest.sh @@ -21,20 +21,7 @@ failed=0 samba4bindir=`dirname $0`/../../source/bin masktest=$samba4bindir/masktest -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 -} +. `dirname $0`/subunit.sh testit "masktest" $VALGRIND $masktest //$SERVER/tmp --num-ops=200 --dieonerror -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` diff --git a/testprogs/blackbox/test_ndrdump.sh b/testprogs/blackbox/test_ndrdump.sh index 38c33ad3c1..089a7c3a2b 100755 --- a/testprogs/blackbox/test_ndrdump.sh +++ b/testprogs/blackbox/test_ndrdump.sh @@ -4,27 +4,14 @@ # Copyright (C) 2008 Andrew Bartlett # based on test_smbclient.sh +. `dirname $0`/subunit.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` diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh index 4df64cac94..d2c5c675e2 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/testprogs/blackbox/test_smbclient.sh @@ -21,20 +21,7 @@ failed=0 samba4bindir=`dirname $0`/../../source/bin smbclient=$samba4bindir/smbclient -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 -} +. `dirname $0`/subunit.sh runcmd() { name="$1" diff --git a/testprogs/blackbox/test_wbinfo.sh b/testprogs/blackbox/test_wbinfo.sh index b309b302dd..d993ed2ca7 100755 --- a/testprogs/blackbox/test_wbinfo.sh +++ b/testprogs/blackbox/test_wbinfo.sh @@ -17,20 +17,7 @@ failed=0 samba4bindir=`dirname $0`/../../source/bin wbinfo=$samba4bindir/wbinfo -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 -} +. `dirname $0`/subunit.sh testfail() { name="$1" -- cgit From 008c8adfe3c72b4820d22421ba3df8dc80053831 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 16 Apr 2008 16:10:16 +0200 Subject: Fix wbinfo --trusted-domains. The problems here were that we did not bind to the LSA pipe, and we did not consider it possible to have 0 trusted domains. Andrew Bartlett (This used to be commit 86694d429d62940882ac9b7af83b3e7d00e67c5a) --- testprogs/blackbox/test_wbinfo.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_wbinfo.sh b/testprogs/blackbox/test_wbinfo.sh index b309b302dd..1ece5a60f2 100755 --- a/testprogs/blackbox/test_wbinfo.sh +++ b/testprogs/blackbox/test_wbinfo.sh @@ -157,9 +157,8 @@ testfail "wbinfo -Y against $TARGET using invalid SID" $wbinfo -Y "S-1-22-1-3000 testit "wbinfo -t against $TARGET" $wbinfo -t || failed=`expr $failed + 1` -# this does not work -knownfail "wbinfo -m against $TARGET" $wbinfo -m || failed=`expr $failed + 1` -knownfail "wbinfo --all-domains against $TARGET" $wbinfo --all-domains || failed=`expr $failed + 1` +testit "wbinfo --trusted-domains against $TARGET" $wbinfo --trusted-domains || failed=`expr $failed + 1` +testit "wbinfo --all-domains against $TARGET" $wbinfo --all-domains || failed=`expr $failed + 1` testit "wbinfo --own-domain against $TARGET" $wbinfo --own-domain || failed=`expr $failed + 1` echo "test: wbinfo --own-domain against $TARGET check output" -- cgit From 19296758132dbc823911c4658df8fce183de2a86 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 May 2008 15:39:00 +0200 Subject: Fix reference to removed smbpython. (This used to be commit 58f956dc4591137489cba16f360f2d24d91dadc1) --- testprogs/blackbox/test_kinit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index db4b65f327..d3cece0af7 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -23,7 +23,7 @@ samba4bindir=`dirname $0`/../../source/bin smbclient=$samba4bindir/smbclient samba4kinit=$samba4bindir/samba4kinit net=$samba4bindir/net -enableaccount="$samba4bindir/smbpython `dirname $0`/../../source/setup/enableaccount" +enableaccount="$PYTHON `dirname $0`/../../source/setup/enableaccount" . `dirname $0`/subunit.sh -- cgit From fe17acfa82079559f8c8b30ab32564418a3cc87e Mon Sep 17 00:00:00 2001 From: Andrew Kroeger Date: Wed, 21 May 2008 02:07:45 -0500 Subject: subunit.sh: Properly capture and pass on the command output. Previously, the output from $cmdline was never captured. In case of a failure, there was no output being passed to the subunit_fail_test() function, but that function contains a call to "cat -". This caused the script to hang indefinitely waiting for input. We now capture $cmdline output (including mapping stderr to stdout) using backticks, and then pipe that output to the subunit_fail_test() if there is a failure. (This used to be commit c0234d13192c1871971b45121249395ef15c5ae5) --- testprogs/blackbox/subunit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/subunit.sh b/testprogs/blackbox/subunit.sh index 7a6b21e540..100dfd1a46 100755 --- a/testprogs/blackbox/subunit.sh +++ b/testprogs/blackbox/subunit.sh @@ -56,12 +56,12 @@ testit () { shift cmdline="$*" subunit_start_test "$name" - $cmdline + output=`$cmdline 2>&1` status=$? if [ x$status = x0 ]; then subunit_pass_test "$name" else - subunit_fail_test "$name" + echo $output | subunit_fail_test "$name" fi return $status } -- cgit From 0410dcb32d772ee5022bd3bb507a5650ef6c5071 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 12 Jun 2008 07:02:14 -0400 Subject: Initial automated wintest. Added a blackbox test which looks for $WINTEST_CONF_DIR, gets configuration vars from *.conf in that dir, disables smbwrapper, and runs RAW-OPEN torture test. Scripts are coming to startup/shutdown vm's. (This used to be commit 74a0a9bb54b2583dde7a5fbadd4d10858de12ee7) --- testprogs/blackbox/test_wintest.sh | 45 +++++++++++++++++++++++++++++++++ testprogs/blackbox/wintest/wintest.conf | 7 +++++ 2 files changed, 52 insertions(+) create mode 100755 testprogs/blackbox/test_wintest.sh create mode 100644 testprogs/blackbox/wintest/wintest.conf (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_wintest.sh b/testprogs/blackbox/test_wintest.sh new file mode 100755 index 0000000000..8bbe4f2984 --- /dev/null +++ b/testprogs/blackbox/test_wintest.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# Blackbox tests for testing against windows machines +# Copyright (C) 2008 Jim McDonough + + +testwithconf() { +# define test variables, startup/shutdown scripts +. $1 +shift 1 + +if [ -n "$WINTEST_STARTUP" ]; then +. $WINTEST_STARTUP; +fi + +testit "smbtorture" $smbtorture //$SERVER/$SHARE RAW-OPEN -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` + +if [ -n "$WINTEST_SHUTDOWN" ]; then +. $WINTEST_SHUTDOWN; +fi +} + + +# main +# skip without WINTEST_CONF_DIR +if [ -z "$WINTEST_CONF_DIR" ]; then +exit 0; +fi + +SOCKET_WRAPPER_DIR= +export -n SOCKET_WRAPPER_DIR + +failed=0 + +$basedir=`pwd` + +samba4bindir=`dirname $0`/../../source/bin +smbtorture=$samba4bindir/smbtorture + +. `dirname $0`/subunit.sh + +for wintest_conf in $WINTEST_CONF_DIR/*.conf; do +testwithconf "$wintest_conf" $@; +done + +exit $failed diff --git a/testprogs/blackbox/wintest/wintest.conf b/testprogs/blackbox/wintest/wintest.conf new file mode 100644 index 0000000000..d52e660318 --- /dev/null +++ b/testprogs/blackbox/wintest/wintest.conf @@ -0,0 +1,7 @@ +#export WINTEST_STARTUP=/tmp/blah +#export WINTEST_SHUTDOWN=/tmp/blah2 +export DOMAIN="wait" +export USERNAME="administrator" +export PASSWORD="samba" +export SERVER="192.168.213.161" +export SHARE="c\$" \ No newline at end of file -- cgit From f3fb381952e6afd4b3d15758eaf3aaf29a112eec Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 12 Jun 2008 07:06:07 -0400 Subject: Missed these on the last commit (This used to be commit 0e8f946ed02a6d2d9469f9ccab5f3342b2b80725) --- testprogs/blackbox/wintest/wintest.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/wintest/wintest.conf b/testprogs/blackbox/wintest/wintest.conf index d52e660318..d1403662f9 100644 --- a/testprogs/blackbox/wintest/wintest.conf +++ b/testprogs/blackbox/wintest/wintest.conf @@ -1,6 +1,6 @@ -#export WINTEST_STARTUP=/tmp/blah -#export WINTEST_SHUTDOWN=/tmp/blah2 -export DOMAIN="wait" +#export WINTEST_STARTUP="/tmp/startup client" +#export WINTEST_SHUTDOWN=/tmp/shutdown client" +export DOMAIN="client" export USERNAME="administrator" export PASSWORD="samba" export SERVER="192.168.213.161" -- cgit From 26e9194e3a3ff9b065fec43ad5f3b63187eb533b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 26 Jun 2008 10:56:59 +0200 Subject: Move blackbox tests closer to what they're testing. (This used to be commit c9b2e2aa861ccc01e5d92cfe468be1f6324ed294) --- testprogs/blackbox/test_cifsdd.sh | 73 -------------- testprogs/blackbox/test_smbclient.sh | 166 ------------------------------- testprogs/blackbox/test_wbinfo.sh | 187 ----------------------------------- 3 files changed, 426 deletions(-) delete mode 100755 testprogs/blackbox/test_cifsdd.sh delete mode 100755 testprogs/blackbox/test_smbclient.sh delete mode 100755 testprogs/blackbox/test_wbinfo.sh (limited to 'testprogs/blackbox') diff --git a/testprogs/blackbox/test_cifsdd.sh b/testprogs/blackbox/test_cifsdd.sh deleted file mode 100755 index 43564a0c77..0000000000 --- a/testprogs/blackbox/test_cifsdd.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -# Basic script to make sure that cifsdd can do both local and remote I/O. - -if [ $# -lt 4 ]; then -cat < /dev/null - -ls -l $sourcepath - -for bs in 512 4k 48k ; do - -echo "Testing $bs block size ..." - -# Check whether we can do local IO -runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs -compare "Checking local differences" $sourcepath $destpath - -# Check whether we can do a round trip -runcopy "Testing local -> remote copy" \ - if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs -runcopy "Testing remote -> local copy" \ - if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs -compare "Checking differences" $sourcepath $destpath - -# Check that copying within the remote server works -runcopy "Testing local -> remote copy" \ - if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs -runcopy "Testing remote -> remote copy" \ - if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs -runcopy "Testing remote -> local copy" \ - if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs -compare "Checking differences" $sourcepath $destpath - -done - -rm -f $sourcepath $destpath - -exit $failed diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh deleted file mode 100755 index d2c5c675e2..0000000000 --- a/testprogs/blackbox/test_smbclient.sh +++ /dev/null @@ -1,166 +0,0 @@ -#!/bin/sh -# Blackbox tests for smbclient -# Copyright (C) 2006-2007 Jelmer Vernooij -# Copyright (C) 2006-2007 Andrew Bartlett - -if [ $# -lt 5 ]; then -cat <tmpfile< tmpauthfile - -testit "Test login with --authentication-file" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --authentication-file=tmpauthfile || failed=`expr $failed + 1` - -PASSWD_FILE="tmppassfile" -echo "$PASSWORD" > $PASSWD_FILE -export PASSWD_FILE -testit "Test login with PASSWD_FILE" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` -PASSWD_FILE="" -export PASSWD_FILE -unset PASSWD_FILE - -PASSWD="$PASSWORD" -export PASSWD -testit "Test login with PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` - -oldUSER=$USER -USER="$USERNAME" -export USER -testit "Test login with USER and PASSWD" $VALGRIND $smbclient -k no -c 'ls' $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 diff --git a/testprogs/blackbox/test_wbinfo.sh b/testprogs/blackbox/test_wbinfo.sh deleted file mode 100755 index ec8b9ebd44..0000000000 --- a/testprogs/blackbox/test_wbinfo.sh +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/sh -# Blackbox test for wbinfo -if [ $# -lt 4 ]; then -cat <