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