From fbe85c70ef0aed6ff3c20585ae1f001c0417665c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 17 Jun 2009 01:30:22 +0200 Subject: s4-smbtorture: add test for NetUserSetInfo level 0 (user rename). Guenther --- source4/torture/libnetapi/libnetapi_user.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/torture/libnetapi/libnetapi_user.c b/source4/torture/libnetapi/libnetapi_user.c index 7269988163..2731cbd772 100644 --- a/source4/torture/libnetapi/libnetapi_user.c +++ b/source4/torture/libnetapi/libnetapi_user.c @@ -349,6 +349,7 @@ bool torture_libnetapi_user(struct torture_context *tctx) uint32_t getgr_levels[] = { 0, 1 }; int i; + struct USER_INFO_0 u0; struct USER_INFO_1007 u1007; uint32_t parm_err = 0; @@ -430,11 +431,21 @@ bool torture_libnetapi_user(struct torture_context *tctx) } } + torture_comment(tctx, "testing NetUserSetInfo level 0\n"); + + u0.usri0_name = TORTURE_TEST_USER2; + + status = NetUserSetInfo(hostname, TORTURE_TEST_USER, 0, (uint8_t *)&u0, &parm_err); + if (status) { + NETAPI_STATUS(tctx, ctx, status, "NetUserSetInfo"); + goto out; + } + /* delete */ torture_comment(tctx, "testing NetUserDel\n"); - status = NetUserDel(hostname, TORTURE_TEST_USER); + status = NetUserDel(hostname, TORTURE_TEST_USER2); if (status) { NETAPI_STATUS(tctx, ctx, status, "NetUserDel"); goto out; @@ -442,7 +453,7 @@ bool torture_libnetapi_user(struct torture_context *tctx) /* should not exist anymore */ - status = NetUserGetInfo(hostname, TORTURE_TEST_USER, 0, &buffer); + status = NetUserGetInfo(hostname, TORTURE_TEST_USER2, 0, &buffer); if (status == 0) { NETAPI_STATUS(tctx, ctx, status, "NetUserGetInfo"); status = -1; -- cgit