summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-09-16 18:16:49 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-16 18:16:49 +0200
commitaa09d8a75f04dd2680aa7c0f06e47b6f5a36fa56 (patch)
treee1d7d5dbac05fce826622d4ffbe60afe1115b5f1 /source4
parentc2eb4e5f8e0275003f9cffe1feeee6e34b7e578e (diff)
downloadsamba-aa09d8a75f04dd2680aa7c0f06e47b6f5a36fa56.tar.gz
samba-aa09d8a75f04dd2680aa7c0f06e47b6f5a36fa56.tar.bz2
samba-aa09d8a75f04dd2680aa7c0f06e47b6f5a36fa56.zip
Move ndrdump tests closer to the code they test.
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/tests/samr-CreateUser-in.datbin0 -> 60 bytes
-rw-r--r--source4/librpc/tests/samr-CreateUser-out.datbin0 -> 32 bytes
-rwxr-xr-xsource4/librpc/tests/test_ndrdump.sh20
-rwxr-xr-xsource4/selftest/samba4_tests.sh2
4 files changed, 21 insertions, 1 deletions
diff --git a/source4/librpc/tests/samr-CreateUser-in.dat b/source4/librpc/tests/samr-CreateUser-in.dat
new file mode 100644
index 0000000000..a5840e1f7f
--- /dev/null
+++ b/source4/librpc/tests/samr-CreateUser-in.dat
Binary files differ
diff --git a/source4/librpc/tests/samr-CreateUser-out.dat b/source4/librpc/tests/samr-CreateUser-out.dat
new file mode 100644
index 0000000000..cf9131dba9
--- /dev/null
+++ b/source4/librpc/tests/samr-CreateUser-out.dat
Binary files differ
diff --git a/source4/librpc/tests/test_ndrdump.sh b/source4/librpc/tests/test_ndrdump.sh
new file mode 100755
index 0000000000..50fd76ba92
--- /dev/null
+++ b/source4/librpc/tests/test_ndrdump.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Blackbox tests for masktest
+# Copyright (C) 2008 Andrew Tridgell
+# Copyright (C) 2008 Andrew Bartlett
+# based on test_smbclient.sh
+
+. `dirname $0`/subunit.sh
+
+failed=0
+
+samba4bindir=`dirname $0`/../../source4/bin
+ndrdump=$samba4bindir/ndrdump
+files=`dirname $0`/ndrdump
+
+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/source4/selftest/samba4_tests.sh b/source4/selftest/samba4_tests.sh
index 6f6ffbba60..3c292d3855 100755
--- a/source4/selftest/samba4_tests.sh
+++ b/source4/selftest/samba4_tests.sh
@@ -267,7 +267,7 @@ fi
bbdir=$incdir/../../testprogs/blackbox
-plantest "blackbox.ndrdump" dc $bbdir/test_ndrdump.sh
+plantest "blackbox.ndrdump" dc $samba4srcdir/librpc/tests/test_ndrdump.sh
plantest "blackbox.net" dc $samba4srcdir/utils/tests/test_net.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN"
plantest "blackbox.kinit" dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" $CONFIGURATION
plantest "blackbox.cifsdd" dc $samba4srcdir/client/tests/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN"