diff options
author | Stefan Metzmacher <metze@samba.org> | 2018-11-21 11:49:40 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-01-12 03:13:40 +0100 |
commit | d47f9af7cbb09ed015abcfc6ea7d19ec443bdcf2 (patch) | |
tree | d419c33e818e0917c82a4926b66c1aadbc81dead /python | |
parent | 6f53c9937233f18c0c18a6680d455157b8025bec (diff) | |
download | samba-d47f9af7cbb09ed015abcfc6ea7d19ec443bdcf2.tar.gz |
py:dcerpc/raw_testcase: add pfc_flags_2nd and use_auth3 options to do_generic_bind()
This makes it more flexible and allows to write complex tests in an
easier fashion.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/tests/dcerpc/raw_testcase.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/python/samba/tests/dcerpc/raw_testcase.py b/python/samba/tests/dcerpc/raw_testcase.py index fc1c86a1283..555ea8d607d 100644 --- a/python/samba/tests/dcerpc/raw_testcase.py +++ b/python/samba/tests/dcerpc/raw_testcase.py @@ -282,7 +282,10 @@ class RawDCERPCTest(TestCase): samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST, assoc_group_id=0, call_id=0, nak_reason=None, alter_fault=None, - start_with_alter=False): + start_with_alter=False, + pfc_flags_2nd=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST | + samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST, + use_auth3=False): ctx_list = [ctx] if auth_context is not None: @@ -392,14 +395,25 @@ class RawDCERPCTest(TestCase): if auth_context['hdr_signing']: auth_context["gensec"].want_feature(gensec.FEATURE_SIGN_PKT_HEADER) else: + self.assertFalse(use_auth3) self.assertFalse(finished) auth_info = self.generate_auth(auth_type=auth_context["auth_type"], auth_level=auth_context["auth_level"], auth_context_id=auth_context["auth_context_id"], auth_blob=to_server) + if use_auth3: + req = self.generate_auth3(call_id=call_id, + pfc_flags=pfc_flags_2nd, + auth_info=auth_info) + self.send_pdu(req) + rep = self.recv_pdu(timeout=0.01) + self.assertIsNone(rep) + self.assertIsConnected() + return ack req = self.generate_alter(call_id=call_id, ctx_list=ctx_list, + pfc_flags=pfc_flags_2nd, assoc_group_id=0xffffffff - assoc_group_id, auth_info=auth_info) self.send_pdu(req) @@ -417,7 +431,8 @@ class RawDCERPCTest(TestCase): self.assertEquals(rep.u.reserved, 0) self.assertEquals(len(rep.u.error_and_verifier), 0) return None - self.verify_pdu(rep, samba.dcerpc.dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id) + self.verify_pdu(rep, samba.dcerpc.dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id, + pfc_flags=req.pfc_flags) self.assertEquals(rep.u.max_xmit_frag, req.u.max_xmit_frag) self.assertEquals(rep.u.max_recv_frag, req.u.max_recv_frag) self.assertEquals(rep.u.assoc_group_id, assoc_group_id) |