From b247b1217415aa18332dd632d09f4748ace20381 Mon Sep 17 00:00:00 2001 From: Frank Ueberschar Date: Tue, 26 Nov 2019 13:24:02 +0100 Subject: [PATCH] systemtests: run the catalog unittest from a systemtest only - do not run the catalog unittest with 'make test' or 'ctest' - the catalog-'unittest' will be run from the catalog-'systemtest' --- core/src/tests/CMakeLists.txt | 8 ++++---- core/src/tests/catalog.cc | 4 ++-- systemtests/environment.in | 4 ++-- systemtests/tests/catalog/testrunner | 10 +++++++++- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/core/src/tests/CMakeLists.txt b/core/src/tests/CMakeLists.txt index e5786636830..f669a90cde9 100644 --- a/core/src/tests/CMakeLists.txt +++ b/core/src/tests/CMakeLists.txt @@ -342,8 +342,8 @@ if(NOT HAVE_WIN32 AND NOT client-only) ) endif() -add_test(NAME catalog::postgresql COMMAND catalog TEST_PREFIX gtest:) -set_tests_properties(catalog::postgresql PROPERTIES - ENVIRONMENT CATALOG_BACKEND=postgresql - ENVIRONMENT BACKEND_DIRS=${CMAKE_BINARY_DIR}/core/src/cats) +#add_test(NAME catalog::postgresql COMMAND catalog TEST_PREFIX gtest:) +#set_tests_properties(catalog::postgresql PROPERTIES +# ENVIRONMENT CATALOG_BACKEND=postgresql +# ENVIRONMENT BACKEND_DIRS=${CMAKE_BINARY_DIR}/core/src/cats) diff --git a/core/src/tests/catalog.cc b/core/src/tests/catalog.cc index 4a20e00d463..c8e678d986e 100644 --- a/core/src/tests/catalog.cc +++ b/core/src/tests/catalog.cc @@ -110,8 +110,8 @@ TEST_F(CatalogTest, database) ASSERT_NE(testable_catalog_backends.find(catalog_backend_name), testable_catalog_backends.end()) - << "Environment variable CATALOG_BACKEND does not contain a testable " - "catalog backend name."; + << "Environment variable CATALOG_BACKEND does not contain a name for a " + "testable catalog backend."; JobControlRecord* jcr = directordaemon::NewDirectorJcr(); jcr->impl->res.catalog = diff --git a/systemtests/environment.in b/systemtests/environment.in index 3a76194573c..00b686f5adb 100644 --- a/systemtests/environment.in +++ b/systemtests/environment.in @@ -78,6 +78,6 @@ export BAREOS_WEBUI_RESTOREFILE=${PROJECT_BINARY_DIR} export BAREOS_WEBUI_LOG_PATH=${logdir} export BAREOS_WEBUI_DELAY=1 -export CATALOG_BACKEND=postgresql -export BACKEND_DIRS=/home/franku/01-prj/git/bareos-master/b/core/src/cats +export CATALOG_BACKEND=$DBTYPE +export BACKEND_DIRS=$backenddir diff --git a/systemtests/tests/catalog/testrunner b/systemtests/tests/catalog/testrunner index 555b6eabe40..6a169fe5cbf 100755 --- a/systemtests/tests/catalog/testrunner +++ b/systemtests/tests/catalog/testrunner @@ -12,6 +12,14 @@ export TestName ${scripts}/cleanup ${scripts}/setup +exit_failure() +{ + estat=1 + end_test +} + start_test -./../../../../b/core/src/tests/catalog + +./../../../../b/core/src/tests/catalog || exit_failure + end_test