s4:torture: Migrate smbtorture to new cmdline option parser
[samba.git] / source4 / torture / raw / context.c
index 11ad11ab3fe90e5f64fb146beedae87fbcaf1a2c..b132081020955e94e0c53a1fa7e2b2ddc426837b 100644 (file)
 */
 
 #include "includes.h"
-#include "torture/torture.h"
 #include "libcli/raw/libcliraw.h"
-#include "libcli/composite/composite.h"
+#include "libcli/raw/raw_proto.h"
 #include "libcli/smb_composite/smb_composite.h"
-#include "lib/cmdline/popt_common.h"
-#include "lib/events/events.h"
+#include "lib/cmdline/cmdline.h"
 #include "libcli/libcli.h"
 #include "torture/util.h"
 #include "auth/credentials/credentials.h"
 #include "param/param.h"
+#include "torture/raw/proto.h"
 
 #define BASEDIR "\\rawcontext"
 
-#define CHECK_STATUS(status, correct) do { \
-       if (!NT_STATUS_EQUAL(status, correct)) { \
-               printf("(%s) Incorrect status %s - should be %s\n", \
-                      __location__, nt_errstr(status), nt_errstr(correct)); \
-               ret = false; \
-               goto done; \
-       }} while (0)
-
-#define CHECK_VALUE(v, correct) do { \
-       if ((v) != (correct)) { \
-               printf("(%s) Incorrect value %s=%d - should be %d\n", \
-                      __location__, #v, v, correct); \
-               ret = false; \
-               goto done; \
-       }} while (0)
-
-#define CHECK_NOT_VALUE(v, correct) do { \
-       if ((v) == (correct)) { \
-               printf("(%s) Incorrect value %s=%d - should not be %d\n", \
-                      __location__, #v, v, correct); \
-               ret = false; \
-               goto done; \
-       }} while (0)
+#define CHECK_STATUS(status, correct) \
+       torture_assert_ntstatus_equal_goto(tctx, status, correct, ret, done, __location__)
+
+#define CHECK_VALUE(v, correct) \
+       torture_assert_int_equal_goto(tctx, v, correct, ret, done, __location__)
+
+#define CHECK_NOT_VALUE(v, correct) \
+       torture_assert_goto(tctx, ((v) != (correct)), ret, done, \
+               talloc_asprintf(tctx, "(%s) Incorrect value %s=%d - should not be %d\n", \
+                      __location__, #v, v, correct));
 
 
 /*
   test session ops
 */
-static bool test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_session(struct torture_context *tctx,
+                        struct smbcli_state *cli)
 {
        NTSTATUS status;
        bool ret = true;
        struct smbcli_session *session;
        struct smbcli_session *session2;
+       uint16_t vuid3;
        struct smbcli_session *session3;
        struct smbcli_session *session4;
        struct cli_credentials *anon_creds;
@@ -73,6 +61,7 @@ static bool test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        struct smbcli_tree *tree;
        struct smb_composite_sesssetup setup;
        struct smb_composite_sesssetup setups[15];
+       struct gensec_settings *gensec_settings;
        union smb_open io;
        union smb_write wr;
        union smb_close cl;
@@ -80,78 +69,100 @@ static bool test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        const char *fname = BASEDIR "\\test.txt";
        uint8_t c = 1;
        int i;
+       struct smbcli_session_options options;
 
-       printf("TESTING SESSION HANDLING\n");
+       torture_comment(tctx, "TESTING SESSION HANDLING\n");
 
-       if (!torture_setup_dir(cli, BASEDIR)) {
-               return false;
-       }
+       torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
 
-       printf("create a second security context on the same transport\n");
-       session = smbcli_session_init(cli->transport, mem_ctx, false);
+       torture_comment(tctx, "create a second security context on the same transport\n");
+
+       lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
+       gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
+
+       session = smbcli_session_init(cli->transport, tctx, false, options);
 
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
-       setup.in.workgroup = lp_workgroup(global_loadparm);
+       setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
 
-       setup.in.credentials = cmdline_credentials;
+       setup.in.credentials = samba_cmdline_get_creds();
+       setup.in.gensec_settings = gensec_settings;
 
        status = smb_composite_sesssetup(session, &setup);
        CHECK_STATUS(status, NT_STATUS_OK);
        
        session->vuid = setup.out.vuid;
 
-       printf("create a third security context on the same transport, with vuid set\n");
-       session2 = smbcli_session_init(cli->transport, mem_ctx, false);
+       torture_comment(tctx, "create a third security context on the same transport, with given vuid\n");
+       session2 = smbcli_session_init(cli->transport, tctx, false, options);
+
+       if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
+               vuid3 = session->vuid+1;
+               if (vuid3 == cli->session->vuid) {
+                       vuid3 += 1;
+               }
+               if (vuid3 == UINT16_MAX) {
+                       vuid3 += 2;
+               }
+       } else {
+               vuid3 = session->vuid;
+       }
+       session2->vuid = vuid3;
 
-       session2->vuid = session->vuid;
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
-       setup.in.workgroup = lp_workgroup(global_loadparm);
+       setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
 
-       setup.in.credentials = cmdline_credentials;
+       setup.in.credentials = samba_cmdline_get_creds();
 
-       status = smb_composite_sesssetup(session2, &setup);
-       CHECK_STATUS(status, NT_STATUS_OK);
+       torture_comment(tctx, "vuid1=%d vuid2=%d vuid3=%d\n", cli->session->vuid, session->vuid, vuid3);
 
-       session2->vuid = setup.out.vuid;
-       printf("vuid1=%d vuid2=%d vuid3=%d\n", cli->session->vuid, session->vuid, session2->vuid);
-       
+       status = smb_composite_sesssetup(session2, &setup);
        if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
-               /* Samba4 currently fails this - we need to determine if this insane behaviour is important */
-               if (session2->vuid == session->vuid) {
-                       printf("server allows the user to re-use an existing vuid in session setup \n");
-               }
+               CHECK_STATUS(status, NT_STATUS_DOS(ERRSRV, ERRbaduid));
        } else {
-               CHECK_NOT_VALUE(session2->vuid, session->vuid);
+               CHECK_STATUS(status, NT_STATUS_OK);
+               session2->vuid = setup.out.vuid;
+               CHECK_NOT_VALUE(session2->vuid, vuid3);
        }
+
+       torture_comment(tctx, "vuid1=%d vuid2=%d vuid3=%d=>%d (%s)\n",
+                       cli->session->vuid, session->vuid,
+                       vuid3, session2->vuid, nt_errstr(status));
+
        talloc_free(session2);
 
        if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
-               printf("create a fourth security context on the same transport, without extended security\n");
-               session3 = smbcli_session_init(cli->transport, mem_ctx, false);
+               torture_comment(tctx, "create a fourth security context on the same transport, without extended security\n");
+               session3 = smbcli_session_init(cli->transport, tctx, false, options);
 
-               session3->vuid = session->vuid;
+               session3->vuid = vuid3;
                setup.in.sesskey = cli->transport->negotiate.sesskey;
                setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */
-               setup.in.workgroup = lp_workgroup(global_loadparm);
-       
-               setup.in.credentials = cmdline_credentials;
+               setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
        
+               setup.in.credentials = samba_cmdline_get_creds();
 
                status = smb_composite_sesssetup(session3, &setup);
-               CHECK_STATUS(status, NT_STATUS_LOGON_FAILURE);
+               if (!NT_STATUS_EQUAL(status, NT_STATUS_LOGON_FAILURE)) {
+                       /*
+                        * Windows 2008 R2 returns INVALID_PARAMETER
+                        * while Windows 2000 sp4 returns LOGON_FAILURE...
+                        */
+                       CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+               }
 
-               printf("create a fouth anonymous security context on the same transport, without extended security\n");
-               session4 = smbcli_session_init(cli->transport, mem_ctx, false);
+               torture_comment(tctx, "create a fouth anonymous security context on the same transport, without extended security\n");
+               session4 = smbcli_session_init(cli->transport, tctx, false, options);
 
-               session4->vuid = session->vuid;
+               session4->vuid = vuid3;
                setup.in.sesskey = cli->transport->negotiate.sesskey;
                setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */
-               setup.in.workgroup = lp_workgroup(global_loadparm);
+               setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
                
-               anon_creds = cli_credentials_init(mem_ctx);
-               cli_credentials_set_conf(anon_creds, global_loadparm);
+               anon_creds = cli_credentials_init(tctx);
+               cli_credentials_set_conf(anon_creds, tctx->lp_ctx);
                cli_credentials_set_anonymous(anon_creds);
 
                setup.in.credentials = anon_creds;
@@ -162,13 +173,13 @@ static bool test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
                talloc_free(session4);
        }
                
