summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-04-15 09:13:32 +0200
committerAndrew Bartlett <abartlet@samba.org>2008-04-15 09:13:32 +0200
commitafaba23131dc079be3cd92e87495ec8b2ebdc4ae (patch)
tree59acb9eb5f25caf0e264450bfcbf8853385fead8 /testprogs
parent223df634c888092cd2528aca6fcdf78a4de0246f (diff)
downloadsamba-afaba23131dc079be3cd92e87495ec8b2ebdc4ae.tar.gz
Add blackbox test for ndrdump, to ensure it at least does not
segfault. Andrew Bartlett (This used to be commit d2fe61a13a8368ceae30c6e7320c8d3d62fbc485)
Diffstat (limited to 'testprogs')
-rw-r--r--testprogs/blackbox/ndrdump/samr-CreateUser-in.datbin0 -> 60 bytes
-rw-r--r--testprogs/blackbox/ndrdump/samr-CreateUser-out.datbin0 -> 32 bytes
-rw-r--r--testprogs/blackbox/test_ndrdump.sh33
3 files changed, 33 insertions, 0 deletions
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
--- /dev/null
+++ b/testprogs/blackbox/ndrdump/samr-CreateUser-in.dat
Binary files 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
--- /dev/null
+++ b/testprogs/blackbox/ndrdump/samr-CreateUser-out.dat
Binary files 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