s4-torture: Add handlers to ignore incoming oplock/lease break requests
authorSachin Prabhu <sprabhu@redhat.com>
Thu, 13 Sep 2018 11:39:03 +0000 (12:39 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 18 Sep 2018 10:34:38 +0000 (12:34 +0200)
For use in multichannel oplock break tests. These handers ignore
incoming oplock and lease break requests so that we can test the
oplock/lease break retries on the server.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
source4/torture/smb2/lease_break_handler.c
source4/torture/smb2/oplock_break_handler.c
source4/torture/smb2/oplock_break_handler.h

index 745fefbc4378747ed400971de999d73c4a445552..6219342fb396d6835542421e1594993dcf3e192b 100644 (file)
@@ -72,6 +72,18 @@ bool torture_lease_handler(struct smb2_transport *transport,
        return true;
 }
 
+/*
+ * A lease break handler which ignores incoming lease break requests
+ * To be used in cases where the client is expected to ignore incoming
+ * lease break requests
+ */
+bool torture_lease_ignore_handler(struct smb2_transport *transport,
+                          const struct smb2_lease_break *lb,
+                          void *private_data)
+{
+       return true;
+}
+
 /*
    Timer handler function notifies the registering function that time is up
 */
index f3dffa621536301be3dfcea7b0e1b385decc8edd..8ffa697b1aec53beb50dbc4a57f22c437d710f29 100644 (file)
@@ -100,6 +100,16 @@ bool torture_oplock_ack_handler(struct smb2_transport *transport,
        return true;
 }
 
+/**
+ * A oplock break handler designed to ignore incoming break requests.
+ * This is used when incoming oplock break requests need to be ignored
+ */
+bool torture_oplock_ignore_handler(struct smb2_transport *transport,
+                                  const struct smb2_handle *handle,
+                                  uint8_t level, void *private_data)
+{
+       return true;
+}
 
 /*
    Timer handler function notifies the registering function that time is up
index a3fb6be1436ce0c6e3859f253b9261c3609d631a..11f3907726b5f80c56e023c5b09fec78fff91e3a 100644 (file)
@@ -35,6 +35,10 @@ bool torture_oplock_ack_handler(struct smb2_transport *transport,
                                const struct smb2_handle *handle,
                                uint8_t level,
                                void *private_data);
+bool torture_oplock_ignore_handler(struct smb2_transport *transport,
+                               const struct smb2_handle *handle,
+                               uint8_t level,
+                               void *private_data);
 void torture_reset_break_info(struct torture_context *tctx,
                              struct break_info *r);
 void torture_wait_for_oplock_break(struct torture_context *tctx);