mirror of
https://github.com/samba-team/samba.git
synced 2025-03-26 18:50:30 +03:00
s4-torture: add test for GetResourceNetworkName.
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: José A. Rivera <jarrpa@samba.org>
This commit is contained in:
parent
bc144409bc
commit
e68ce4b10f
@ -1014,6 +1014,48 @@ static bool test_GetResourceDependencyExpression(struct torture_context *tctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool test_GetResourceNetworkName_int(struct torture_context *tctx,
|
||||
struct dcerpc_pipe *p,
|
||||
struct policy_handle *hResource)
|
||||
{
|
||||
struct dcerpc_binding_handle *b = p->binding_handle;
|
||||
struct clusapi_GetResourceNetworkName r;
|
||||
const char *lpszName;
|
||||
WERROR rpc_status;
|
||||
|
||||
r.in.hResource = *hResource;
|
||||
r.out.lpszName = &lpszName;
|
||||
r.out.rpc_status = &rpc_status;
|
||||
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_clusapi_GetResourceNetworkName_r(b, tctx, &r),
|
||||
"GetResourceNetworkName failed");
|
||||
torture_assert_werr_ok(tctx,
|
||||
r.out.result,
|
||||
"GetResourceNetworkName failed");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_GetResourceNetworkName(struct torture_context *tctx,
|
||||
void *data)
|
||||
{
|
||||
struct torture_clusapi_context *t =
|
||||
talloc_get_type_abort(data, struct torture_clusapi_context);
|
||||
struct policy_handle hResource;
|
||||
bool ret = true;
|
||||
|
||||
if (!test_OpenResource_int(tctx, t->p, "Network Name", &hResource)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = test_GetResourceNetworkName_int(tctx, t->p, &hResource);
|
||||
|
||||
test_CloseResource_int(tctx, t->p, &hResource);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool test_one_resource(struct torture_context *tctx,
|
||||
struct dcerpc_pipe *p,
|
||||
const char *resource_name)
|
||||
@ -1044,6 +1086,9 @@ static bool test_one_resource(struct torture_context *tctx,
|
||||
torture_assert(tctx,
|
||||
test_GetResourceDependencyExpression_int(tctx, p, &hResource),
|
||||
"failed to query resource dependency expression");
|
||||
torture_assert(tctx,
|
||||
test_GetResourceNetworkName_int(tctx, p, &hResource),
|
||||
"failed to query resource network name");
|
||||
|
||||
test_CloseResource_int(tctx, p, &hResource);
|
||||
|
||||
@ -3004,6 +3049,8 @@ void torture_tcase_resource(struct torture_tcase *tcase)
|
||||
test->dangerous = true;
|
||||
torture_tcase_add_simple_test(tcase, "GetResourceDependencyExpression",
|
||||
test_GetResourceDependencyExpression);
|
||||
torture_tcase_add_simple_test(tcase, "GetResourceNetworkName",
|
||||
test_GetResourceNetworkName);
|
||||
torture_tcase_add_simple_test(tcase, "all_resources",
|
||||
test_all_resources);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user