-       printf("use the same tree as the existing connection\n");
-       tree = smbcli_tree_init(session, mem_ctx, false);
+       torture_comment(tctx, "use the same tree as the existing connection\n");
+       tree = smbcli_tree_init(session, tctx, false);
        tree->tid = cli->tree->tid;
 
-       printf("create a file using the new vuid\n");
+       torture_comment(tctx, "create a file using the new vuid\n");
        io.generic.level = RAW_OPEN_NTCREATEX;
-       io.ntcreatex.in.root_fid = 0;
+       io.ntcreatex.in.root_fid.fnum = 0;
        io.ntcreatex.in.flags = 0;
        io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
        io.ntcreatex.in.create_options = 0;
@@ -179,11 +190,11 @@ static bool test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = fname;
-       status = smb_raw_open(tree, mem_ctx, &io);
+       status = smb_raw_open(tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum = io.ntcreatex.out.file.fnum;
 
-       printf("write using the old vuid\n");
+       torture_comment(tctx, "write using the old vuid\n");
        wr.generic.level = RAW_WRITE_WRITEX;
        wr.writex.in.file.fnum = fnum;
        wr.writex.in.offset = 0;
@@ -195,60 +206,59 @@ static bool test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("write with the new vuid\n");
+       torture_comment(tctx, "write with the new vuid\n");
        status = smb_raw_write(tree, &wr);
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("logoff the new vuid\n");
+       torture_comment(tctx, "logoff the new vuid\n");
        status = smb_raw_ulogoff(session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("the new vuid should not now be accessible\n");
+       torture_comment(tctx, "the new vuid should not now be accessible\n");
        status = smb_raw_write(tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("second logoff for the new vuid should fail\n");
+       torture_comment(tctx, "second logoff for the new vuid should fail\n");
        status = smb_raw_ulogoff(session);
        CHECK_STATUS(status, NT_STATUS_DOS(ERRSRV, ERRbaduid));
+       talloc_free(tree);
        talloc_free(session);
 
-       printf("the fnum should have been auto-closed\n");
+       torture_comment(tctx, "the fnum should have been auto-closed\n");
        cl.close.level = RAW_CLOSE_CLOSE;
        cl.close.in.file.fnum = fnum;
        cl.close.in.write_time = 0;
        status = smb_raw_close(cli->tree, &cl);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("create %d secondary security contexts on the same transport\n", 
+       torture_comment(tctx, "create %d secondary security contexts on the same transport\n",
               (int)ARRAY_SIZE(sessions));
        for (i=0; i <ARRAY_SIZE(sessions); i++) {
                setups[i].in.sesskey = cli->transport->negotiate.sesskey;
                setups[i].in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
-               setups[i].in.workgroup = lp_workgroup(global_loadparm);
+               setups[i].in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
                
-               setups[i].in.credentials = cmdline_credentials;
+               setups[i].in.credentials = samba_cmdline_get_creds();
+               setups[i].in.gensec_settings = gensec_settings;
 
-               sessions[i] = smbcli_session_init(cli->transport, mem_ctx, false);
+               sessions[i] = smbcli_session_init(cli->transport, tctx, false, options);
                composite_contexts[i] = smb_composite_sesssetup_send(sessions[i], &setups[i]);
 
        }
 
 
-       printf("finishing %d secondary security contexts on the same transport\n", 
+       torture_comment(tctx, "finishing %d secondary security contexts on the same transport\n",
               (int)ARRAY_SIZE(sessions));
        for (i=0; i< ARRAY_SIZE(sessions); i++) {
                status = smb_composite_sesssetup_recv(composite_contexts[i]);
                CHECK_STATUS(status, NT_STATUS_OK);
                sessions[i]->vuid = setups[i].out.vuid;
-               printf("VUID: %d\n", sessions[i]->vuid);
+               torture_comment(tctx, "VUID: %d\n", sessions[i]->vuid);
                status = smb_raw_ulogoff(sessions[i]);
                CHECK_STATUS(status, NT_STATUS_OK);
        }
 
-
-       talloc_free(tree);
-       
 done:
        return ret;
 }
@@ -257,7 +267,7 @@ done:
 /*
   test tree ops
 */
-static bool test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_tree(struct torture_context *tctx, struct smbcli_state *cli)
 {
        NTSTATUS status;
        bool ret = true;
@@ -271,39 +281,37 @@ static bool test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        const char *fname = BASEDIR "\\test.txt";
        uint8_t c = 1;
 
-       printf("TESTING TREE HANDLING\n");
+       torture_comment(tctx, "TESTING TREE HANDLING\n");
 
-       if (!torture_setup_dir(cli, BASEDIR)) {
-               return false;
-       }
+       torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
 
-       share = lp_parm_string(global_loadparm, NULL, "torture", "share");
-       host  = lp_parm_string(global_loadparm, NULL, "torture", "host");
+       share = torture_setting_string(tctx, "share", NULL);
+       host  = torture_setting_string(tctx, "host", NULL);
        
-       printf("create a second tree context on the same session\n");
-       tree = smbcli_tree_init(cli->session, mem_ctx, false);
+       torture_comment(tctx, "create a second tree context on the same session\n");
+       tree = smbcli_tree_init(cli->session, tctx, false);
 
        tcon.generic.level = RAW_TCON_TCONX;
-       tcon.tconx.in.flags = 0;
+       tcon.tconx.in.flags = TCONX_FLAG_EXTENDED_RESPONSE;
        tcon.tconx.in.password = data_blob(NULL, 0);
-       tcon.tconx.in.path = talloc_asprintf(mem_ctx, "\\\\%s\\%s", host, share);
+       tcon.tconx.in.path = talloc_asprintf(tctx, "\\\\%s\\%s", host, share);
        tcon.tconx.in.device = "A:";    
-       status = smb_raw_tcon(tree, mem_ctx, &tcon);
+       status = smb_raw_tcon(tree, tctx, &tcon);
        CHECK_STATUS(status, NT_STATUS_OK);
        
 
        tree->tid = tcon.tconx.out.tid;
-       printf("tid1=%d tid2=%d\n", cli->tree->tid, tree->tid);
+       torture_comment(tctx, "tid1=%d tid2=%d\n", cli->tree->tid, tree->tid);
 
-       printf("try a tconx with a bad device type\n");
+       torture_comment(tctx, "try a tconx with a bad device type\n");
        tcon.tconx.in.device = "FOO";   
-       status = smb_raw_tcon(tree, mem_ctx, &tcon);
+       status = smb_raw_tcon(tree, tctx, &tcon);
        CHECK_STATUS(status, NT_STATUS_BAD_DEVICE_TYPE);
 
 
-       printf("create a file using the new tid\n");
+       torture_comment(tctx, "create a file using the new tid\n");
        io.generic.level = RAW_OPEN_NTCREATEX;
-       io.ntcreatex.in.root_fid = 0;
+       io.ntcreatex.in.root_fid.fnum = 0;
        io.ntcreatex.in.flags = 0;
        io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
        io.ntcreatex.in.create_options = 0;
@@ -314,11 +322,11 @@ static bool test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = fname;
-       status = smb_raw_open(tree, mem_ctx, &io);
+       status = smb_raw_open(tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum = io.ntcreatex.out.file.fnum;
 
-       printf("write using the old tid\n");
+       torture_comment(tctx, "write using the old tid\n");
        wr.generic.level = RAW_WRITE_WRITEX;
        wr.writex.in.file.fnum = fnum;
        wr.writex.in.offset = 0;
@@ -330,20 +338,20 @@ static bool test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("write with the new tid\n");
+       torture_comment(tctx, "write with the new tid\n");
        status = smb_raw_write(tree, &wr);
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("disconnect the new tid\n");
+       torture_comment(tctx, "disconnect the new tid\n");
        status = smb_tree_disconnect(tree);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("the new tid should not now be accessible\n");
+       torture_comment(tctx, "the new tid should not now be accessible\n");
        status = smb_raw_write(tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("the fnum should have been auto-closed\n");
+       torture_comment(tctx, "the fnum should have been auto-closed\n");
        cl.close.level = RAW_CLOSE_CLOSE;
        cl.close.in.file.fnum = fnum;
        cl.close.in.write_time = 0;
@@ -362,7 +370,7 @@ done:
   this demonstrates that a tcon isn't autoclosed by a ulogoff
   the tcon can be reused using any other valid session later
 */
-static bool test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_tree_ulogoff(struct torture_context *tctx, struct smbcli_state *cli)
 {
        NTSTATUS status;
        bool ret = true;
@@ -378,42 +386,44 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        const char *fname1 = BASEDIR "\\test1.txt";
        const char *fname2 = BASEDIR "\\test2.txt";
        uint8_t c = 1;
+       struct smbcli_session_options options;
 
-       printf("TESTING TREE with ulogoff\n");
+       torture_comment(tctx, "TESTING TREE with ulogoff\n");
 
-       if (!torture_setup_dir(cli, BASEDIR)) {
-               return false;
-       }
+       torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
+
+       share = torture_setting_string(tctx, "share", NULL);
+       host  = torture_setting_string(tctx, "host", NULL);
 
-       share = lp_parm_string(global_loadparm, NULL, "torture", "share");
-       host  = lp_parm_string(global_loadparm, NULL, "torture", "host");
+       lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
 
-       printf("create the first new sessions\n");
-       session1 = smbcli_session_init(cli->transport, mem_ctx, false);
+       torture_comment(tctx, "create the first new sessions\n");
+       session1 = smbcli_session_init(cli->transport, tctx, false, options);
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities;
-       setup.in.workgroup = lp_workgroup(global_loadparm);
-       setup.in.credentials = cmdline_credentials;
+       setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
+       setup.in.credentials = samba_cmdline_get_creds();
+       setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
        status = smb_composite_sesssetup(session1, &setup);
        CHECK_STATUS(status, NT_STATUS_OK);
        session1->vuid = setup.out.vuid;
-       printf("vuid1=%d\n", session1->vuid);
+       torture_comment(tctx, "vuid1=%d\n", session1->vuid);
 
-       printf("create a tree context on the with vuid1\n");
-       tree = smbcli_tree_init(session1, mem_ctx, false);
+       torture_comment(tctx, "create a tree context on the with vuid1\n");
+       tree = smbcli_tree_init(session1, tctx, false);
        tcon.generic.level = RAW_TCON_TCONX;
-       tcon.tconx.in.flags = 0;
+       tcon.tconx.in.flags = TCONX_FLAG_EXTENDED_RESPONSE;
        tcon.tconx.in.password = data_blob(NULL, 0);
-       tcon.tconx.in.path = talloc_asprintf(mem_ctx, "\\\\%s\\%s", host, share);
+       tcon.tconx.in.path = talloc_asprintf(tctx, "\\\\%s\\%s", host, share);
        tcon.tconx.in.device = "A:";
-       status = smb_raw_tcon(tree, mem_ctx, &tcon);
+       status = smb_raw_tcon(tree, tctx, &tcon);
        CHECK_STATUS(status, NT_STATUS_OK);
        tree->tid = tcon.tconx.out.tid;
-       printf("tid=%d\n", tree->tid);
+       torture_comment(tctx, "tid=%d\n", tree->tid);
 
-       printf("create a file using vuid1\n");
+       torture_comment(tctx, "create a file using vuid1\n");
        io.generic.level = RAW_OPEN_NTCREATEX;
-       io.ntcreatex.in.root_fid = 0;
+       io.ntcreatex.in.root_fid.fnum = 0;
        io.ntcreatex.in.flags = 0;
        io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
        io.ntcreatex.in.create_options = 0;
@@ -424,11 +434,11 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = fname1;
-       status = smb_raw_open(tree, mem_ctx, &io);
+       status = smb_raw_open(tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum1 = io.ntcreatex.out.file.fnum;
 
-       printf("write using vuid1\n");
+       torture_comment(tctx, "write using vuid1\n");
        wr.generic.level = RAW_WRITE_WRITEX;
        wr.writex.in.file.fnum = fnum1;
        wr.writex.in.offset = 0;
@@ -440,27 +450,28 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("ulogoff the vuid1\n");
+       torture_comment(tctx, "ulogoff the vuid1\n");
        status = smb_raw_ulogoff(session1);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("create the second new sessions\n");
-       session2 = smbcli_session_init(cli->transport, mem_ctx, false);
+       torture_comment(tctx, "create the second new sessions\n");
+       session2 = smbcli_session_init(cli->transport, tctx, false, options);
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities;
-       setup.in.workgroup = lp_workgroup(global_loadparm);
-       setup.in.credentials = cmdline_credentials;
+       setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
+       setup.in.credentials = samba_cmdline_get_creds();
+       setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
        status = smb_composite_sesssetup(session2, &setup);
        CHECK_STATUS(status, NT_STATUS_OK);
        session2->vuid = setup.out.vuid;
-       printf("vuid2=%d\n", session2->vuid);
+       torture_comment(tctx, "vuid2=%d\n", session2->vuid);
 
-       printf("use the existing tree with vuid2\n");
+       torture_comment(tctx, "use the existing tree with vuid2\n");
        tree->session = session2;
 
-       printf("create a file using vuid2\n");
+       torture_comment(tctx, "create a file using vuid2\n");
        io.generic.level = RAW_OPEN_NTCREATEX;
-       io.ntcreatex.in.root_fid = 0;
+       io.ntcreatex.in.root_fid.fnum = 0;
        io.ntcreatex.in.flags = 0;
        io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
        io.ntcreatex.in.create_options = 0;
@@ -471,11 +482,11 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = fname2;
-       status = smb_raw_open(tree, mem_ctx, &io);
+       status = smb_raw_open(tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum2 = io.ntcreatex.out.file.fnum;
 
-       printf("write using vuid2\n");
+       torture_comment(tctx, "write using vuid2\n");
        wr.generic.level = RAW_WRITE_WRITEX;
        wr.writex.in.file.fnum = fnum2;
        wr.writex.in.offset = 0;
@@ -487,16 +498,16 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("ulogoff the vuid2\n");
+       torture_comment(tctx, "ulogoff the vuid2\n");
        status = smb_raw_ulogoff(session2);
        CHECK_STATUS(status, NT_STATUS_OK);
 
        /* this also demonstrates that SMBtdis doesn't need a valid vuid */
-       printf("disconnect the existing tree connection\n");
+       torture_comment(tctx, "disconnect the existing tree connection\n");
        status = smb_tree_disconnect(tree);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("disconnect the existing tree connection\n");
+       torture_comment(tctx, "disconnect the existing tree connection\n");
        status = smb_tree_disconnect(tree);
        CHECK_STATUS(status, NT_STATUS_DOS(ERRSRV,ERRinvnid));
 
@@ -512,9 +523,11 @@ done:
   this test demonstrates that exit() only sees the PID
   used for the open() calls
 */
-static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_pid_exit_only_sees_open(struct torture_context *tctx,
+                                        struct smbcli_state *cli)
 {
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx = tctx;
        bool ret = true;
        union smb_open io;
        union smb_write wr;
@@ -524,21 +537,19 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
        uint8_t c = 1;
        uint16_t pid1, pid2;
 
-       printf("TESTING PID HANDLING exit() only cares about open() PID\n");
+       torture_comment(tctx, "TESTING PID HANDLING exit() only cares about open() PID\n");
 
-       if (!torture_setup_dir(cli, BASEDIR)) {
-               return false;
-       }
+       torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
 
        pid1 = cli->session->pid;
        pid2 = pid1 + 1;
 
-       printf("pid1=%d pid2=%d\n", pid1, pid2);
+       torture_comment(tctx, "pid1=%d pid2=%d\n", pid1, pid2);
 
-       printf("create a file using pid1\n");
+       torture_comment(tctx, "create a file using pid1\n");
        cli->session->pid = pid1;
        io.generic.level = RAW_OPEN_NTCREATEX;
-       io.ntcreatex.in.root_fid = 0;
+       io.ntcreatex.in.root_fid.fnum = 0;
        io.ntcreatex.in.flags = 0;
        io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
        io.ntcreatex.in.create_options = 0;
@@ -553,7 +564,7 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum = io.ntcreatex.out.file.fnum;
 
-       printf("write using pid2\n");
+       torture_comment(tctx, "write using pid2\n");
        cli->session->pid = pid2;
        wr.generic.level = RAW_WRITE_WRITEX;
        wr.writex.in.file.fnum = fnum;
@@ -566,23 +577,23 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("exit pid2\n");
+       torture_comment(tctx, "exit pid2\n");
        cli->session->pid = pid2;
        status = smb_raw_exit(cli->session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("the fnum should still be accessible via pid2\n");
+       torture_comment(tctx, "the fnum should still be accessible via pid2\n");
        cli->session->pid = pid2;
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("exit pid2\n");
+       torture_comment(tctx, "exit pid2\n");
        cli->session->pid = pid2;
        status = smb_raw_exit(cli->session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("the fnum should still be accessible via pid1 and pid2\n");
+       torture_comment(tctx, "the fnum should still be accessible via pid1 and pid2\n");
        cli->session->pid = pid1;
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_OK);
@@ -592,12 +603,12 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("exit pid1\n");
+       torture_comment(tctx, "exit pid1\n");
        cli->session->pid = pid1;
        status = smb_raw_exit(cli->session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("the fnum should not now be accessible via pid1 or pid2\n");
+       torture_comment(tctx, "the fnum should not now be accessible via pid1 or pid2\n");
        cli->session->pid = pid1;
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
@@ -605,7 +616,7 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("the fnum should have been auto-closed\n");
+       torture_comment(tctx, "the fnum should have been auto-closed\n");
        cli->session->pid = pid1;
        cl.close.level = RAW_CLOSE_CLOSE;
        cl.close.in.file.fnum = fnum;
@@ -620,7 +631,8 @@ done:
 /*
   test pid ops with 2 sessions
 */
-static bool test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_pid_2sess(struct torture_context *tctx,
+                          struct smbcli_state *cli)
 {
        NTSTATUS status;
        bool ret = true;
@@ -633,21 +645,22 @@ static bool test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        const char *fname = BASEDIR "\\test.txt";
        uint8_t c = 1;
        uint16_t vuid1, vuid2;
+       struct smbcli_session_options options;
 
-       printf("TESTING PID HANDLING WITH 2 SESSIONS\n");
+       torture_comment(tctx, "TESTING PID HANDLING WITH 2 SESSIONS\n");
 
-       if (!torture_setup_dir(cli, BASEDIR)) {
-               return false;
-       }
+       torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
 
-       printf("create a second security context on the same transport\n");
-       session = smbcli_session_init(cli->transport, mem_ctx, false);
+       lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
+
+       torture_comment(tctx, "create a second security context on the same transport\n");
+       session = smbcli_session_init(cli->transport, tctx, false, options);
 
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
-       setup.in.workgroup = lp_workgroup(global_loadparm);
-
-       setup.in.credentials = cmdline_credentials;
+       setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
+       setup.in.credentials = samba_cmdline_get_creds();
+       setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
 
        status = smb_composite_sesssetup(session, &setup);
        CHECK_STATUS(status, NT_STATUS_OK);     
@@ -656,12 +669,12 @@ static bool test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        vuid1 = cli->session->vuid;
        vuid2 = session->vuid;
 
-       printf("vuid1=%d vuid2=%d\n", vuid1, vuid2);
+       torture_comment(tctx, "vuid1=%d vuid2=%d\n", vuid1, vuid2);
 
-       printf("create a file using the vuid1\n");
+       torture_comment(tctx, "create a file using the vuid1\n");
        cli->session->vuid = vuid1;
        io.generic.level = RAW_OPEN_NTCREATEX;
-       io.ntcreatex.in.root_fid = 0;
+       io.ntcreatex.in.root_fid.fnum = 0;
        io.ntcreatex.in.flags = 0;
        io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
        io.ntcreatex.in.create_options = 0;
@@ -672,11 +685,11 @@ static bool test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = fname;
-       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       status = smb_raw_open(cli->tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum = io.ntcreatex.out.file.fnum;
 
-       printf("write using the vuid1 (fnum=%d)\n", fnum);
+       torture_comment(tctx, "write using the vuid1 (fnum=%d)\n", fnum);
        cli->session->vuid = vuid1;
        wr.generic.level = RAW_WRITE_WRITEX;
        wr.writex.in.file.fnum = fnum;
@@ -690,27 +703,27 @@ static bool test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("exit the pid with vuid2\n");
+       torture_comment(tctx, "exit the pid with vuid2\n");
        cli->session->vuid = vuid2;
        status = smb_raw_exit(cli->session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("the fnum should still be accessible\n");
+       torture_comment(tctx, "the fnum should still be accessible\n");
        cli->session->vuid = vuid1;
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("exit the pid with vuid1\n");
+       torture_comment(tctx, "exit the pid with vuid1\n");
        cli->session->vuid = vuid1;
        status = smb_raw_exit(cli->session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("the fnum should not now be accessible\n");
+       torture_comment(tctx, "the fnum should not now be accessible\n");
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("the fnum should have been auto-closed\n");
+       torture_comment(tctx, "the fnum should have been auto-closed\n");
        cl.close.level = RAW_CLOSE_CLOSE;
        cl.close.in.file.fnum = fnum;
        cl.close.in.write_time = 0;
@@ -724,7 +737,8 @@ done:
 /*
   test pid ops with 2 tcons
 */
-static bool test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_pid_2tcon(struct torture_context *tctx,
+                          struct smbcli_state *cli)
 {
        NTSTATUS status;
        bool ret = true;
@@ -740,36 +754,34 @@ static bool test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        uint8_t c = 1;
        uint16_t tid1, tid2;
 
-       printf("TESTING PID HANDLING WITH 2 TCONS\n");
+       torture_comment(tctx, "TESTING PID HANDLING WITH 2 TCONS\n");
 
-       if (!torture_setup_dir(cli, BASEDIR)) {
-               return false;
-       }
+       torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
 
-       share = lp_parm_string(global_loadparm, NULL, "torture", "share");
-       host  = lp_parm_string(global_loadparm, NULL, "torture", "host");
+       share = torture_setting_string(tctx, "share", NULL);
+       host  = torture_setting_string(tctx, "host", NULL);
        
-       printf("create a second tree context on the same session\n");
-       tree = smbcli_tree_init(cli->session, mem_ctx, false);
+       torture_comment(tctx, "create a second tree context on the same session\n");
+       tree = smbcli_tree_init(cli->session, tctx, false);
 
        tcon.generic.level = RAW_TCON_TCONX;
-       tcon.tconx.in.flags = 0;
+       tcon.tconx.in.flags = TCONX_FLAG_EXTENDED_RESPONSE;
        tcon.tconx.in.password = data_blob(NULL, 0);
-       tcon.tconx.in.path = talloc_asprintf(mem_ctx, "\\\\%s\\%s", host, share);
+       tcon.tconx.in.path = talloc_asprintf(tctx, "\\\\%s\\%s", host, share);
        tcon.tconx.in.device = "A:";    
-       status = smb_raw_tcon(tree, mem_ctx, &tcon);
+       status = smb_raw_tcon(tree, tctx, &tcon);
        CHECK_STATUS(status, NT_STATUS_OK);     
 
        tree->tid = tcon.tconx.out.tid;
 
        tid1 = cli->tree->tid;
        tid2 = tree->tid;
-       printf("tid1=%d tid2=%d\n", tid1, tid2);
+       torture_comment(tctx, "tid1=%d tid2=%d\n", tid1, tid2);
 
-       printf("create a file using the tid1\n");
+       torture_comment(tctx, "create a file using the tid1\n");
        cli->tree->tid = tid1;
        io.generic.level = RAW_OPEN_NTCREATEX;
-       io.ntcreatex.in.root_fid = 0;
+       io.ntcreatex.in.root_fid.fnum = 0;
        io.ntcreatex.in.flags = 0;
        io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
        io.ntcreatex.in.create_options = 0;
@@ -780,11 +792,11 @@ static bool test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = fname1;
-       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       status = smb_raw_open(cli->tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum1 = io.ntcreatex.out.file.fnum;
 
-       printf("write using the tid1\n");
+       torture_comment(tctx, "write using the tid1\n");
        wr.generic.level = RAW_WRITE_WRITEX;
        wr.writex.in.file.fnum = fnum1;
        wr.writex.in.offset = 0;
@@ -797,10 +809,10 @@ static bool test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("create a file using the tid2\n");
+       torture_comment(tctx, "create a file using the tid2\n");
        cli->tree->tid = tid2;
        io.generic.level = RAW_OPEN_NTCREATEX;
-       io.ntcreatex.in.root_fid = 0;
+       io.ntcreatex.in.root_fid.fnum = 0;
        io.ntcreatex.in.flags = 0;
        io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
        io.ntcreatex.in.create_options = 0;
@@ -811,11 +823,11 @@ static bool test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = fname2;
-       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       status = smb_raw_open(cli->tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum2 = io.ntcreatex.out.file.fnum;
 
-       printf("write using the tid2\n");
+       torture_comment(tctx, "write using the tid2\n");
        wr.generic.level = RAW_WRITE_WRITEX;
        wr.writex.in.file.fnum = fnum2;
        wr.writex.in.offset = 0;
@@ -828,30 +840,30 @@ static bool test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-       printf("exit the pid\n");
+       torture_comment(tctx, "exit the pid\n");
        status = smb_raw_exit(cli->session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       printf("the fnum1 on tid1 should not be accessible\n");
+       torture_comment(tctx, "the fnum1 on tid1 should not be accessible\n");
        cli->tree->tid = tid1;
        wr.writex.in.file.fnum = fnum1;
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("the fnum1 on tid1 should have been auto-closed\n");
+       torture_comment(tctx, "the fnum1 on tid1 should have been auto-closed\n");
        cl.close.level = RAW_CLOSE_CLOSE;
        cl.close.in.file.fnum = fnum1;
        cl.close.in.write_time = 0;
        status = smb_raw_close(cli->tree, &cl);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("the fnum2 on tid2 should not be accessible\n");
+       torture_comment(tctx, "the fnum2 on tid2 should not be accessible\n");
        cli->tree->tid = tid2;
        wr.writex.in.file.fnum = fnum2;
        status = smb_raw_write(cli->tree, &wr);
        CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-       printf("the fnum2 on tid2 should have been auto-closed\n");
+       torture_comment(tctx, "the fnum2 on tid2 should have been auto-closed\n");
        cl.close.level = RAW_CLOSE_CLOSE;
        cl.close.in.file.fnum = fnum2;
        cl.close.in.write_time = 0;
@@ -862,40 +874,20 @@ done:
        return ret;
 }
 
-
-/* 
-   basic testing of session/tree context calls
-*/
-static bool torture_raw_context_int(struct torture_context *tctx, 
-                                                                       struct smbcli_state *cli)
-{
-       bool ret = true;
-
-       ret &= test_session(cli, tctx);
-       ret &= test_tree(cli, tctx);
-       ret &= test_tree_ulogoff(cli, tctx);
-       ret &= test_pid_exit_only_sees_open(cli, tctx);
-       ret &= test_pid_2sess(cli, tctx);
-       ret &= test_pid_2tcon(cli, tctx);
-
-       smb_raw_exit(cli->session);
-       smbcli_deltree(cli->tree, BASEDIR);
-
-       return ret;
-}
-/* 
-   basic testing of session/tree context calls
-*/
-bool torture_raw_context(struct torture_context *torture, 
-                        struct smbcli_state *cli)
+struct torture_suite *torture_raw_context(TALLOC_CTX *mem_ctx)
 {
-       bool ret = true;
-       if (lp_use_spnego(global_loadparm)) {
-               ret &= torture_raw_context_int(torture, cli);
-               lp_set_cmdline(global_loadparm, "use spnego", "False");
-       }
-
-       ret &= torture_raw_context_int(torture, cli);
-
-       return ret;
+       struct torture_suite *suite = torture_suite_create(mem_ctx, "context");
+
+       torture_suite_add_1smb_test(suite, "session1", test_session);
+       /*
+        * TODO: add test_session with 'use spnego = false'
+        * torture_suite_add_1smb_test(suite, "session1", test_session);
+        */
+       torture_suite_add_1smb_test(suite, "tree", test_tree);
+       torture_suite_add_1smb_test(suite, "tree_ulogoff", test_tree_ulogoff);
+       torture_suite_add_1smb_test(suite, "pid_only_sess", test_pid_exit_only_sees_open);
+       torture_suite_add_1smb_test(suite, "pid_2sess", test_pid_2sess);
+       torture_suite_add_1smb_test(suite, "pid_2tcon", test_pid_2tcon);
+
+       return suite;
 }