s4:torture: add smb2.durable_open test reopen3
[samba.git] / source4 / torture / util.h
index 477a828120173cb97715d11a90f7bf107c443450..3721273915adc9bb8aef2daf4f2848cf989eca7a 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef _TORTURE_PROVISION_H_
-#define _TORTURE_PROVISION_H_
+#ifndef _TORTURE_UTIL_H_
+#define _TORTURE_UTIL_H_
 
-struct provision_settings {
-       const char *dns_name;
-       const char *site_name;
-       const char *root_dn_str; 
-       const char *domain_dn_str;
-       const char *config_dn_str;
-       const char *schema_dn_str;
-       const struct GUID *invocation_id;
-       const char *netbios_name;
-       const char *host_ip;
-       const char *realm;
-       const char *domain;
-       const struct GUID *ntds_guid;
-       const char *ntds_dn_str;
-       const char *machine_password;
-       const char *targetdir;
-};
+#include "lib/torture/torture.h"
 
-NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
-                                               struct provision_settings *settings);
+struct smbcli_state;
+struct smbcli_tree;
 
+/**
+ * Useful target macros for handling server bugs in torture tests.
+ */
+#define TARGET_IS_WINXP(_tctx) (torture_setting_bool(_tctx, "winxp", false))
+#define TARGET_IS_W2K3(_tctx) (torture_setting_bool(_tctx, "w2k3", false))
+#define TARGET_IS_W2K8(_tctx) (torture_setting_bool(_tctx, "w2k8", false))
+#define TARGET_IS_WIN7(_tctx) (torture_setting_bool(_tctx, "win7", false))
+#define TARGET_IS_SAMBA3(_tctx) (torture_setting_bool(_tctx, "samba3", false))
+#define TARGET_IS_SAMBA4(_tctx) (torture_setting_bool(_tctx, "samba4", false))
 
 /**
   setup a directory ready for a test
@@ -73,7 +66,7 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
                                   struct torture_context *tctx,
                                   const char *hostname, 
                                   const char *sharename,
-                                  struct event_context *ev);
+                                  struct tevent_context *ev);
 _PUBLIC_ bool torture_get_conn_index(int conn_index,
                                     TALLOC_CTX *mem_ctx,
                                     struct torture_context *tctx,
@@ -81,7 +74,7 @@ _PUBLIC_ bool torture_get_conn_index(int conn_index,
 _PUBLIC_ bool torture_open_connection_ev(struct smbcli_state **c,
                                         int conn_index,
                                         struct torture_context *tctx,
-                                        struct event_context *ev);
+                                        struct tevent_context *ev);
 _PUBLIC_ bool torture_open_connection(struct smbcli_state **c, struct torture_context *tctx, int conn_index);
 _PUBLIC_ bool torture_close_connection(struct smbcli_state *c);
 _PUBLIC_ bool check_error(const char *location, struct smbcli_state *c, 
@@ -110,5 +103,9 @@ NTSTATUS torture_second_tcon(TALLOC_CTX *mem_ctx,
                             struct smbcli_tree **res);
 
 
+NTSTATUS torture_check_privilege(struct smbcli_state *cli, 
+                                const char *sid_str,
+                                const char *privilege);
+
 
-#endif /* _TORTURE_PROVISION_H_ */
+#endif /* _TORTURE_UTIL_H_ */