dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0072-test_sysdb_views-Use-unique-directory-for-cache.patch

905b4d
From 06e85cb08343ec902f0978ab0b6b373f1f1817f3 Mon Sep 17 00:00:00 2001
905b4d
From: Lukas Slebodnik <lslebodn@redhat.com>
905b4d
Date: Wed, 5 Nov 2014 22:18:05 +0100
905b4d
Subject: [PATCH 72/75] test_sysdb_views: Use unique directory for cache
905b4d
MIME-Version: 1.0
905b4d
Content-Type: text/plain; charset=UTF-8
905b4d
Content-Transfer-Encoding: 8bit
905b4d
905b4d
Two tests stored cache in the same directory, It can cause failures with
905b4d
parallel execution of tests.
905b4d
905b4d
sh$ git grep tests_sysdb
905b4d
src/tests/cmocka/test_sysdb_views.c:#define TESTS_PATH "tests_sysdb"
905b4d
src/tests/sysdb-tests.c:#define TESTS_PATH "tests_sysdb"
905b4d
905b4d
This patch also clean up potential leftovers after previous failed
905b4d
test_sysdb_views before execution of test suite.
905b4d
905b4d
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
905b4d
---
905b4d
 src/tests/cmocka/test_sysdb_views.c | 4 +++-
905b4d
 1 file changed, 3 insertions(+), 1 deletion(-)
905b4d
905b4d
diff --git a/src/tests/cmocka/test_sysdb_views.c b/src/tests/cmocka/test_sysdb_views.c
905b4d
index 38525d6ded8fdbbd1a657f8ca742e51d6ba2b102..9fb2d7201d06e84be83d6a516c5e3a0f15ec0639 100644
905b4d
--- a/src/tests/cmocka/test_sysdb_views.c
905b4d
+++ b/src/tests/cmocka/test_sysdb_views.c
905b4d
@@ -30,7 +30,7 @@
905b4d
 
905b4d
 #include "tests/cmocka/common_mock.h"
905b4d
 
905b4d
-#define TESTS_PATH "tests_sysdb"
905b4d
+#define TESTS_PATH "tests_sysdb_views"
905b4d
 #define TEST_CONF_FILE "tests_conf.ldb"
905b4d
 
905b4d
 struct sysdb_test_ctx {
905b4d
@@ -226,6 +226,8 @@ int main(int argc, const char *argv[])
905b4d
     DEBUG_CLI_INIT(debug_level);
905b4d
 
905b4d
     tests_set_cwd();
905b4d
+    test_dom_suite_cleanup(TESTS_PATH, TEST_CONF_FILE, LOCAL_SYSDB_FILE);
905b4d
+    test_dom_suite_setup(TESTS_PATH);
905b4d
     rv = run_tests(tests);
905b4d
 
905b4d
     if (rv == 0 && no_cleanup == 0) {
905b4d
-- 
905b4d
1.9.3
905b4d