|
|
bb7cd1 |
From 510971d2abc3b76799048cd608511d693f5c3edc Mon Sep 17 00:00:00 2001
|
|
|
bb7cd1 |
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
|
|
|
bb7cd1 |
Date: Wed, 1 Mar 2017 08:33:06 +0000
|
|
|
bb7cd1 |
Subject: [PATCH 45/54] NSS/TESTS: Include searches for non-fqnames members of
|
|
|
bb7cd1 |
a subdomain
|
|
|
bb7cd1 |
MIME-Version: 1.0
|
|
|
bb7cd1 |
Content-Type: text/plain; charset=UTF-8
|
|
|
bb7cd1 |
Content-Transfer-Encoding: 8bit
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
Let's extend the NSS tests in order to also test looking up users, from
|
|
|
bb7cd1 |
a subdomain, by their short names (non fully qualified names).
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
Related:
|
|
|
bb7cd1 |
https://pagure.io/SSSD/sssd/issue/3001
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
|
|
bb7cd1 |
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
|
|
|
bb7cd1 |
---
|
|
|
bb7cd1 |
src/tests/cmocka/test_nss_srv.c | 246 ++++++++++++++++++++++++++++++++++------
|
|
|
bb7cd1 |
1 file changed, 211 insertions(+), 35 deletions(-)
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
diff --git a/src/tests/cmocka/test_nss_srv.c b/src/tests/cmocka/test_nss_srv.c
|
|
|
bb7cd1 |
index b468204fb1729618830513322f0d901c4c801e94..ede72b341b60842ad470df2794aa90ea9797e999 100644
|
|
|
bb7cd1 |
--- a/src/tests/cmocka/test_nss_srv.c
|
|
|
bb7cd1 |
+++ b/src/tests/cmocka/test_nss_srv.c
|
|
|
bb7cd1 |
@@ -1648,16 +1648,29 @@ static int test_nss_getgrnam_members_check_subdom(uint32_t status,
|
|
|
bb7cd1 |
tmp_ctx = talloc_new(nss_test_ctx);
|
|
|
bb7cd1 |
assert_non_null(tmp_ctx);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
- exp_members[0] = sss_tc_fqname(tmp_ctx, nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->subdom, submember1.pw_name);
|
|
|
bb7cd1 |
- assert_non_null(exp_members[0]);
|
|
|
bb7cd1 |
- exp_members[1] = sss_tc_fqname(tmp_ctx, nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->subdom, submember2.pw_name);
|
|
|
bb7cd1 |
- assert_non_null(exp_members[1]);
|
|
|
bb7cd1 |
+ if (nss_test_ctx->subdom->fqnames) {
|
|
|
bb7cd1 |
+ exp_members[0] = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ submember1.pw_name);
|
|
|
bb7cd1 |
+ assert_non_null(exp_members[0]);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
- expected.gr_name = sss_tc_fqname(tmp_ctx, nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->subdom, testsubdomgroup.gr_name);
|
|
|
bb7cd1 |
- assert_non_null(expected.gr_name);
|
|
|
bb7cd1 |
+ exp_members[1] = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ submember2.pw_name);
|
|
|
bb7cd1 |
+ assert_non_null(exp_members[1]);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ expected.gr_name = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ testsubdomgroup.gr_name);
|
|
|
bb7cd1 |
+ assert_non_null(expected.gr_name);
|
|
|
bb7cd1 |
+ } else {
|
|
|
bb7cd1 |
+ exp_members[0] = submember1.pw_name;
|
|
|
bb7cd1 |
+ exp_members[1] = submember2.pw_name;
|
|
|
bb7cd1 |
+ expected.gr_name = testsubdomgroup.gr_name;
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
assert_int_equal(status, EOK);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
@@ -1692,6 +1705,29 @@ void test_nss_getgrnam_members_subdom(void **state)
|
|
|
bb7cd1 |
assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
}
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
+void test_nss_getgrnam_members_subdom_nonfqnames(void **state)
|
|
|
bb7cd1 |
+{
|
|
|
bb7cd1 |
+ errno_t ret;
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->fqnames = false;
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ mock_input_user_or_group("testsubdomgroup");
|
|
|
bb7cd1 |
+ mock_account_recv_simple();
|
|
|
bb7cd1 |
+ will_return(__wrap_sss_packet_get_cmd, SSS_NSS_GETGRNAM);
|
|
|
bb7cd1 |
+ will_return_always(__wrap_sss_packet_get_body, WRAP_CALL_REAL);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Query for that group, call a callback when command finishes */
|
|
|
bb7cd1 |
+ set_cmd_cb(test_nss_getgrnam_members_check_subdom);
|
|
|
bb7cd1 |
+ ret = sss_cmd_execute(nss_test_ctx->cctx, SSS_NSS_GETGRNAM,
|
|
|
bb7cd1 |
+ nss_test_ctx->nss_cmds);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Wait until the test finishes with EOK */
|
|
|
bb7cd1 |
+ ret = test_ev_loop(nss_test_ctx->tctx);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+}
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
static int test_nss_getgrnam_check_mix_dom(uint32_t status,
|
|
|
bb7cd1 |
uint8_t *body, size_t blen)
|
|
|
bb7cd1 |
{
|
|
|
bb7cd1 |
@@ -1710,9 +1746,15 @@ static int test_nss_getgrnam_check_mix_dom(uint32_t status,
|
|
|
bb7cd1 |
tmp_ctx = talloc_new(nss_test_ctx);
|
|
|
bb7cd1 |
assert_non_null(tmp_ctx);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
- exp_members[0] = sss_tc_fqname(tmp_ctx, nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->subdom, submember1.pw_name);
|
|
|
bb7cd1 |
- assert_non_null(exp_members[0]);
|
|
|
bb7cd1 |
+ if (nss_test_ctx->subdom->fqnames) {
|
|
|
bb7cd1 |
+ exp_members[0] = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ submember1.pw_name);
|
|
|
bb7cd1 |
+ assert_non_null(exp_members[0]);
|
|
|
bb7cd1 |
+ } else {
|
|
|
bb7cd1 |
+ exp_members[0] = submember1.pw_name;
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
exp_members[1] = testmember1.pw_name;
|
|
|
bb7cd1 |
exp_members[2] = testmember2.pw_name;
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
@@ -1756,6 +1798,35 @@ void test_nss_getgrnam_mix_dom(void **state)
|
|
|
bb7cd1 |
assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
}
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
+void test_nss_getgrnam_mix_dom_nonfqnames(void **state)
|
|
|
bb7cd1 |
+{
|
|
|
bb7cd1 |
+ errno_t ret;
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->fqnames = false;
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ ret = store_group_member(nss_test_ctx,
|
|
|
bb7cd1 |
+ testgroup_members.gr_name,
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom,
|
|
|
bb7cd1 |
+ submember1.pw_name,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ SYSDB_MEMBER_USER);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ mock_input_user_or_group("testgroup_members");
|
|
|
bb7cd1 |
+ will_return(__wrap_sss_packet_get_cmd, SSS_NSS_GETGRNAM);
|
|
|
bb7cd1 |
+ will_return_always(__wrap_sss_packet_get_body, WRAP_CALL_REAL);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Query for that group, call a callback when command finishes */
|
|
|
bb7cd1 |
+ set_cmd_cb(test_nss_getgrnam_check_mix_dom);
|
|
|
bb7cd1 |
+ ret = sss_cmd_execute(nss_test_ctx->cctx, SSS_NSS_GETGRNAM,
|
|
|
bb7cd1 |
+ nss_test_ctx->nss_cmds);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Wait until the test finishes with EOK */
|
|
|
bb7cd1 |
+ ret = test_ev_loop(nss_test_ctx->tctx);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+}
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
static int test_nss_getgrnam_check_mix_dom_fqdn(uint32_t status,
|
|
|
bb7cd1 |
uint8_t *body, size_t blen)
|
|
|
bb7cd1 |
{
|
|
|
bb7cd1 |
@@ -1773,21 +1844,33 @@ static int test_nss_getgrnam_check_mix_dom_fqdn(uint32_t status,
|
|
|
bb7cd1 |
tmp_ctx = talloc_new(nss_test_ctx);
|
|
|
bb7cd1 |
assert_non_null(tmp_ctx);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
- exp_members[0] = sss_tc_fqname(tmp_ctx, nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->subdom, submember1.pw_name);
|
|
|
bb7cd1 |
- assert_non_null(exp_members[0]);
|
|
|
bb7cd1 |
- exp_members[1] = sss_tc_fqname(tmp_ctx, nss_test_ctx->tctx->dom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->tctx->dom, testmember1.pw_name);
|
|
|
bb7cd1 |
- assert_non_null(exp_members[1]);
|
|
|
bb7cd1 |
- exp_members[2] = sss_tc_fqname(tmp_ctx, nss_test_ctx->tctx->dom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->tctx->dom, testmember2.pw_name);
|
|
|
bb7cd1 |
- assert_non_null(exp_members[2]);
|
|
|
bb7cd1 |
+ if (nss_test_ctx->subdom->fqnames) {
|
|
|
bb7cd1 |
+ exp_members[0] = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ submember1.pw_name);
|
|
|
bb7cd1 |
+ assert_non_null(exp_members[0]);
|
|
|
bb7cd1 |
+ } else {
|
|
|
bb7cd1 |
+ exp_members[0] = submember1.pw_name;
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
+ if (nss_test_ctx->tctx->dom->fqnames) {
|
|
|
bb7cd1 |
+ exp_members[1] = sss_tc_fqname(tmp_ctx, nss_test_ctx->tctx->dom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom, testmember1.pw_name);
|
|
|
bb7cd1 |
+ assert_non_null(exp_members[1]);
|
|
|
bb7cd1 |
+ exp_members[2] = sss_tc_fqname(tmp_ctx, nss_test_ctx->tctx->dom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom, testmember2.pw_name);
|
|
|
bb7cd1 |
+ assert_non_null(exp_members[2]);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
- expected.gr_name = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
- nss_test_ctx->tctx->dom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->tctx->dom,
|
|
|
bb7cd1 |
- testgroup_members.gr_name);
|
|
|
bb7cd1 |
- assert_non_null(expected.gr_name);
|
|
|
bb7cd1 |
+ expected.gr_name = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom,
|
|
|
bb7cd1 |
+ testgroup_members.gr_name);
|
|
|
bb7cd1 |
+ assert_non_null(expected.gr_name);
|
|
|
bb7cd1 |
+ } else {
|
|
|
bb7cd1 |
+ exp_members[1] = testmember1.pw_name;
|
|
|
bb7cd1 |
+ exp_members[2] = testmember2.pw_name;
|
|
|
bb7cd1 |
+ expected.gr_name = testgroup_members.gr_name;
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
assert_int_equal(status, EOK);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
@@ -1834,6 +1917,40 @@ void test_nss_getgrnam_mix_dom_fqdn(void **state)
|
|
|
bb7cd1 |
assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
}
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
+void test_nss_getgrnam_mix_dom_fqdn_nonfqnames(void **state)
|
|
|
bb7cd1 |
+{
|
|
|
bb7cd1 |
+ errno_t ret;
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ ret = store_group_member(nss_test_ctx,
|
|
|
bb7cd1 |
+ testgroup_members.gr_name,
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom,
|
|
|
bb7cd1 |
+ submember1.pw_name,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ SYSDB_MEMBER_USER);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom->fqnames = false;
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->fqnames = false;
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ mock_input_user_or_group("testgroup_members");
|
|
|
bb7cd1 |
+ will_return(__wrap_sss_packet_get_cmd, SSS_NSS_GETGRNAM);
|
|
|
bb7cd1 |
+ will_return_always(__wrap_sss_packet_get_body, WRAP_CALL_REAL);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Query for that group, call a callback when command finishes */
|
|
|
bb7cd1 |
+ set_cmd_cb(test_nss_getgrnam_check_mix_dom_fqdn);
|
|
|
bb7cd1 |
+ ret = sss_cmd_execute(nss_test_ctx->cctx, SSS_NSS_GETGRNAM,
|
|
|
bb7cd1 |
+ nss_test_ctx->nss_cmds);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Wait until the test finishes with EOK */
|
|
|
bb7cd1 |
+ ret = test_ev_loop(nss_test_ctx->tctx);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Restore FQDN settings */
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom->fqnames = false;
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+}
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
static int test_nss_getgrnam_check_mix_subdom(uint32_t status,
|
|
|
bb7cd1 |
uint8_t *body, size_t blen)
|
|
|
bb7cd1 |
{
|
|
|
bb7cd1 |
@@ -1851,20 +1968,37 @@ static int test_nss_getgrnam_check_mix_subdom(uint32_t status,
|
|
|
bb7cd1 |
tmp_ctx = talloc_new(nss_test_ctx);
|
|
|
bb7cd1 |
assert_non_null(tmp_ctx);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
- exp_members[0] = sss_tc_fqname(tmp_ctx, nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->subdom, submember1.pw_name);
|
|
|
bb7cd1 |
- assert_non_null(exp_members[0]);
|
|
|
bb7cd1 |
- exp_members[1] = sss_tc_fqname(tmp_ctx, nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->subdom, submember2.pw_name);
|
|
|
bb7cd1 |
- assert_non_null(exp_members[1]);
|
|
|
bb7cd1 |
+ if (nss_test_ctx->subdom->fqnames) {
|
|
|
bb7cd1 |
+ exp_members[0] = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ submember1.pw_name);
|
|
|
bb7cd1 |
+ assert_non_null(exp_members[0]);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ exp_members[1] = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ submember2.pw_name);
|
|
|
bb7cd1 |
+ assert_non_null(exp_members[1]);
|
|
|
bb7cd1 |
+ } else {
|
|
|
bb7cd1 |
+ exp_members[0] = submember1.pw_name;
|
|
|
bb7cd1 |
+ exp_members[1] = submember2.pw_name;
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
/* Important: this member is from a non-qualified domain, so his name will
|
|
|
bb7cd1 |
* not be qualified either
|
|
|
bb7cd1 |
*/
|
|
|
bb7cd1 |
exp_members[2] = testmember1.pw_name;
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
- expected.gr_name = sss_tc_fqname(tmp_ctx, nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
- nss_test_ctx->subdom, testsubdomgroup.gr_name);
|
|
|
bb7cd1 |
- assert_non_null(expected.gr_name);
|
|
|
bb7cd1 |
+ if (nss_test_ctx->subdom->fqnames) {
|
|
|
bb7cd1 |
+ expected.gr_name = sss_tc_fqname(tmp_ctx,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->names,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ testsubdomgroup.gr_name);
|
|
|
bb7cd1 |
+ assert_non_null(expected.gr_name);
|
|
|
bb7cd1 |
+ } else {
|
|
|
bb7cd1 |
+ expected.gr_name = testsubdomgroup.gr_name;
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
assert_int_equal(status, EOK);
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
@@ -1906,6 +2040,36 @@ void test_nss_getgrnam_mix_subdom(void **state)
|
|
|
bb7cd1 |
assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
}
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
+void test_nss_getgrnam_mix_subdom_nonfqnames(void **state)
|
|
|
bb7cd1 |
+{
|
|
|
bb7cd1 |
+ errno_t ret;
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom->fqnames = false;
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ ret = store_group_member(nss_test_ctx,
|
|
|
bb7cd1 |
+ testsubdomgroup.gr_name,
|
|
|
bb7cd1 |
+ nss_test_ctx->subdom,
|
|
|
bb7cd1 |
+ testmember1.pw_name,
|
|
|
bb7cd1 |
+ nss_test_ctx->tctx->dom,
|
|
|
bb7cd1 |
+ SYSDB_MEMBER_USER);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ mock_input_user_or_group("testsubdomgroup");
|
|
|
bb7cd1 |
+ mock_account_recv_simple();
|
|
|
bb7cd1 |
+ will_return(__wrap_sss_packet_get_cmd, SSS_NSS_GETGRNAM);
|
|
|
bb7cd1 |
+ will_return_always(__wrap_sss_packet_get_body, WRAP_CALL_REAL);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Query for that group, call a callback when command finishes */
|
|
|
bb7cd1 |
+ set_cmd_cb(test_nss_getgrnam_check_mix_subdom);
|
|
|
bb7cd1 |
+ ret = sss_cmd_execute(nss_test_ctx->cctx, SSS_NSS_GETGRNAM,
|
|
|
bb7cd1 |
+ nss_test_ctx->nss_cmds);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ /* Wait until the test finishes with EOK */
|
|
|
bb7cd1 |
+ ret = test_ev_loop(nss_test_ctx->tctx);
|
|
|
bb7cd1 |
+ assert_int_equal(ret, EOK);
|
|
|
bb7cd1 |
+}
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
struct group space_group = {
|
|
|
bb7cd1 |
.gr_gid = 2123,
|
|
|
bb7cd1 |
.gr_name = discard_const("space group"),
|
|
|
bb7cd1 |
@@ -4023,15 +4187,27 @@ int main(int argc, const char *argv[])
|
|
|
bb7cd1 |
cmocka_unit_test_setup_teardown(test_nss_getgrnam_members_subdom,
|
|
|
bb7cd1 |
nss_subdom_test_setup,
|
|
|
bb7cd1 |
nss_subdom_test_teardown),
|
|
|
bb7cd1 |
+ cmocka_unit_test_setup_teardown(test_nss_getgrnam_members_subdom_nonfqnames,
|
|
|
bb7cd1 |
+ nss_subdom_test_setup,
|
|
|
bb7cd1 |
+ nss_subdom_test_teardown),
|
|
|
bb7cd1 |
cmocka_unit_test_setup_teardown(test_nss_getgrnam_mix_dom,
|
|
|
bb7cd1 |
nss_subdom_test_setup,
|
|
|
bb7cd1 |
nss_subdom_test_teardown),
|
|
|
bb7cd1 |
+ cmocka_unit_test_setup_teardown(test_nss_getgrnam_mix_dom_nonfqnames,
|
|
|
bb7cd1 |
+ nss_subdom_test_setup,
|
|
|
bb7cd1 |
+ nss_subdom_test_teardown),
|
|
|
bb7cd1 |
cmocka_unit_test_setup_teardown(test_nss_getgrnam_mix_dom_fqdn,
|
|
|
bb7cd1 |
nss_subdom_test_setup,
|
|
|
bb7cd1 |
nss_subdom_test_teardown),
|
|
|
bb7cd1 |
+ cmocka_unit_test_setup_teardown(test_nss_getgrnam_mix_dom_fqdn_nonfqnames,
|
|
|
bb7cd1 |
+ nss_subdom_test_setup,
|
|
|
bb7cd1 |
+ nss_subdom_test_teardown),
|
|
|
bb7cd1 |
cmocka_unit_test_setup_teardown(test_nss_getgrnam_mix_subdom,
|
|
|
bb7cd1 |
nss_subdom_test_setup,
|
|
|
bb7cd1 |
nss_subdom_test_teardown),
|
|
|
bb7cd1 |
+ cmocka_unit_test_setup_teardown(test_nss_getgrnam_mix_subdom_nonfqnames,
|
|
|
bb7cd1 |
+ nss_subdom_test_setup,
|
|
|
bb7cd1 |
+ nss_subdom_test_teardown),
|
|
|
bb7cd1 |
cmocka_unit_test_setup_teardown(test_nss_getgrnam_space,
|
|
|
bb7cd1 |
nss_test_setup, nss_test_teardown),
|
|
|
bb7cd1 |
cmocka_unit_test_setup_teardown(test_nss_getgrnam_space_sub,
|
|
|
bb7cd1 |
--
|
|
|
bb7cd1 |
2.9.3
|
|
|
bb7cd1 |
|