summaryrefslogtreecommitdiffstats
path: root/src/tests/simple_access-tests.c
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-05-22 09:02:24 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-05-30 13:37:55 +0200
commitb36153ce4c3eeb19274ce32e82949da446184406 (patch)
treee12b73e3421bb334ddea05fedab9572fe1178dfe /src/tests/simple_access-tests.c
parentd65f692d7b7639ed8ba0f5cffa4f88b68056739a (diff)
downloadsssd-b36153ce4c3eeb19274ce32e82949da446184406.tar.gz
sssd-b36153ce4c3eeb19274ce32e82949da446184406.tar.xz
sssd-b36153ce4c3eeb19274ce32e82949da446184406.zip
Remove empty directories after tests run.
Empty directory tests_path is removed in function test_dom_suite_cleanup. Function test_dom_suite_cleanup is reused in other tests.
Diffstat (limited to 'src/tests/simple_access-tests.c')
-rw-r--r--src/tests/simple_access-tests.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/tests/simple_access-tests.c b/src/tests/simple_access-tests.c
index 4c7840026..48ebea6f7 100644
--- a/src/tests/simple_access-tests.c
+++ b/src/tests/simple_access-tests.c
@@ -540,7 +540,6 @@ int main(int argc, const char *argv[])
int opt;
poptContext pc;
int number_failed;
- int ret;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -573,17 +572,8 @@ int main(int argc, const char *argv[])
number_failed = srunner_ntests_failed(sr);
srunner_free(sr);
- ret = unlink(TESTS_PATH"/"TEST_CONF_FILE);
- if (ret != EOK) {
- fprintf(stderr, "Could not delete the test config ldb file (%d) (%s)\n",
- errno, strerror(errno));
- return EXIT_FAILURE;
- }
- ret = unlink(TESTS_PATH"/"LOCAL_SYSDB_FILE);
- if (ret != EOK) {
- fprintf(stderr, "Could not delete the test config ldb file (%d) (%s)\n",
- errno, strerror(errno));
- return EXIT_FAILURE;
+ if (number_failed == 0) {
+ test_dom_suite_cleanup(TESTS_PATH, TEST_CONF_FILE, LOCAL_SYSDB_FILE);
}
return (number_failed==0 ? EXIT_SUCCESS : EXIT_FAILURE);