py:dcerpc/raw_testcase: maintain self.max_{xmit,recv}_frag
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Nov 2018 17:21:03 +0000 (18:21 +0100)
committerJeremy Allison <jra@samba.org>
Sun, 23 Dec 2018 17:15:22 +0000 (18:15 +0100)
This was it's easier to alter once add support for SMB connections.

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>
python/samba/tests/dcerpc/raw_testcase.py

index ea3565f..39da945 100644 (file)
@@ -58,6 +58,8 @@ class RawDCERPCTest(TestCase):
             raise
         finally:
             pass
+        self.max_xmit_frag = 5840
+        self.max_recv_frag = 5840
 
     def setUp(self):
         super(RawDCERPCTest, self).setUp()
@@ -830,13 +832,18 @@ class RawDCERPCTest(TestCase):
     def generate_bind(self, call_id,
                       pfc_flags=(samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
                                  samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST),
-                      max_xmit_frag=5840,
-                      max_recv_frag=5840,
+                      max_xmit_frag=None,
+                      max_recv_frag=None,
                       assoc_group_id=0,
                       ctx_list=[],
                       auth_info=b"",
                       ndr_print=None, hexdump=None):
 
+        if max_xmit_frag is None:
+            max_xmit_frag=self.max_xmit_frag
+        if max_recv_frag is None:
+            max_recv_frag=self.max_recv_frag
+
         b = samba.dcerpc.dcerpc.bind()
         b.max_xmit_frag = max_xmit_frag
         b.max_recv_frag = max_recv_frag
@@ -856,13 +863,18 @@ class RawDCERPCTest(TestCase):
     def generate_alter(self, call_id,
                        pfc_flags=(samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
                                   samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST),
-                       max_xmit_frag=5840,
-                       max_recv_frag=5840,
+                       max_xmit_frag=None,
+                       max_recv_frag=None,
                        assoc_group_id=0,
                        ctx_list=[],
                        auth_info=b"",
                        ndr_print=None, hexdump=None):
 
+        if max_xmit_frag is None:
+            max_xmit_frag=self.max_xmit_frag
+        if max_recv_frag is None:
+            max_recv_frag=self.max_recv_frag
+
         a = samba.dcerpc.dcerpc.bind()
         a.max_xmit_frag = max_xmit_frag
         a.max_recv_frag = max_recv_frag