s4-torture: use a real cluster group handle in cluster resource tests.
authorGünther Deschner <gd@samba.org>
Fri, 6 Mar 2015 12:51:34 +0000 (13:51 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 13 Mar 2015 22:58:08 +0000 (23:58 +0100)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/torture/rpc/clusapi.c

index 666967adfb83bce9da34fcfb2668d18e9c9104fc..ea4104f899d6d70fdc28c07167162cdfa531d3b1 100644 (file)
@@ -349,19 +349,28 @@ static bool test_CloseResource(struct torture_context *tctx,
        return test_CloseResource_int(tctx, p, &hResource);
 }
 
+static bool test_OpenGroup_int(struct torture_context *tctx,
+                              struct dcerpc_pipe *p,
+                              struct policy_handle *hGroup);
+static bool test_CloseGroup_int(struct torture_context *tctx,
+                               struct dcerpc_pipe *p,
+                               struct policy_handle *Group);
+
 static bool test_CreateResource_int(struct torture_context *tctx,
                                    struct dcerpc_pipe *p,
                                    struct policy_handle *hResource)
 {
        struct dcerpc_binding_handle *b = p->binding_handle;
        struct clusapi_CreateResource r;
-       const char *lpszResourceName = "Cluster Name";
-       const char *lpszResourceType = "wurst";
+       const char *lpszResourceName = "wurst";
+       const char *lpszResourceType = "Generic Service";
        WERROR Status;
        WERROR rpc_status;
        struct policy_handle hGroup;
 
-       ZERO_STRUCT(hGroup); /* FIXME !!!!!! */
+       torture_assert(tctx,
+               test_OpenGroup_int(tctx, p, &hGroup),
+               "failed to open group");
 
        r.in.hGroup = hGroup;
        r.in.lpszResourceName = lpszResourceName;
@@ -378,6 +387,8 @@ static bool test_CreateResource_int(struct torture_context *tctx,
                *r.out.Status,
                "CreateResource failed");
 
+       test_CloseGroup_int(tctx, p, &hGroup);
+
        return true;
 }