s4-netlogon: merge netr_GetDcName from s3 idl.
[kai/samba.git] / source4 / torture / rpc / netlogon.c
index 7f0f60cd329b583a26f380c1c887c3940ccfd36f..5f8e2fc21b53c4438b344508793f8af9c2aaccb5 100644 (file)
@@ -869,15 +869,17 @@ static bool test_GetDcName(struct torture_context *tctx,
 {
        NTSTATUS status;
        struct netr_GetDcName r;
+       const char *dcname = NULL;
 
        r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
        r.in.domainname = lp_workgroup(tctx->lp_ctx);
+       r.out.dcname = &dcname;
 
        status = dcerpc_netr_GetDcName(p, tctx, &r);
        torture_assert_ntstatus_ok(tctx, status, "GetDcName");
        torture_assert_werr_ok(tctx, r.out.result, "GetDcName");
 
-       torture_comment(tctx, "\tDC is at '%s'\n", r.out.dcname);
+       torture_comment(tctx, "\tDC is at '%s'\n", dcname);
 
        return true;
 }
@@ -916,15 +918,17 @@ static bool test_GetAnyDCName(struct torture_context *tctx,
 {
        NTSTATUS status;
        struct netr_GetAnyDCName r;
+       const char *dcname = NULL;
 
        r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
        r.in.domainname = lp_workgroup(tctx->lp_ctx);
+       r.out.dcname = &dcname;
 
        status = dcerpc_netr_GetAnyDCName(p, tctx, &r);
        torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName");
 
-       if (r.out.dcname) {
-           torture_comment(tctx, "\tDC is at '%s'\n", r.out.dcname);
+       if (dcname) {
+           torture_comment(tctx, "\tDC is at '%s'\n", dcname);
        }
 
        return true;
@@ -1230,17 +1234,19 @@ static bool test_netr_DsRGetSiteName(struct dcerpc_pipe *p, struct torture_conte
 {
        NTSTATUS status;
        struct netr_DsRGetSiteName r;
+       const char *site = NULL;
 
        if (torture_setting_bool(tctx, "samba4", false))
                torture_skip(tctx, "skipping DsRGetSiteName test against Samba4");
 
        r.in.computer_name              = computer_name;
+       r.out.site                      = &site;
        torture_comment(tctx, "Testing netr_DsRGetSiteName\n");
 
        status = dcerpc_netr_DsRGetSiteName(p, tctx, &r);
        torture_assert_ntstatus_ok(tctx, status, "DsRGetSiteName");
        torture_assert_werr_ok(tctx, r.out.result, "DsRGetSiteName");
-       torture_assert_str_equal(tctx, expected_site, r.out.site, "netr_DsRGetSiteName");
+       torture_assert_str_equal(tctx, expected_site, site, "netr_DsRGetSiteName");
 
        r.in.computer_name              = talloc_asprintf(tctx, "\\\\%s", computer_name);
        torture_comment(tctx, 
@@ -1567,6 +1573,7 @@ static bool test_ManyGetDCName(struct torture_context *tctx,
        struct lsa_EnumTrustDom t;
        uint32_t resume_handle = 0;
        struct netr_GetAnyDCName d;
+       const char *dcname = NULL;
 
        int i;
 
@@ -1618,6 +1625,7 @@ static bool test_ManyGetDCName(struct torture_context *tctx,
 
        d.in.logon_server = talloc_asprintf(tctx, "\\\\%s",
                                            dcerpc_server_name(p));
+       d.out.dcname = &dcname;
 
        for (i=0; i<domains.count * 4; i++) {
                struct lsa_DomainInfo *info =
@@ -1629,7 +1637,7 @@ static bool test_ManyGetDCName(struct torture_context *tctx,
                torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName");
 
                torture_comment(tctx, "\tDC for domain %s is %s\n", info->name.string,
-                      d.out.dcname ? d.out.dcname : "unknown");
+                      dcname ? dcname : "unknown");
        }
 
        return true;