d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose Sumit Bose <sbose@redhat.com>
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose Copyright (C) 2013 Red Hat
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose SSSD tests: Unit tests for libsss_idmap
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose This program is free software; you can redistribute it and/or modify
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose it under the terms of the GNU General Public License as published by
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose the Free Software Foundation; either version 3 of the License, or
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose (at your option) any later version.
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose This program is distributed in the hope that it will be useful,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose but WITHOUT ANY WARRANTY; without even the implied warranty of
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose GNU General Public License for more details.
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose You should have received a copy of the GNU General Public License
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose along with this program. If not, see <http://www.gnu.org/licenses/>.
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_zero(global_talloc_context, struct test_ctx);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_init(idmap_talloc, test_ctx->mem_idmap, idmap_free,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozekstatic int setup_ranges(struct test_ctx *test_ctx, bool external_mapping,
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_add_auto_domain_ex(test_ctx->idmap_ctx, name, sid,
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, name, sid, &range,
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_add_auto_domain_ex(test_ctx->idmap_ctx, name, sid,
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, name, sid, &range,
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichlstatic int setup_ranges_2922(struct test_ctx *test_ctx)
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Pick a new slice. */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl err = sss_idmap_calculate_range(test_ctx->idmap_ctx, sid, &slice_num,
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Range computation should be deterministic. Lets validate that. */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl assert_int_equal(slice_num, TEST_2922_DFL_SLIDE);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, name, sid, &range,
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichlstatic int test_sss_idmap_setup_with_domains(void **state)
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichlstatic int test_sss_idmap_setup_with_domains_2922(void **state)
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl test_ctx = talloc_get_type(*state, struct test_ctx);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichlstatic int test_sss_idmap_setup_with_domains_sec_slices(void **state)
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl test_ctx = talloc_get_type(*state, struct test_ctx);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichlstatic int test_sss_idmap_setup_with_external_mappings(void **state)
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichlstatic int test_sss_idmap_setup_with_both(void **state)
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozekstatic int test_sss_idmap_teardown(void **state)
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain(test_ctx->idmap_ctx, TEST_DOM_NAME, TEST_DOM_SID,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain(test_ctx->idmap_ctx, TEST_DOM_NAME, TEST_DOM_SID,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME"X",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME"-nosid",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME"-nosid",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"1-1", &id);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_OFFSET - 1, &sid);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-0", &id);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, id, &sid);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose assert_int_equal(id, TEST_RANGE_MIN+TEST_OFFSET);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, id, &sid);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose assert_string_equal(sid, TEST_DOM_SID"-"TEST_OFFSET_STR);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl/* ID mapping - bug in computing max id for slice range */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl const char* TEST_2922_FIRST_SID = TEST_DOM_SID"-0";
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Last SID = first SID + (default) rangesize -1 */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl const char* TEST_2922_LAST_SID = TEST_DOM_SID"-199999";
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Last SID = first SID + rangesize */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl const char* TEST_2922_LAST_SID_PLUS_ONE = TEST_DOM_SID"-200000";
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl test_ctx = talloc_get_type(*state, struct test_ctx);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Min UNIX ID to SID */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_2922_MIN_ID, &sid);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* First SID to UNIX ID */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_2922_FIRST_SID, &id);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Max UNIX ID to SID */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_2922_MAX_ID, &sid);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Last SID to UNIX ID */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_2922_LAST_SID, &id);
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Max UNIX ID + 1 to SID */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_2922_MAX_ID + 1,
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Last SID + 1 to UNIX ID */
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx,
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl /* Auto adding new ranges is disable in this test. */
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl test_ctx = talloc_get_type(*state, struct test_ctx);
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"1-1", &id);
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-4000000",
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_OFFSET - 1, &sid);
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-0", &id);
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, id, &sid);
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx,
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl assert_int_equal(id, TEST_RANGE_MIN+TEST_OFFSET);
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, id, &sid);
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl assert_string_equal(sid, TEST_DOM_SID"-"TEST_OFFSET_STR);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"1-1", &id);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_OFFSET - 1, &sid);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-0", &id);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_RANGE_MIN, &sid);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"1-400000",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_domain_has_algorithmic_mapping(NULL, NULL, &use_id_mapping);
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_domain_has_algorithmic_mapping(NULL, TEST_DOM_SID,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_domain_has_algorithmic_mapping(test_ctx->idmap_ctx, NULL,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_domain_has_algorithmic_mapping(test_ctx->idmap_ctx,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_domain_has_algorithmic_mapping(test_ctx->idmap_ctx,
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose err = sss_idmap_domain_has_algorithmic_mapping(test_ctx->idmap_ctx,
3cbbfb4b05d0eb0a0809704e83589d0075e117a0Sumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
3cbbfb4b05d0eb0a0809704e83589d0075e117a0Sumit Bose err = sss_idmap_domain_by_name_has_algorithmic_mapping(NULL, NULL, &use_id_mapping);
3cbbfb4b05d0eb0a0809704e83589d0075e117a0Sumit Bose err = sss_idmap_domain_by_name_has_algorithmic_mapping(NULL, TEST_DOM_SID,
3cbbfb4b05d0eb0a0809704e83589d0075e117a0Sumit Bose err = sss_idmap_domain_by_name_has_algorithmic_mapping(test_ctx->idmap_ctx, NULL,
3cbbfb4b05d0eb0a0809704e83589d0075e117a0Sumit Bose err = sss_idmap_domain_by_name_has_algorithmic_mapping(test_ctx->idmap_ctx,
3cbbfb4b05d0eb0a0809704e83589d0075e117a0Sumit Bose err = sss_idmap_domain_by_name_has_algorithmic_mapping(test_ctx->idmap_ctx,
3cbbfb4b05d0eb0a0809704e83589d0075e117a0Sumit Bose err = sss_idmap_domain_by_name_has_algorithmic_mapping(test_ctx->idmap_ctx,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bosevoid test_sss_idmap_check_collision_ex(void **state)
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose struct sss_idmap_range r1 = {TEST_RANGE_MIN, TEST_RANGE_MAX};
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose struct sss_idmap_range r2 = {TEST_2_RANGE_MIN, TEST_2_RANGE_MAX};
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose /* Same name, different SID */
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose /* Same SID, different name */
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose /* Same SID and name, no overlaps */
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose /* Same SID and name, different mappings */
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose /* Same SID and name, Overlapping RID range */
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose /* Different SID and name, Overlapping RID range */
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose /* Overlapping ranges with no external mapping */
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose /* Overlapping ranges with external mapping */
ff6e24f4474cca6226cd44c47ba2ec6ba6cf9a16Sumit Bose err = sss_idmap_check_collision_ex(TEST_DOM_NAME, TEST_DOM_SID, &r1,
c377d4d604f1e7b35c484711f1084b7a761772b6Sumit Bose for (c = IDMAP_SUCCESS; c < IDMAP_ERR_LAST; c++) {
11a030ac6e064c50759b5397e1f4d0289f87f64aSumit Bosevoid test_sss_idmap_calculate_range_slice_collision(void **state)
11a030ac6e064c50759b5397e1f4d0289f87f64aSumit Bose test_ctx = talloc_get_type(*state, struct test_ctx);
11a030ac6e064c50759b5397e1f4d0289f87f64aSumit Bose err = sss_idmap_calculate_range(test_ctx->idmap_ctx, NULL, &slice_num,
11a030ac6e064c50759b5397e1f4d0289f87f64aSumit Bose err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
11a030ac6e064c50759b5397e1f4d0289f87f64aSumit Bose err = sss_idmap_calculate_range(test_ctx->idmap_ctx, NULL, &slice_num,
11a030ac6e064c50759b5397e1f4d0289f87f64aSumit Bose err = sss_idmap_calculate_range(test_ctx->idmap_ctx, NULL, &slice_num,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_add_domain,
9d17f436795a36b1b1126f444923aa847fd0f93aPavel Reichl cmocka_unit_test_setup_teardown(test_map_id_2922,
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl cmocka_unit_test_setup_teardown(test_map_id_sec_slices,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_map_id_external,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_check_sid_id,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_check_sid_id,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_has_algorithmic,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_has_algorithmic_by_name,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test(test_sss_idmap_check_collision_ex),
11a030ac6e064c50759b5397e1f4d0289f87f64aSumit Bose cmocka_unit_test_setup_teardown(test_sss_idmap_calculate_range_slice_collision,
57c5ea8825c7179fd93382dbcbb07e828e5aec19René Genz /* Set debug level to invalid value so we can decide if -d 0 was used. */
d064fef06dcbcb5f6c1be03e286b1a3433d6dfd7Sumit Bose pc = poptGetContext(argv[0], argc, argv, long_options, 0);