From a2e8989fd06af0dcf4dd7b8013bda6bcb49839f0 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Tue, 12 Jul 2016 12:37:16 +0200
Subject: [PATCH 21/27] test_utils: Clean files after
sss_write_krb5_conf_snippet
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The test directory was not removed (tp_test_utils-test_utils)
because it contain the snippet for krb5_libdefaults.
Reviewed-by: Fabiano FidĂȘncio <fabiano@fidencio.org>
(cherry picked from commit 059904af2d20debcb8ffe1c6f45b996c2c57574e)
---
src/tests/cmocka/test_utils.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/tests/cmocka/test_utils.c b/src/tests/cmocka/test_utils.c
index fd20990ce7ac632b3b62bf84a20cc75a5ec0e968..b08b19708bb59a076a79805fa37a15924152b8e2 100644
--- a/src/tests/cmocka/test_utils.c
+++ b/src/tests/cmocka/test_utils.c
@@ -1252,6 +1252,7 @@ void test_sss_write_krb5_conf_snippet(void **state)
char *cwd;
char *path;
char *file;
+ char *file_krb5_libdefaults;
ret = sss_write_krb5_conf_snippet(NULL, false);
assert_int_equal(ret, EINVAL);
@@ -1274,6 +1275,10 @@ void test_sss_write_krb5_conf_snippet(void **state)
ret = asprintf(&file, "%s/%s/localauth_plugin", cwd, TESTS_PATH);
assert_true(ret > 0);
+ ret = asprintf(&file_krb5_libdefaults,
+ "%s/%s/krb5_libdefaults", cwd, TESTS_PATH);
+ assert_true(ret > 0);
+
ret = sss_write_krb5_conf_snippet(path, true);
assert_int_equal(ret, EOK);
@@ -1286,7 +1291,11 @@ void test_sss_write_krb5_conf_snippet(void **state)
assert_int_equal(ret, EOK);
#endif
+ ret = unlink(file_krb5_libdefaults);
+ assert_int_equal(ret, EOK);
+
free(file);
+ free(file_krb5_libdefaults);
free(path);
}
--
2.4.11