summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2017-05-31 17:16:47 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2017-06-01 12:33:53 +0200
commit291b6bfd499fd64416b75c05c8846a5102600f3c (patch)
treede024d3787c320c780a421ee7bd42e9b7a0a40c6 /src/tests
parent5919e884d3f71456f50b92236e002d98747be017 (diff)
downloadsssd-291b6bfd499fd64416b75c05c8846a5102600f3c.tar.gz
sssd-291b6bfd499fd64416b75c05c8846a5102600f3c.tar.xz
sssd-291b6bfd499fd64416b75c05c8846a5102600f3c.zip
test_config_check: Fix few issues
* enable few tests * malformed configuration file due to missing closing ']' * fix few expected failures * add few sections into whitelist test * crash in test if count of expected failures is different then real value [ RUN ] config_check_test_bad_subdom_option_name [rule/allowed_domain_options]: Attribute 'debug_leTYPOvel' is not allowed in section 'domain/A.test/B.A.test'. Check for typos. [rule/allowed_subdomain_options]: Attribute 'debug_leTYPOvel' is not allowed in section 'domain/A.test/B.A.test'. Check for typos. [ ERROR ] --- Test failed with exception: Segmentation fault(11) Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/cmocka/test_config_check.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/tests/cmocka/test_config_check.c b/src/tests/cmocka/test_config_check.c
index bab3226c0..0066ebe77 100644
--- a/src/tests/cmocka/test_config_check.c
+++ b/src/tests/cmocka/test_config_check.c
@@ -81,6 +81,7 @@ void config_check_test_common(const char *cfg_string,
/* Keep this printf loop for faster debugging */
printf("%s\n", strs[i]);
}
+ assert_int_equal(num_errors, num_errors_expected);
for (int i = 0; i < num_errors && i <= num_errors_expected; i++) {
assert_string_equal(strs[i], errors_expected[i]);
@@ -167,7 +168,7 @@ void config_check_test_bad_ifp_option_name(void **state)
void config_check_test_bad_domain_option_name(void **state)
{
- char cfg_str[] = "[domain/A.test\n"
+ char cfg_str[] = "[domain/A.test]\n"
"debug_leTYPOvel = 10\n";
const char *expected_errors[] = {
"[rule/allowed_subdomain_options]: Attribute 'debug_leTYPOvel' is not "
@@ -179,10 +180,10 @@ void config_check_test_bad_domain_option_name(void **state)
void config_check_test_bad_appdomain_option_name(void **state)
{
- char cfg_str[] = "[application/myapp\n"
+ char cfg_str[] = "[application/myapp]\n"
"debug_leTYPOvel = 10\n";
const char *expected_errors[] = {
- "[rule/allowed_subdomain_options]: Attribute 'debug_leTYPOvel' is not "
+ "[rule/allowed_domain_options]: Attribute 'debug_leTYPOvel' is not "
"allowed in section 'application/myapp'. Check for typos.",
};
@@ -194,7 +195,7 @@ void config_check_test_bad_subdom_option_name(void **state)
char cfg_str[] = "[domain/A.test/B.A.test]\n"
"debug_leTYPOvel = 10\n";
const char *expected_errors[] = {
- "[rule/allowed_sssd_options]: Attribute 'debug_leTYPOvel' is not "
+ "[rule/allowed_subdomain_options]: Attribute 'debug_leTYPOvel' is not "
"allowed in section 'domain/A.test/B.A.test'. Check for typos.",
};
@@ -210,6 +211,8 @@ void config_check_test_good_sections(void **state)
"[domain/testdom.test/testsubdom.testdom.test]\n"
"[application/myapp]\n"
"[secrets]\n"
+ "[secrets/users/1000]\n"
+ "[ssh]\n"
"[ifp]\n"
"[pac]\n";
const char *expected_errors[] = { NULL };
@@ -255,8 +258,11 @@ int main(int argc, const char *argv[])
cmocka_unit_test(config_check_test_bad_nss_option_name),
cmocka_unit_test(config_check_test_bad_pac_option_name),
cmocka_unit_test(config_check_test_bad_ifp_option_name),
+ cmocka_unit_test(config_check_test_bad_appdomain_option_name),
+ cmocka_unit_test(config_check_test_bad_subdom_option_name),
cmocka_unit_test(config_check_test_good_sections),
cmocka_unit_test(config_check_test_inherit_from_in_normal_dom),
+ cmocka_unit_test(config_check_test_inherit_from_in_app_dom),
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */