1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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>
This commit is contained in:
Joseph Sutton 2023-04-11 14:26:56 +12:00 committed by Andreas Schneider
parent dfb088aaed
commit 23d2c9cb72
2 changed files with 7 additions and 7 deletions

View File

@ -82,7 +82,7 @@ test_rpcclient_expect_failure_grep()
status=$? status=$?
if [ x$status = x0 ]; then if [ x$status = x0 ]; then
printf '%s' "$output" | subunit_fail_test "$name" printf '%s' "$output" | subunit_fail_test "$name"
return $status return 1
fi fi
printf '%s' "$output" | grep -q "$grep" printf '%s' "$output" | grep -q "$grep"
gstatus=$? gstatus=$?
@ -91,7 +91,7 @@ test_rpcclient_expect_failure_grep()
else else
printf '%s' "$output" | subunit_fail_test "$name" printf '%s' "$output" | subunit_fail_test "$name"
fi fi
return $status return $gstatus
} }
kerberos_kinit() kerberos_kinit()

View File

@ -71,7 +71,7 @@ WBCREDS="$USERNAME@$DOMAIN%$PASSWORD"
if [ x"$TYPE" = x"member" ]; then if [ x"$TYPE" = x"member" ]; then
EXPFAIL="NT_STATUS_LOGON_FAILURE" EXPFAIL="NT_STATUS_LOGON_FAILURE"
# rpcclient doesn't handle -Uuser@domain yet # 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) test_smbclient_expect_failure "Fail03 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
# winbindd doesn't handle user@domain yet # winbindd doesn't handle user@domain yet
#testit_expect_failure "Fail03 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1` #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 if [ x"$TYPE" = x"member" ]; then
EXPFAIL="NT_STATUS_LOGON_FAILURE" EXPFAIL="NT_STATUS_LOGON_FAILURE"
# rpcclient doesn't handle -Uuser@domain yet # 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) test_smbclient_expect_failure "Fail04 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
# winbindd doesn't handle user@domain yet # winbindd doesn't handle user@domain yet
#testit_expect_failure "Fail04 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1` #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" CREDS="$TRUST_DOMAIN\\$USERNAME%$PASSWORD"
WBCREDS="$TRUST_DOMAIN/$USERNAME%$PASSWORD" WBCREDS="$TRUST_DOMAIN/$USERNAME%$PASSWORD"
EXPFAIL="$TRUST_ERROR" 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) 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) 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 # NT4 domain
EXPFAIL="NT_STATUS_LOGON_FAILURE" EXPFAIL="NT_STATUS_LOGON_FAILURE"
# rpcclient doesn't handle -Uuser@domain yet # 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) test_smbclient_expect_failure "Fail09 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
# winbindd doesn't handle user@domain yet # winbindd doesn't handle user@domain yet
#testit_expect_failure "Fail09 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1` #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 # NT4 domain
EXPFAIL="NT_STATUS_LOGON_FAILURE" EXPFAIL="NT_STATUS_LOGON_FAILURE"
# rpcclient doesn't handle -Uuser@domain yet # 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) test_smbclient_expect_failure "Fail10 smbclient with $CREDS" 'ls' "$unc" -U$CREDS || failed=$(expr $failed + 1)
# winbindd doesn't handle user@domain yet # winbindd doesn't handle user@domain yet
#testit_expect_failure "Fail10 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1` #testit_expect_failure "Fail10 wbinfo -a with $WBCREDS" $VALGRIND $wbinfo -a $WBCREDS || failed=`expr $failed + 1`