summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2023-04-11 14:26:56 +1200
committerAndreas Schneider <asn@cryptomilk.org>2023-04-12 13:52:32 +0000
commit23d2c9cb72d3aa4593edae40fc6b998c96242dd6 (patch)
tree1d7bfe158048306ad8c74bdf044371d082f0b451
parentdfb088aaed5799ada4e78b8862b5f4f7f7b1de06 (diff)
downloadsamba-23d2c9cb72d3aa4593edae40fc6b998c96242dd6.tar.gz
testprogs: Make test_rpcclient_expect_failure_grep() return 0 on success
This is more consistent with the behaviour of the other expect_failure functions. Adjust all callers expecting the opposite behaviour to match. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
-rwxr-xr-xtestprogs/blackbox/common_test_fns.inc4
-rwxr-xr-xtestprogs/blackbox/test_trust_ntlm.sh10
2 files changed, 7 insertions, 7 deletions
diff --git a/testprogs/blackbox/common_test_fns.inc b/testprogs/blackbox/common_test_fns.inc
index ca7ed25b4a2..df8fee0e032 100755
--- a/testprogs/blackbox/common_test_fns.inc
+++ b/testprogs/blackbox/common_test_fns.inc
@@ -82,7 +82,7 @@ test_rpcclient_expect_failure_grep()
status=$?
if [ x$status = x0 ]; then
printf '%s' "$output" | subunit_fail_test "$name"
- return $status
+ return 1
fi
printf '%s' "$output" | grep -q "$grep"
gstatus=$?
@@ -91,7 +91,7 @@ test_rpcclient_expect_failure_grep()
else
printf '%s' "$output" | subunit_fail_test "$name"
fi
- return $status
+ return $gstatus
}
kerberos_kinit()
diff --git a/testprogs/blackbox/test_trust_ntlm.sh b/testprogs/blackbox/test_trust_ntlm.sh
index ae84aebd85b..0220c82b38c 100755
--- a/testprogs/blackbox/test_trust_ntlm.sh
+++ b/testprogs/blackbox/test_trust_ntlm.sh
@@ -71,7 +71,7 @@ WBCREDS="$USERNAME@$DOMAIN%$PASSWORD"
if [ x"$TYPE" = x"member" ]; then
EXPFAIL="NT_STATUS_LOGON_FAILURE"
# rpcclient doesn't handle -Uuser@domain yet
- #test_rpcclient_expect_failure_grep "Fail03 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS && failed=`expr $failed + 1`
+ #test_rpcclient_expect_failure_grep "Fail03 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS || failed=`expr $failed + 1`
test_smbclient_expect_failure "Fail03 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
# winbindd doesn't handle user@domain yet
#testit_expect_failure "Fail03 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1`
@@ -89,7 +89,7 @@ WBCREDS="$USERNAME@$REALM%$PASSWORD"
if [ x"$TYPE" = x"member" ]; then
EXPFAIL="NT_STATUS_LOGON_FAILURE"
# rpcclient doesn't handle -Uuser@domain yet
- #test_rpcclient_expect_failure_grep "Fail04 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS && failed=`expr $failed + 1`
+ #test_rpcclient_expect_failure_grep "Fail04 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS || failed=`expr $failed + 1`
test_smbclient_expect_failure "Fail04 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
# winbindd doesn't handle user@domain yet
#testit_expect_failure "Fail04 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1`
@@ -120,7 +120,7 @@ test_rpcclient_expect_failure_grep "Test05 rpcclient lookupnames with $DNAME" "l
CREDS="$TRUST_DOMAIN\\$USERNAME%$PASSWORD"
WBCREDS="$TRUST_DOMAIN/$USERNAME%$PASSWORD"
EXPFAIL="$TRUST_ERROR"
-test_rpcclient_expect_failure_grep "Fail06 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS && failed=$(expr $failed + 1)
+test_rpcclient_expect_failure_grep "Fail06 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS || failed=$(expr $failed + 1)
test_smbclient_expect_failure "Fail06 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
testit_expect_failure "Fail06 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=$(expr $failed + 1)
@@ -160,7 +160,7 @@ if [ x"$TRUST_REALM" = x"$TRUST_DOMAIN" ]; then
# NT4 domain
EXPFAIL="NT_STATUS_LOGON_FAILURE"
# rpcclient doesn't handle -Uuser@domain yet
- #test_rpcclient_expect_failure_grep "Fail09 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS && failed=`expr $failed + 1`
+ #test_rpcclient_expect_failure_grep "Fail09 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS || failed=`expr $failed + 1`
test_smbclient_expect_failure "Fail09 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
# winbindd doesn't handle user@domain yet
#testit_expect_failure "Fail09 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1`
@@ -179,7 +179,7 @@ if [ x"$TRUST_REALM" = x"$TRUST_DOMAIN" ]; then
# NT4 domain
EXPFAIL="NT_STATUS_LOGON_FAILURE"
# rpcclient doesn't handle -Uuser@domain yet
- #test_rpcclient_expect_failure_grep "Fail10 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS && failed=`expr $failed + 1`
+ #test_rpcclient_expect_failure_grep "Fail10 rpcclient getusername with $CREDS" getusername "$SERVER" "$EXPFAIL" -U$CREDS || failed=`expr $failed + 1`
test_smbclient_expect_failure "Fail10 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
# winbindd doesn't handle user@domain yet
#testit_expect_failure "Fail10 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1`