Fix executable bit on blackbox ndrdump tests.
[nivanova/samba-autobuild/.git] / testprogs / blackbox / test_ndrdump.sh
1 #!/bin/sh
2 # Blackbox tests for masktest
3 # Copyright (C) 2008 Andrew Tridgell
4 # Copyright (C) 2008 Andrew Bartlett
5 # based on test_smbclient.sh
6
7 failed=0
8
9 samba4bindir=`dirname $0`/../../source/bin
10 ndrdump=$samba4bindir/ndrdump
11 files=`dirname $0`/ndrdump
12
13 testit() {
14         name="$1"
15         shift
16         cmdline="$*"
17         echo "test: $name"
18         $cmdline
19         status=$?
20         if [ x$status = x0 ]; then
21                 echo "success: $name"
22         else
23                 echo "failure: $name"
24         fi
25         return $status
26 }
27
28 testit "ndrdump with in" $VALGRIND $ndrdump samr samr_CreateUser in $files/samr-CreateUser-in.dat $@ || failed=`expr $failed + 1`
29 testit "ndrdump with out" $VALGRIND $ndrdump samr samr_CreateUser out $files/samr-CreateUser-out.dat $@ || failed=`expr $failed + 1`
30 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`
31 testit "ndrdump with validate" $VALGRIND $ndrdump --validate samr samr_CreateUser in $files/samr-CreateUser-in.dat $@ || failed=`expr $failed + 1`
32
33 exit $failed