s4-smbtorture: add torture_suite_add_machine_workstation_rpc_iface_tcase.
[metze/samba/wip.git] / source4 / torture / rpc / samr.c
index 0072a018c8eebacd63643d7e1cada846e75c5d4a..be2bfefab1f003f86865bde79951b4150da90140 100644 (file)
@@ -2674,7 +2674,7 @@ static bool test_QueryUserInfo_pwdlastset(struct dcerpc_pipe *p,
 }
 
 static bool test_SamLogon(struct torture_context *tctx,
-                         struct dcerpc_pipe *p, 
+                         struct dcerpc_pipe *p,
                          struct cli_credentials *test_credentials,
                          NTSTATUS expected_result)
 {
@@ -2745,6 +2745,10 @@ static bool test_SamLogon(struct torture_context *tctx,
        r.in.validation_level = 6;
 
        status = dcerpc_netr_LogonSamLogonEx(p, tctx, &r);
+       if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_INFO_CLASS)) {
+               r.in.validation_level = 3;
+               status = dcerpc_netr_LogonSamLogonEx(p, tctx, &r);
+       }
        if (!NT_STATUS_IS_OK(status)) {
                torture_assert_ntstatus_equal(tctx, status, expected_result, "LogonSamLogonEx failed");
                return true;
@@ -2887,7 +2891,7 @@ static bool test_SetPassword_pwdlastset(struct dcerpc_pipe *p,
        struct dcerpc_pipe *np = NULL;
 
        if (torture_setting_bool(tctx, "samba3", false)) {
-               delay = 1000000;
+               delay = 999999;
                printf("Samba3 has second granularity, setting delay to: %d\n",
                        delay);
        }
@@ -2904,7 +2908,7 @@ static bool test_SetPassword_pwdlastset(struct dcerpc_pipe *p,
        b->flags &= ~DCERPC_AUTH_OPTIONS;
        b->flags |= DCERPC_SCHANNEL | DCERPC_SIGN | DCERPC_SCHANNEL_128;
 
-       status = dcerpc_pipe_connect_b(tctx, &np, b, 
+       status = dcerpc_pipe_connect_b(tctx, &np, b,
                                       &ndr_table_netlogon,
                                       machine_credentials, tctx->ev, tctx->lp_ctx);
 
@@ -3299,7 +3303,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                struct lsa_EnumAccountRights r;
                struct lsa_RightSet rights;
 
-               printf("Testing LSA EnumAccountRights\n");
+               torture_comment(tctx, "Testing LSA EnumAccountRights\n");
 
                r.in.handle = lsa_handle;
                r.in.sid = user_sid;
@@ -3315,7 +3319,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                struct lsa_StringLarge names[2];
                struct lsa_AddAccountRights r;
 
-               printf("Testing LSA AddAccountRights\n");
+               torture_comment(tctx, "Testing LSA AddAccountRights\n");
 
                init_lsa_StringLarge(&names[0], "SeMachineAccountPrivilege");
                init_lsa_StringLarge(&names[1], NULL);
@@ -3339,7 +3343,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                int i;
                bool found_sid = false;
 
-               printf("Testing LSA EnumAccounts\n");
+               torture_comment(tctx, "Testing LSA EnumAccounts\n");
 
                r.in.handle = lsa_handle;
                r.in.num_entries = 0x1000;
@@ -3365,7 +3369,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                struct lsa_EnumAccountRights r;
                struct lsa_RightSet user_rights;
 
-               printf("Testing LSA EnumAccountRights\n");
+               torture_comment(tctx, "Testing LSA EnumAccountRights\n");
 
                r.in.handle = lsa_handle;
                r.in.sid = user_sid;
@@ -3384,7 +3388,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
        {
                struct lsa_OpenAccount r;
 
-               printf("Testing LSA OpenAccount\n");
+               torture_comment(tctx, "Testing LSA OpenAccount\n");
 
                r.in.handle = lsa_handle;
                r.in.sid = user_sid;
@@ -3400,7 +3404,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                struct lsa_GetSystemAccessAccount r;
                uint32_t access_mask;
 
-               printf("Testing LSA GetSystemAccessAccount\n");
+               torture_comment(tctx, "Testing LSA GetSystemAccessAccount\n");
 
                r.in.handle = &lsa_acct_handle;
                r.out.access_mask = &access_mask;
@@ -3413,7 +3417,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
        {
                struct lsa_Close r;
 
-               printf("Testing LSA Close\n");
+               torture_comment(tctx, "Testing LSA Close\n");
 
                r.in.handle = &lsa_acct_handle;
                r.out.handle = &lsa_acct_handle;
@@ -3426,7 +3430,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
        {
                struct samr_DeleteUser r;
 
-               printf("Testing SAMR DeleteUser\n");
+               torture_comment(tctx, "Testing SAMR DeleteUser\n");
 
                r.in.user_handle = user_handle;
                r.out.user_handle = user_handle;
@@ -3442,7 +3446,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                int i;
                bool found_sid = false;
 
-               printf("Testing LSA EnumAccounts\n");
+               torture_comment(tctx, "Testing LSA EnumAccounts\n");
 
                r.in.handle = lsa_handle;
                r.in.num_entries = 0x1000;
@@ -3468,7 +3472,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                struct lsa_EnumAccountRights r;
                struct lsa_RightSet user_rights;
 
-               printf("Testing LSA EnumAccountRights\n");
+               torture_comment(tctx, "Testing LSA EnumAccountRights\n");
 
                r.in.handle = lsa_handle;
                r.in.sid = user_sid;
@@ -3487,7 +3491,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
        {
                struct lsa_OpenAccount r;
 
-               printf("Testing LSA OpenAccount\n");
+               torture_comment(tctx, "Testing LSA OpenAccount\n");
 
                r.in.handle = lsa_handle;
                r.in.sid = user_sid;
@@ -3503,7 +3507,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                struct lsa_GetSystemAccessAccount r;
                uint32_t access_mask;
 
-               printf("Testing LSA GetSystemAccessAccount\n");
+               torture_comment(tctx, "Testing LSA GetSystemAccessAccount\n");
 
                r.in.handle = &lsa_acct_handle;
                r.out.access_mask = &access_mask;
@@ -3516,7 +3520,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
        {
                struct lsa_DeleteObject r;
 
-               printf("Testing LSA DeleteObject\n");
+               torture_comment(tctx, "Testing LSA DeleteObject\n");
 
                r.in.handle = &lsa_acct_handle;
                r.out.handle = &lsa_acct_handle;
@@ -3533,7 +3537,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                int i;
                bool found_sid = false;
 
-               printf("Testing LSA EnumAccounts\n");
+               torture_comment(tctx, "Testing LSA EnumAccounts\n");
 
                r.in.handle = lsa_handle;
                r.in.num_entries = 0x1000;
@@ -3559,7 +3563,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
                struct lsa_EnumAccountRights r;
                struct lsa_RightSet user_rights;
 
-               printf("Testing LSA EnumAccountRights\n");
+               torture_comment(tctx, "Testing LSA EnumAccountRights\n");
 
                r.in.handle = lsa_handle;
                r.in.sid = user_sid;
@@ -3836,8 +3840,9 @@ static bool test_alias_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
                ret = false;
        }
 
-       if (torture_setting_bool(tctx, "samba4", false)) {
-               printf("skipping MultipleMembers Alias tests against Samba4\n");
+       if (torture_setting_bool(tctx, "samba3", false) ||
+           torture_setting_bool(tctx, "samba4", false)) {
+               printf("skipping MultipleMembers Alias tests against Samba\n");
                return ret;
        }
 
@@ -4372,7 +4377,7 @@ static bool test_CreateUser2(struct dcerpc_pipe *p, struct torture_context *tctx
                { ACB_SVRTRUST, TEST_MACHINENAME, NT_STATUS_OK },
                { ACB_SVRTRUST | ACB_DISABLED, TEST_MACHINENAME, NT_STATUS_INVALID_PARAMETER },
                { ACB_SVRTRUST | ACB_PWNOEXP, TEST_MACHINENAME, NT_STATUS_INVALID_PARAMETER },
-               { ACB_DOMTRUST, TEST_DOMAINNAME, NT_STATUS_OK },
+               { ACB_DOMTRUST, TEST_DOMAINNAME, NT_STATUS_ACCESS_DENIED },
                { ACB_DOMTRUST | ACB_DISABLED, TEST_DOMAINNAME, NT_STATUS_INVALID_PARAMETER },
                { ACB_DOMTRUST | ACB_PWNOEXP, TEST_DOMAINNAME, NT_STATUS_INVALID_PARAMETER },
                { 0, TEST_ACCOUNT_NAME, NT_STATUS_INVALID_PARAMETER },
@@ -5587,7 +5592,9 @@ static bool test_QueryDomainInfo(struct dcerpc_pipe *p, struct torture_context *
                        if (strcmp(info->general.oem_information.string, domain_comment) != 0) {
                                printf("QueryDomainInfo level %u returned different oem_information (comment) (%s, expected %s)\n",
                                       levels[i], info->general.oem_information.string, domain_comment);
-                               ret = false;
+                               if (!torture_setting_bool(tctx, "samba3", false)) {
+                                       ret = false;
+                               }
                        }
                        if (!info->general.primary.string) {
                                printf("QueryDomainInfo level %u returned no PDC name\n",
@@ -5604,7 +5611,9 @@ static bool test_QueryDomainInfo(struct dcerpc_pipe *p, struct torture_context *
                        if (strcmp(info->oem.oem_information.string, domain_comment) != 0) {
                                printf("QueryDomainInfo level %u returned different oem_information (comment) (%s, expected %s)\n",
                                       levels[i], info->oem.oem_information.string, domain_comment);
-                               ret = false;
+                               if (!torture_setting_bool(tctx, "samba3", false)) {
+                                       ret = false;
+                               }
                        }
                        break;
                case 6:
@@ -5618,7 +5627,9 @@ static bool test_QueryDomainInfo(struct dcerpc_pipe *p, struct torture_context *
                        if (strcmp(info->general2.general.oem_information.string, domain_comment) != 0) {
                                printf("QueryDomainInfo level %u returned different comment (%s, expected %s)\n",
                                       levels[i], info->general2.general.oem_information.string, domain_comment);
-                               ret = false;
+                               if (!torture_setting_bool(tctx, "samba3", false)) {
+                                       ret = false;
+                               }
                        }
                        break;
                }
@@ -5898,6 +5909,8 @@ static bool test_AddGroupMember(struct dcerpc_pipe *p, struct torture_context *t
        struct samr_RidTypeArray *rids = NULL;
        struct samr_SetMemberAttributesOfGroup s;
        uint32_t rid;
+       bool found_member = false;
+       int i;
 
        status = test_LookupName(p, tctx, domain_handle, TEST_ACCOUNT_NAME, &rid);
        torture_assert_ntstatus_ok(tctx, status, "test_AddGroupMember looking up name " TEST_ACCOUNT_NAME);
@@ -5906,7 +5919,7 @@ static bool test_AddGroupMember(struct dcerpc_pipe *p, struct torture_context *t
        r.in.rid = rid;
        r.in.flags = 0; /* ??? */
 
-       torture_comment(tctx, "Testing AddGroupMember and DeleteGroupMember\n");
+       torture_comment(tctx, "Testing AddGroupMember, QueryGroupMember and DeleteGroupMember\n");
 
        d.in.group_handle = group_handle;
        d.in.rid = rid;
@@ -5922,7 +5935,7 @@ static bool test_AddGroupMember(struct dcerpc_pipe *p, struct torture_context *t
 
        if (torture_setting_bool(tctx, "samba4", false) ||
            torture_setting_bool(tctx, "samba3", false)) {
-               torture_comment(tctx, "skipping SetMemberAttributesOfGroup test against Samba4\n");
+               torture_comment(tctx, "skipping SetMemberAttributesOfGroup test against Samba\n");
        } else {
                /* this one is quite strange. I am using random inputs in the
                   hope of triggering an error that might give us a clue */
@@ -5940,10 +5953,34 @@ static bool test_AddGroupMember(struct dcerpc_pipe *p, struct torture_context *t
 
        status = dcerpc_samr_QueryGroupMember(p, tctx, &q);
        torture_assert_ntstatus_ok(tctx, status, "QueryGroupMember");
+       torture_assert(tctx, rids, "QueryGroupMember did not fill in rids structure");
+
+       for (i=0; i < rids->count; i++) {
+               if (rids->rids[i] == rid) {
+                       found_member = true;
+               }
+       }
+
+       torture_assert(tctx, found_member, "QueryGroupMember did not list newly added member");
 
        status = dcerpc_samr_DeleteGroupMember(p, tctx, &d);
        torture_assert_ntstatus_ok(tctx, status, "DeleteGroupMember");
 
+       rids = NULL;
+       found_member = false;
+
+       status = dcerpc_samr_QueryGroupMember(p, tctx, &q);
+       torture_assert_ntstatus_ok(tctx, status, "QueryGroupMember");
+       torture_assert(tctx, rids, "QueryGroupMember did not fill in rids structure");
+
+       for (i=0; i < rids->count; i++) {
+               if (rids->rids[i] == rid) {
+                       found_member = true;
+               }
+       }
+
+       torture_assert(tctx, !found_member, "QueryGroupMember does still list removed member");
+
        status = dcerpc_samr_AddGroupMember(p, tctx, &r);
        torture_assert_ntstatus_ok(tctx, status, "AddGroupMember");
 
@@ -6056,7 +6093,7 @@ static bool test_EnumDomainUsers(struct dcerpc_pipe *p,
        struct samr_SamArray *sam;
 
        r.in.domain_handle = domain_handle;
-       r.in.acct_flags = ACB_NORMAL;
+       r.in.acct_flags = 0;
        r.in.max_size = (uint32_t)-1;
        r.in.resume_handle = &resume_handle;
 
@@ -6161,6 +6198,77 @@ static bool test_EnumDomainAliases(struct dcerpc_pipe *p,
        return true;
 }
 
+static bool test_QueryDisplayInfo_level(struct dcerpc_pipe *p,
+                                       struct torture_context *tctx,
+                                       struct policy_handle *handle,
+                                       uint16_t level,
+                                       uint32_t *total_num_entries_p)
+{
+       NTSTATUS status;
+       struct samr_QueryDisplayInfo r;
+       uint32_t total_num_entries = 0;
+
+       r.in.domain_handle = handle;
+       r.in.level = level;
+       r.in.start_idx = 0;
+       r.in.max_entries = (uint32_t)-1;
+       r.in.buf_size = (uint32_t)-1;
+
+       printf("Testing QueryDisplayInfo\n");
+
+       do {
+               uint32_t total_size;
+               uint32_t returned_size;
+               union samr_DispInfo info;
+
+               r.out.total_size = &total_size;
+               r.out.returned_size = &returned_size;
+               r.out.info = &info;
+
+               status = dcerpc_samr_QueryDisplayInfo(p, tctx, &r);
+               if (NT_STATUS_IS_ERR(status)) {
+                       torture_assert_ntstatus_ok(tctx, status,
+                               "failed to query displayinfo");
+               }
+
+               if (*r.out.returned_size == 0) {
+                       break;
+               }
+
+               switch (r.in.level) {
+               case 1:
+                       total_num_entries += info.info1.count;
+                       r.in.start_idx += info.info1.entries[info.info1.count - 1].idx + 1;
+                       break;
+               case 2:
+                       total_num_entries += info.info2.count;
+                       r.in.start_idx += info.info2.entries[info.info2.count - 1].idx + 1;
+                       break;
+               case 3:
+                       total_num_entries += info.info3.count;
+                       r.in.start_idx += info.info3.entries[info.info3.count - 1].idx + 1;
+                       break;
+               case 4:
+                       total_num_entries += info.info4.count;
+                       r.in.start_idx += info.info4.entries[info.info4.count - 1].idx + 1;
+                       break;
+               case 5:
+                       total_num_entries += info.info5.count;
+                       r.in.start_idx += info.info5.entries[info.info5.count - 1].idx + 1;
+                       break;
+               default:
+                       return false;
+               }
+
+       } while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
+
+       if (total_num_entries_p) {
+               *total_num_entries_p = total_num_entries;
+       }
+
+       return true;
+}
+
 static bool test_ManyObjects(struct dcerpc_pipe *p,
                             struct torture_context *tctx,
                             struct policy_handle *domain_handle,
@@ -6177,7 +6285,7 @@ static bool test_ManyObjects(struct dcerpc_pipe *p,
        uint32_t i;
 
        struct policy_handle *handles = talloc_zero_array(tctx, struct policy_handle, num_total);
-       
+
        /* query */
 
        {
@@ -6249,21 +6357,23 @@ static bool test_ManyObjects(struct dcerpc_pipe *p,
                return false;
        }
 
-       /* TODO: dispinfo */
+       /* dispinfo */
 
        switch (which_ops) {
        case TORTURE_SAMR_MANY_ACCOUNTS:
+               ret &= test_QueryDisplayInfo_level(p, tctx, domain_handle, 1, &num_disp);
                break;
        case TORTURE_SAMR_MANY_GROUPS:
+               ret &= test_QueryDisplayInfo_level(p, tctx, domain_handle, 3, &num_disp);
                break;
        case TORTURE_SAMR_MANY_ALIASES:
+               /* no aliases in dispinfo */
                break;
        default:
                return false;
        }
 
-
-       /* delete */
+       /* close or delete */
 
        for (i=0; i < num_total; i++) {
 
@@ -6271,29 +6381,36 @@ static bool test_ManyObjects(struct dcerpc_pipe *p,
                        continue;
                }
 
-               switch (which_ops) {
-               case TORTURE_SAMR_MANY_ACCOUNTS:
-                       ret &= test_DeleteUser(p, tctx, &handles[i]);
-                       break;
-               case TORTURE_SAMR_MANY_GROUPS:
-                       ret &= test_DeleteDomainGroup(p, tctx, &handles[i]);
-                       break;
-               case TORTURE_SAMR_MANY_ALIASES:
-                       ret &= test_DeleteAlias(p, tctx, &handles[i]);
-                       break;
-               default:
-                       return false;
+               if (torture_setting_bool(tctx, "samba3", false)) {
+                       ret &= test_samr_handle_Close(p, tctx, &handles[i]);
+               } else {
+                       switch (which_ops) {
+                       case TORTURE_SAMR_MANY_ACCOUNTS:
+                               ret &= test_DeleteUser(p, tctx, &handles[i]);
+                               break;
+                       case TORTURE_SAMR_MANY_GROUPS:
+                               ret &= test_DeleteDomainGroup(p, tctx, &handles[i]);
+                               break;
+                       case TORTURE_SAMR_MANY_ALIASES:
+                               ret &= test_DeleteAlias(p, tctx, &handles[i]);
+                               break;
+                       default:
+                               return false;
+                       }
                }
        }
 
        talloc_free(handles);
 
-#if 0
-       torture_assert_int_equal(tctx, num_disp, num_anounced + num_created,
-               "unexpected number of results returned in dispinfo call");
-#endif
-       torture_assert_int_equal(tctx, num_enum, num_anounced + num_created,
-               "unexpected number of results returned in enum call");
+       if (which_ops == TORTURE_SAMR_MANY_ACCOUNTS && num_enum != num_anounced + num_created) {
+               torture_comment(tctx,
+                               "unexpected number of results (%u) returned in enum call, expected %u\n",
+                               num_enum, num_anounced + num_created);
+
+               torture_comment(tctx,
+                               "unexpected number of results (%u) returned in dispinfo, call, expected %u\n",
+                               num_disp, num_anounced + num_created);
+       }
        return ret;
 }
 
@@ -6330,7 +6447,7 @@ static bool test_OpenDomain(struct dcerpc_pipe *p, struct torture_context *tctx,
 
        /* run the domain tests with the main handle closed - this tests
           the servers reference counting */
-       ret &= test_samr_handle_Close(p, tctx, handle);
+       torture_assert(tctx, test_samr_handle_Close(p, tctx, handle), "Failed to close SAMR handle");
 
        switch (which_ops) {
        case TORTURE_SAMR_PASSWORDS:
@@ -6339,6 +6456,9 @@ static bool test_OpenDomain(struct dcerpc_pipe *p, struct torture_context *tctx,
                        ret &= test_CreateUser2(p, tctx, &domain_handle, sid, which_ops, NULL);
                }
                ret &= test_CreateUser(p, tctx, &domain_handle, TEST_ACCOUNT_NAME, &user_handle, sid, which_ops, NULL, true);
+               if (!ret) {
+                       printf("Testing PASSWORDS or PRIVILAGES on domain %s failed!\n", dom_sid_string(tctx, sid));
+               }
                break;
        case TORTURE_SAMR_USER_ATTRIBUTES:
                if (!torture_setting_bool(tctx, "samba3", false)) {
@@ -6348,7 +6468,7 @@ static bool test_OpenDomain(struct dcerpc_pipe *p, struct torture_context *tctx,
                /* This test needs 'complex' users to validate */
                ret &= test_QueryDisplayInfo(p, tctx, &domain_handle);
                if (!ret) {
-                       printf("Testing PASSWORDS or ATTRIBUTES on domain %s failed!\n", dom_sid_string(tctx, sid));
+                       printf("Testing ATTRIBUTES on domain %s failed!\n", dom_sid_string(tctx, sid));
                }
                break;
        case TORTURE_SAMR_PASSWORDS_PWDLASTSET:
@@ -6364,6 +6484,9 @@ static bool test_OpenDomain(struct dcerpc_pipe *p, struct torture_context *tctx,
        case TORTURE_SAMR_MANY_GROUPS:
        case TORTURE_SAMR_MANY_ALIASES:
                ret &= test_ManyObjects(p, tctx, &domain_handle, sid, which_ops);
+               if (!ret) {
+                       printf("Testing MANY-{ACCOUNTS,GROUPS,ALIASES} on domain %s failed!\n", dom_sid_string(tctx, sid));
+               }
                break;
        case TORTURE_SAMR_OTHER:
                ret &= test_CreateUser(p, tctx, &domain_handle, TEST_ACCOUNT_NAME, &user_handle, sid, which_ops, NULL, true);
@@ -6417,10 +6540,10 @@ static bool test_OpenDomain(struct dcerpc_pipe *p, struct torture_context *tctx,
                ret = false;
        }
 
-       ret &= test_samr_handle_Close(p, tctx, &domain_handle);
+       torture_assert(tctx, test_samr_handle_Close(p, tctx, &domain_handle), "Failed to close SAMR domain handle");
 
+       torture_assert(tctx, test_Connect(p, tctx, handle), "Faile to re-connect SAMR handle");
        /* reconnect the main handle */
-       ret &= test_Connect(p, tctx, handle);
 
        if (!ret) {
                printf("Testing domain %s failed!\n", dom_sid_string(tctx, sid));
@@ -6744,7 +6867,7 @@ struct torture_suite *torture_rpc_samr_passwords_pwdlastset(TALLOC_CTX *mem_ctx)
        struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR-PASSWORDS-PWDLASTSET");
        struct torture_rpc_tcase *tcase;
 
-       tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "samr",
+       tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "samr",
                                                          &ndr_table_samr,
                                                          TEST_ACCOUNT_NAME_PWD);
 
@@ -6784,7 +6907,7 @@ struct torture_suite *torture_rpc_samr_user_privileges(TALLOC_CTX *mem_ctx)
        struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR-USERS-PRIVILEGES");
        struct torture_rpc_tcase *tcase;
 
-       tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "samr",
+       tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "samr",
                                                          &ndr_table_samr,
                                                          TEST_ACCOUNT_NAME_PWD);
 
@@ -6874,7 +6997,7 @@ struct torture_suite *torture_rpc_samr_large_dc(TALLOC_CTX *mem_ctx)
        struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR-LARGE-DC");
        struct torture_rpc_tcase *tcase;
 
-       tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "samr",
+       tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "samr",
                                                          &ndr_table_samr,
                                                          TEST_ACCOUNT_NAME);