From 1954e50f266256c9e153c9613f49f9d9f5dbf67b Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 6 Jan 2022 16:42:33 +1300 Subject: s4:torture: Adapt KDC canon test to Heimdal upstream changes NOTE: This commit finally works again! Signed-off-by: Joseph Sutton Reviewed-by: Stefan Metzmacher --- source4/torture/krb5/kdc-canon-heimdal.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source4/torture/krb5/kdc-canon-heimdal.c b/source4/torture/krb5/kdc-canon-heimdal.c index 1c9cedafbbc..f4e447399b5 100644 --- a/source4/torture/krb5/kdc-canon-heimdal.c +++ b/source4/torture/krb5/kdc-canon-heimdal.c @@ -747,14 +747,18 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void * server_creds), 0, "krb5_free_cred_contents failed"); + torture_assert_int_equal(tctx, + test_context->packet_count, + 1, "Expected krb5_get_creds to send one packet"); + } else { torture_assert_int_equal(tctx, k5ret, KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN, assertion_message); + /* Account for get_cred_kdc_capath() and get_cred_kdc_referral() fallback */ + torture_assert_int_equal(tctx, + test_context->packet_count, + 2, "Expected krb5_get_creds to send 2 packets"); } - - torture_assert_int_equal(tctx, - test_context->packet_count, - 1, "Expected krb5_get_creds to send packets"); } /* @@ -816,7 +820,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void * torture_assert(tctx, test_accept_ticket(tctx, samba_cmdline_get_creds(), - spn, + expected_principal_string, client_to_server), "test_accept_ticket failed - failed to accept the ticket we just created"); } else if (test_data->canonicalize == true @@ -828,7 +832,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void * torture_assert(tctx, test_accept_ticket(tctx, samba_cmdline_get_creds(), - principal_string, + expected_principal_string, client_to_server), "test_accept_ticket failed - failed to accept the ticket we just created"); } else if (test_data->canonicalize == false -- cgit v1.2.1