summaryrefslogtreecommitdiff
path: root/source4/torture/rap
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/rap')
-rw-r--r--source4/torture/rap/sam.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/source4/torture/rap/sam.c b/source4/torture/rap/sam.c
index 53b0512c2d..7b97a08120 100644
--- a/source4/torture/rap/sam.c
+++ b/source4/torture/rap/sam.c
@@ -186,8 +186,9 @@ static bool test_oemchangepassword(struct torture_context *tctx,
return ret;
}
-static bool test_usergetinfo(struct torture_context *tctx,
- struct smbcli_state *cli)
+static bool test_usergetinfo_byname(struct torture_context *tctx,
+ struct smbcli_state *cli,
+ const char *UserName)
{
struct rap_NetUserGetInfo r;
int i;
@@ -195,7 +196,7 @@ static bool test_usergetinfo(struct torture_context *tctx,
for (i=0; i < ARRAY_SIZE(levels); i++) {
- r.in.UserName = TEST_RAP_USER;
+ r.in.UserName = UserName;
r.in.level = levels[i];
r.in.bufsize = 8192;
@@ -210,6 +211,29 @@ static bool test_usergetinfo(struct torture_context *tctx,
return true;
}
+static bool test_usergetinfo(struct torture_context *tctx,
+ struct smbcli_state *cli)
+{
+
+ struct test_join *join_ctx;
+ const char *password;
+ bool ret;
+
+ join_ctx = torture_create_testuser_max_pwlen(tctx, TEST_RAP_USER,
+ torture_setting_string(tctx, "workgroup", NULL),
+ ACB_NORMAL,
+ &password, 14);
+ if (join_ctx == NULL) {
+ torture_fail(tctx, "failed to create user\n");
+ }
+
+ ret = test_usergetinfo_byname(tctx, cli, TEST_RAP_USER);
+
+ torture_leave_domain(tctx, join_ctx);
+
+ return ret;
+}
+
struct torture_suite *torture_rap_sam(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite = torture_suite_create(mem_ctx, "SAM");