testprogs: Add a common test_smbclient_expect_failure() function
authorAndreas Schneider <asn@samba.org>
Tue, 6 Sep 2016 06:56:47 +0000 (08:56 +0200)
committerJeremy Allison <jra@samba.org>
Sun, 11 Sep 2016 00:58:22 +0000 (02:58 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
testprogs/blackbox/common_test_fns.inc

index ef21834baaa0d958d1de5383f0bfaf6155158610..aff1aa9dc79e26a3c6c499b93d46510af97a7e21 100755 (executable)
@@ -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
+}