s4-smbtorture: split RPC-SAMR-ACCESSMASK into several tests.
authorGünther Deschner <gd@samba.org>
Wed, 13 May 2009 13:14:20 +0000 (15:14 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 13 May 2009 13:19:40 +0000 (15:19 +0200)
Guenther

source4/torture/rpc/samr_accessmask.c

index 7b39d2b9fb9eaab7473be502fe98fe53112a8e70..1e74455849cea45e9690aa895f89f393121d9330 100644 (file)
@@ -588,6 +588,10 @@ static bool test_samr_connect(struct torture_context *tctx,
        bool ret = true;
        const struct dom_sid *test_sid;
 
+       if (torture_setting_bool(tctx, "samba3", false)) {
+               torture_skip(tctx, "Skipping test against Samba 3");
+       }
+
        /* create a test user */
        testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(tctx->lp_ctx),
                                           ACB_NORMAL, &testuser_passwd);
@@ -604,38 +608,6 @@ static bool test_samr_connect(struct torture_context *tctx,
        test_sid = torture_join_user_sid(testuser);
 
 
-       /* test which bits in the accessmask to Connect5
-          will allow us to connect to the server
-       */
-       if (!test_samr_accessmask_Connect5(tctx, p)) {
-               ret = false;
-       }
-
-
-       /* test which bits in the accessmask to Connect5 will allow
-        * us to call EnumDomains()
-        */
-       if (!test_samr_accessmask_EnumDomains(tctx, p)) {
-               ret = false;
-       }
-
-       /* test which bits in the accessmask to Connect5 will allow
-        * us to call LookupDomain()
-        */
-       if (!test_samr_accessmask_LookupDomain(tctx, p)) {
-               ret = false;
-       }
-
-
-       /* test which bits in the accessmask to Connect5 will allow
-        * us to call OpenDomain()
-        */
-       if (!test_samr_accessmask_OpenDomain(tctx, p)) {
-               ret = false;
-       }
-
-       if (!torture_setting_bool(tctx, "samba3", false)) {
-
        /* test if ACLs can be changed for the policy handle
         * returned by Connect5
         */
@@ -657,8 +629,6 @@ static bool test_samr_connect(struct torture_context *tctx,
                ret = false;
        }
 
-       }
-
        /* remove the test user */
        torture_leave_domain(tctx, testuser);
 
@@ -675,5 +645,25 @@ struct torture_suite *torture_rpc_samr_accessmask(TALLOC_CTX *mem_ctx)
 
        torture_rpc_tcase_add_test(tcase, "CONNECT", test_samr_connect);
 
+       /* test which bits in the accessmask to Connect5 will allow
+        * us to call OpenDomain() */
+       torture_rpc_tcase_add_test(tcase, "OpenDomain",
+                                  test_samr_accessmask_OpenDomain);
+
+       /* test which bits in the accessmask to Connect5 will allow
+        * us to call LookupDomain() */
+       torture_rpc_tcase_add_test(tcase, "LookupDomain",
+                                  test_samr_accessmask_LookupDomain);
+
+       /* test which bits in the accessmask to Connect5 will allow
+        * us to call EnumDomains() */
+       torture_rpc_tcase_add_test(tcase, "EnumDomains",
+                                  test_samr_accessmask_EnumDomains);
+
+       /* test which bits in the accessmask to Connect5
+          will allow us to connect to the server */
+       torture_rpc_tcase_add_test(tcase, "Connect5",
+                                  test_samr_accessmask_Connect5);
+
        return suite;
 }