Skip to content

Commit

Permalink
systemtests: smaller bug fixes
Browse files Browse the repository at this point in the history
systemtests: Check if folder "python-modules" exists after configuring files instead of before

systemtests: Dont echo error in set_error() because end_test() prints tmp/err.log

python-dir-plugin-test/testrunner: fixed grep statement
  • Loading branch information
Tobias Plum committed Oct 15, 2019
1 parent 0b24ace commit bdea138
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
36 changes: 18 additions & 18 deletions systemtests/CMakeLists.txt
Expand Up @@ -316,6 +316,24 @@ foreach(TEST_NAME ${SYSTEM_TESTS})
file(MAKE_DIRECTORY ${tmpdir})
file(MAKE_DIRECTORY ${working_dir})

# webui-selenium
IF(${TEST_NAME} STREQUAL "webui-selenium")
set(WEBUICONFDIR ${current_test_directory}/etc/bareos-webui) #used for testenvironment settings
file(MAKE_DIRECTORY ${WEBUICONFDIR})
configure_file("${CMAKE_SOURCE_DIR}/webui/config/autoload/global.php.in" "${current_test_directory}/webui/config/autoload/global.php" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/systemtests/tests/webui-selenium/directors.ini.in" "${current_test_directory}/etc/bareos-webui/directors.ini" @ONLY)
file(COPY "${CMAKE_SOURCE_DIR}/webui/install/configuration.ini" DESTINATION "${current_test_directory}/etc/bareos-webui/")
ENDIF()

ConfigureFilesToSystemtest("systemtests" "tests/${TEST_NAME}" "*" @ONLY)

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)

IF (EXISTS ${python_plugin_module_src_test_dir})
set(PYMODULES_TO_LINK_TO_SRC
filed/bareos-fd-local-fileset.py
Expand Down Expand Up @@ -343,24 +361,6 @@ foreach(TEST_NAME ${SYSTEM_TESTS})
endforeach()
ENDIF()

# webui-selenium
IF(${TEST_NAME} STREQUAL "webui-selenium")
set(WEBUICONFDIR ${current_test_directory}/etc/bareos-webui) #used for testenvironment settings
file(MAKE_DIRECTORY ${WEBUICONFDIR})
configure_file("${CMAKE_SOURCE_DIR}/webui/config/autoload/global.php.in" "${current_test_directory}/webui/config/autoload/global.php" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/systemtests/tests/webui-selenium/directors.ini.in" "${current_test_directory}/etc/bareos-webui/directors.ini" @ONLY)
file(COPY "${CMAKE_SOURCE_DIR}/webui/install/configuration.ini" DESTINATION "${current_test_directory}/etc/bareos-webui/")
ENDIF()

ConfigureFilesToSystemtest("systemtests" "tests/${TEST_NAME}" "*" @ONLY)

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})

add_test(NAME "system:${TEST_NAME}"
Expand Down
1 change: 0 additions & 1 deletion systemtests/scripts/functions
Expand Up @@ -288,7 +288,6 @@ set_error()
{
estat=9
echo "ERROR: $*" >> "$tmp/err.log"
echo "ERROR: $*"
}

check_files_written()
Expand Down
8 changes: 5 additions & 3 deletions systemtests/tests/python-dir-plugin-test/testrunner
Expand Up @@ -50,8 +50,10 @@ run_bareos
check_for_zombie_jobs storage=File
stop_bareos

if ! grep -Eq "^[bDirEventJobStart,bDirEventJobInit,bDirEventJobRun,bDirEventJobEnd]${1}" ${tmp}/test-plugin.log; then
estat=1
fi
for i in bDirEventJobStart bDirEventJobInit bDirEventJobRun bDirEventJobEnd; do
if ! grep -q "$i" ${tmp}/test-plugin.log; then
set_error "Failed to find logged event $i"
fi
done

end_test

0 comments on commit bdea138

Please sign in to comment.