Skip to content

Commit

Permalink
systemtests: support systemtests that do not run any daemon
Browse files Browse the repository at this point in the history
We have the "catalog" systemtest where the systemtest sets
up the database but the test itself is a single unit test binary.

In this case we can skip most directories that are needed by the
daemons, so that the test directory is not filled with unused files.
  • Loading branch information
pstorz committed Jan 8, 2020
1 parent 472ceb9 commit 125ad84
Show file tree
Hide file tree
Showing 20 changed files with 15 additions and 218 deletions.
27 changes: 15 additions & 12 deletions systemtests/CMakeLists.txt
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2019-2019 Bareos GmbH & Co. KG
# Copyright (C) 2019-2020 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -164,12 +164,20 @@ macro(prepare_test)
${current_test_directory}/python-modules
)

file(MAKE_DIRECTORY ${archivedir})
file(MAKE_DIRECTORY ${confdir})
file(MAKE_DIRECTORY ${logdir})
file(MAKE_DIRECTORY ${tmpdir})
file(MAKE_DIRECTORY ${working_dir})
file(MAKE_DIRECTORY ${config_directory_dir_additional_test_config})
# skip for tests without etc/bareos ("catalog" test)
if(EXISTS ${current_test_directory}/etc/bareos)
file(MAKE_DIRECTORY ${tmpdir})
file(MAKE_DIRECTORY ${archivedir})
file(MAKE_DIRECTORY ${logdir})
file(MAKE_DIRECTORY ${confdir})
file(MAKE_DIRECTORY ${working_dir})
file(MAKE_DIRECTORY ${config_directory_dir_additional_test_config})
# create a bin/bareos and bin/bconsole script in every testdir for start/stop
# and bconsole
file(MAKE_DIRECTORY "${current_test_directory}/bin")
configure_file("bin/bconsole" "${current_test_directory}/bin/bconsole" COPYONLY)
configure_file("bin/bareos" "${current_test_directory}/bin/bareos" COPYONLY)
endif()
endmacro()

# extract db version from cats.h
Expand Down Expand Up @@ -437,11 +445,6 @@ foreach(TEST_NAME ${SYSTEM_TESTS})
handle_python_plugin_modules()

configure_file("environment.in" "tests/${TEST_NAME}/environment" @ONLY)
# create a bin/bareos and bin/bconsole script in every testdir for start/stop
# and bconsole file(MAKE_DIRECTORY
# "${CMAKE_BINARY_DIR}/tests/${TEST_NAME}/bin")
configure_file("bin/bconsole" "tests/${TEST_NAME}/bin/bconsole" COPYONLY)
configure_file("bin/bareos" "tests/${TEST_NAME}/bin/bareos" COPYONLY)

checkforenabledanddisabledlistentry(${TEST_NAME})

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions systemtests/tests/catalog/etc/bareos/bareos-dir.d/pool/Full.conf

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions systemtests/tests/catalog/etc/bareos/bconsole.conf.in

This file was deleted.

0 comments on commit 125ad84

Please sign in to comment.