s4-smbtorture: add test for NetUserSetInfo level 0 (user rename).
authorGünther Deschner <gd@samba.org>
Tue, 16 Jun 2009 23:30:22 +0000 (01:30 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 16 Jun 2009 23:30:22 +0000 (01:30 +0200)
Guenther

source4/torture/libnetapi/libnetapi_user.c

index 726998816379b16940560aef36c949b3bd562a38..2731cbd77291367c180bd13c1a282e8888b44bda 100644 (file)
@@ -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;