From 4899ece472847a6e207098e4472d0e2515081fe0 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 6 Sep 2016 08:56:47 +0200 Subject: [PATCH] testprogs: Add a common test_smbclient_expect_failure() function Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- testprogs/blackbox/common_test_fns.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 +} -- 2.34.1