testprogs/blackbox: use subunit_ helper functions in test_smbclient_*
authorStefan Metzmacher <metze@samba.org>
Wed, 29 Mar 2017 09:53:18 +0000 (11:53 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 9 Apr 2017 23:11:19 +0000 (01:11 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12709

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
testprogs/blackbox/common_test_fns.inc

index aff1aa9..7e54c67 100755 (executable)
@@ -8,13 +8,13 @@ test_smbclient() {
        shift
        shift
        shift
-       echo "test: $name"
-       $VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@
+       subunit_start_test "$name"
+       output=`$VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@ 2>&1`
        status=$?
        if [ x$status = x0 ]; then
-               echo "success: $name"
+               subunit_pass_test "$name"
        else
-               echo "failure: $name"
+               echo "$output" | subunit_fail_test "$name"
        fi
        return $status
 }
@@ -26,13 +26,13 @@ test_smbclient_expect_failure() {
        shift
        shift
        shift
-       echo "test: $name"
-       $VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@
+       subunit_start_test "$name"
+       output=`$VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@ 2>&1`
        status=$?
        if [ x$status = x0 ]; then
-               echo "failure: $name"
+               echo "$output" | subunit_fail_test "$name"
        else
-               echo "success: $name"
+               subunit_pass_test "$name"
        fi
        return $status
 }