summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2023-04-11 14:23:00 +1200
committerAndreas Schneider <asn@cryptomilk.org>2023-04-12 13:52:32 +0000
commitb62b0bd64bd8b49b6244949c0149348590119b35 (patch)
treedeb4181e4b9e3aac0b820b8f794f1cee46f01b86
parent60c501b387d479fa9c653151dee4b2feebcb04ac (diff)
downloadsamba-b62b0bd64bd8b49b6244949c0149348590119b35.tar.gz
testprogs: Make test_smbclient_expect_failure() return 0 on success
This is the behaviour that most existing callers expect, but the function actually returns a non-zero status code in that case. 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.inc3
-rwxr-xr-xtestprogs/blackbox/test_password_settings.sh2
-rwxr-xr-xtestprogs/blackbox/test_trust_ntlm.sh10
3 files changed, 8 insertions, 7 deletions
diff --git a/testprogs/blackbox/common_test_fns.inc b/testprogs/blackbox/common_test_fns.inc
index 5984a0c91a2..4f5a861754e 100755
--- a/testprogs/blackbox/common_test_fns.inc
+++ b/testprogs/blackbox/common_test_fns.inc
@@ -33,10 +33,11 @@ test_smbclient_expect_failure()
status=$?
if [ x$status = x0 ]; then
printf '%s' "$output" | subunit_fail_test "$name"
+ return 1
else
subunit_pass_test "$name"
+ return 0
fi
- return $status
}
test_rpcclient_grep()
diff --git a/testprogs/blackbox/test_password_settings.sh b/testprogs/blackbox/test_password_settings.sh
index 9e7ea29cf62..b3b23f6843d 100755
--- a/testprogs/blackbox/test_password_settings.sh
+++ b/testprogs/blackbox/test_password_settings.sh
@@ -171,7 +171,7 @@ TEST_PASSWORD=$TEST_PASSWORD_NEW
TEST_PASSWORD_NEW="testPaSS@04%"
test_smbclient_expect_failure "Test login with user (NT_STATUS_PASSWORD_MUST_CHANGE)" \
- "ls" "$SMB_UNC" --use-kerberos=disabled -U$TEST_PRINCIPAL%$TEST_PASSWORD && failed=$(expr $failed + 1)
+ "ls" "$SMB_UNC" --use-kerberos=disabled -U$TEST_PRINCIPAL%$TEST_PASSWORD || failed=$(expr $failed + 1)
testit "change user password with 'samba-tool user password' (after must change flag set)" \
$VALGRIND $PYTHON $samba_tool user password "${CONFIGURATION}" -W$DOMAIN -U$DOMAIN/$TEST_USERNAME%$TEST_PASSWORD -k no --newpassword=$TEST_PASSWORD_NEW || failed=$(expr $failed + 1)
diff --git a/testprogs/blackbox/test_trust_ntlm.sh b/testprogs/blackbox/test_trust_ntlm.sh
index 5fde96b9da1..ae84aebd85b 100755
--- a/testprogs/blackbox/test_trust_ntlm.sh
+++ b/testprogs/blackbox/test_trust_ntlm.sh
@@ -72,7 +72,7 @@ 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_smbclient_expect_failure "Fail03 smbclient with $CREDS" 'ls' "$unc" -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`
else
@@ -90,7 +90,7 @@ 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_smbclient_expect_failure "Fail04 smbclient with $CREDS" 'ls' "$unc" -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`
else
@@ -121,7 +121,7 @@ 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_smbclient_expect_failure "Fail06 smbclient with $CREDS" 'ls' "$unc" -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)
DNAME="$TRUST_DOMAIN"
@@ -161,7 +161,7 @@ if [ x"$TRUST_REALM" = x"$TRUST_DOMAIN" ]; then
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_smbclient_expect_failure "Fail09 smbclient with $CREDS" 'ls' "$unc" -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`
else
@@ -180,7 +180,7 @@ if [ x"$TRUST_REALM" = x"$TRUST_DOMAIN" ]; then
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_smbclient_expect_failure "Fail10 smbclient with $CREDS" 'ls' "$unc" -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`
else