diff options
author | Andreas Schneider <asn@samba.org> | 2016-09-06 08:56:47 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-09-11 02:58:22 +0200 |
commit | 4899ece472847a6e207098e4472d0e2515081fe0 (patch) | |
tree | dd98161c3689305ded9b0b03de121a2aec9cd598 /testprogs | |
parent | b3e324aad53a6b4adf0ece58c1b8bd9eed2cd48c (diff) | |
download | samba-4899ece472847a6e207098e4472d0e2515081fe0.tar.gz |
testprogs: Add a common test_smbclient_expect_failure() function
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'testprogs')
-rwxr-xr-x | testprogs/blackbox/common_test_fns.inc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testprogs/blackbox/common_test_fns.inc b/testprogs/blackbox/common_test_fns.inc index ef21834baaa..aff1aa9dc79 100755 --- a/testprogs/blackbox/common_test_fns.inc +++ b/testprogs/blackbox/common_test_fns.inc @@ -18,3 +18,21 @@ test_smbclient() { fi return $status } + +test_smbclient_expect_failure() { + name="$1" + cmd="$2" + unc="$3" + shift + shift + shift + echo "test: $name" + $VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@ + status=$? + if [ x$status = x0 ]; then + echo "failure: $name" + else + echo "success: $name" + fi + return $status +} |