summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-05-27 13:25:31 +0200
committerGünther Deschner <gd@samba.org>2010-05-27 13:37:28 +0200
commita1fc7aebfc327c3553be47c44048c7c458316a25 (patch)
treed8914cd1e7a50b8cd774054c906776e6f94ebbe5 /source4
parentdd895e526c4751865c587819d9e958c8fce9190b (diff)
downloadsamba-a1fc7aebfc327c3553be47c44048c7c458316a25.tar.gz
samba-a1fc7aebfc327c3553be47c44048c7c458316a25.tar.bz2
samba-a1fc7aebfc327c3553be47c44048c7c458316a25.zip
s4-smbtorture: create the user to test in test_usergetinfo() in RAP-SAM.
Guenther
Diffstat (limited to 'source4')
-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");