]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Use test client user and machine name defaults
authorJustin Stephenson <jstephen@redhat.com>
Fri, 21 Sep 2018 13:45:33 +0000 (09:45 -0400)
committerBjoern Jacke <bjacke@samba.org>
Mon, 28 Jan 2019 14:44:18 +0000 (15:44 +0100)
Use "testclient_machine" and "testclient_user" in open printer calls.

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
source4/torture/rpc/iremotewinspool.c
source4/torture/rpc/iremotewinspool_common.c
source4/torture/rpc/iremotewinspool_common.h
source4/torture/rpc/iremotewinspool_driver.c

index 662e132593a28bd2b9f3008bcf8328b94bda02a7..3e8010d2c2b99fdbbf5e2aa2a8fea07aa51b4d68 100644 (file)
@@ -52,7 +52,7 @@ static bool torture_rpc_iremotewinspool_setup_common(struct torture_context *tct
 
        printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(t->iremotewinspool_pipe));
 
-       client_info = test_get_client_info(tctx, WIN_7, 6, 1);
+       client_info = test_get_client_info(tctx, WIN_7, 6, 1, "testclient_machine", "testclient_user");
 
        torture_assert(tctx,
                test_AsyncOpenPrinter_byprinter(tctx, t,
@@ -112,7 +112,7 @@ static bool test_AsyncClosePrinter(struct torture_context *tctx,
 
        printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
 
-       client_info = test_get_client_info(tctx, WIN_7, 6, 1);
+       client_info = test_get_client_info(tctx, WIN_7, 6, 1, "testclient_machine", "testclient_user");
 
        torture_assert(tctx,
                test_AsyncOpenPrinter_byprinter(tctx, ctx, p, printer_name, client_info, &handle),
@@ -138,7 +138,7 @@ static bool test_AsyncOpenPrinter(struct torture_context *tctx,
 
        printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
 
-       client_info = test_get_client_info(tctx, WIN_7, 6, 1);
+       client_info = test_get_client_info(tctx, WIN_7, 6, 1, "testclient_machine", "testclient_user");
 
        torture_assert(tctx,
                test_AsyncOpenPrinter_byprinter(tctx, ctx, p, printer_name, client_info, &handle),
@@ -178,7 +178,8 @@ static bool test_AsyncOpenPrinterValidateBuildNumber(struct torture_context *tct
        torture_assert_not_null(tctx, printer_name, "Cannot allocate memory");
 
        /* fail with Windows 2000 build number */
-       client_info = test_get_client_info(tctx, WIN_2000, 3, SPOOLSS_MINOR_VERSION_0);
+       client_info = test_get_client_info(tctx, WIN_2000, 3, SPOOLSS_MINOR_VERSION_0,
+                                          "testclient_machine", "testclient_user");
 
        ZERO_STRUCT(devmode_ctr);
 
@@ -197,7 +198,8 @@ static bool test_AsyncOpenPrinterValidateBuildNumber(struct torture_context *tct
                "AsyncOpenPrinter should have failed");
 
        /* succeed with Windows 7 build number */
-       client_info = test_get_client_info(tctx, WIN_7, 6, 1);
+       client_info = test_get_client_info(tctx, WIN_7, 6, 1,
+                                          "testclient_machine", "testclient_user");
        client_info_ctr.user_info.level1 = &client_info;
        r.in.pClientInfo        = &client_info_ctr;
 
@@ -800,7 +802,7 @@ static bool test_OpenPrinter(struct torture_context *tctx,
 
        printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
 
-       client_info = test_get_client_info(tctx, WIN_7, 6, 1);
+       client_info = test_get_client_info(tctx, WIN_7, 6, 1, "testclient_machine", "testclient_user");
 
        torture_assert(tctx,
                test_AsyncOpenPrinter_byprinter(tctx, ctx, p, printer_name, client_info, &handle),
index c1dc444f8aede73694fa125109416954de87b0dc..9fe5d061551da5b87788d371575a33cd570c7e10 100644 (file)
 struct spoolss_UserLevel1 test_get_client_info(struct torture_context *tctx,
                                                      enum client_os_version os,
                                                      enum spoolss_MajorVersion major_number,
-                                                     enum spoolss_MinorVersion minor_number)
+                                                     enum spoolss_MinorVersion minor_number,
+                                                     const char *machine,
+                                                     const char *user)
 {
        struct spoolss_UserLevel1 level1;
 
        level1.size     = 28;
-       level1.client   = talloc_asprintf(tctx, "\\\\%s", "mthelena");
-       level1.user     = "GD";
+       level1.client   = talloc_asprintf(tctx, "\\\\%s", machine);
+       level1.user     = user;
        level1.processor = PROCESSOR_ARCHITECTURE_AMD64;
        level1.major    = major_number;
        level1.minor    = minor_number;
index 868d142cdee74fe20abb0098d5b9e48afd58ea30..39bd9672b686e4d7fd42cb10760d34412d703375 100644 (file)
@@ -44,7 +44,9 @@ enum client_os_version
 struct spoolss_UserLevel1 test_get_client_info(struct torture_context *tctx,
                                                      enum client_os_version os,
                                                      enum spoolss_MajorVersion major_number,
-                                                     enum spoolss_MinorVersion minor_number);
+                                                     enum spoolss_MinorVersion minor_number,
+                                                     const char *machine,
+                                                     const char *user);
 
 bool test_AsyncOpenPrinter_byprinter(struct torture_context *tctx,
                                            struct test_iremotewinspool_context *ctx,
index a2876b5a8a5bdb93b0222b440a942d7bc7442cc7..f7562e418c4cc1cd255f9e7718a11e37987ea860 100644 (file)
@@ -63,7 +63,8 @@ static bool test_init_iremotewinspool_openprinter(struct torture_context *tctx,
        printer_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(t->iremotewinspool_pipe));
        torture_assert_not_null_goto(tctx, printer_name, ok, done, "Cannot allocate memory");
 
-       client_info = test_get_client_info(tctx, WIN_7, 3, SPOOLSS_MINOR_VERSION_0);
+       client_info = test_get_client_info(tctx, WIN_7, 3, SPOOLSS_MINOR_VERSION_0,
+                                          "testclient_machine", "testclient_user");
 
        ok = test_AsyncOpenPrinter_byprinter(tctx, t, t->iremotewinspool_pipe, printer_name,
                                             client_info, &t->server_handle);