From: Stefan Metzmacher Date: Mon, 27 Jan 2020 15:45:44 +0000 (+0100) Subject: s4:torture: make rpc.handles.random-assoc test even more robust X-Git-Tag: ldb-2.1.1~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b80145a2c0686cd6b95df89236edeb61192d917;p=thirdparty%2Fsamba.git s4:torture: make rpc.handles.random-assoc test even more robust This improves commit bebee47e6386476e9948089484f89d213fcc2660 a bit further. I just got this: connect samr pipe1 use assoc_group_id[0x00000001] for new connections connect lsa pipe2 got assoc_group_id[0x00000001] for p2 samr_Connect to open a policy handle on samr p1 use policy handle on lsa p2 - should fail closing policy handle on samr p1 connect samr pipe3 - should fail Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ac for ncacn_np:localdc[\pipe\samr,validate,assoc_group_id=0x00000001,abstract_syntax=12345778-1234-abcd-ef00-0123456789ac/0x00000001] NT_STATUS_UNSUCCESSFUL connect lsa pipe4 - should fail Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ab for ncacn_np:localdc[\pipe\lsarpc,validate,assoc_group_id=0x00000001,abstract_syntax=12345778-1234-abcd-ef00-0123456789ab/0x00000000] NT_STATUS_UNSUCCESSFUL connect samr pipe5 with assoc_group_id[0xFFFFFFFF]- should fail Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ac for ncacn_np:localdc[\pipe\samr,validate,assoc_group_id=0xffffffff,abstract_syntax=12345778-1234-abcd-ef00-0123456789ac/0x00000001] NT_STATUS_UNSUCCESSFUL connect lsa pipe6 with assoc_group_id[0x00000000]- should fail UNEXPECTED(failure): samba4.rpc.handles on ncacn_np with validate.mixed-shared(ad_dc_ntvfs) REASON: Exception: Exception: ../../source4/torture/rpc/handles.c:500: status was NT_STATUS_OK, expected NT_STATUS_UNSUCCESSFUL: opening lsa pipe6 FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites) A summary with detailed information can be found in: Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source4/torture/rpc/handles.c b/source4/torture/rpc/handles.c index ae6a55eb965..7c108e56e1a 100644 --- a/source4/torture/rpc/handles.c +++ b/source4/torture/rpc/handles.c @@ -529,7 +529,7 @@ static bool test_handles_random_assoc(struct torture_context *torture) * And make sure it doesn't wrap. */ assoc_group_id = dcerpc_binding_get_assoc_group_id(p1->binding); - assoc_group_id = MIN(~assoc_group_id, UINT32_MAX - 3); + assoc_group_id = ~MIN(assoc_group_id, UINT32_MAX - 3); torture_comment(torture, "connect samr pipe2 with assoc_group_id[0x%08X]- should fail\n", ++assoc_group_id); status = torture_rpc_connection_transport(torture, &p2, &ndr_table_samr,