Skip to content

Commit

Permalink
systemtests: adapt python-fd-percona-xtrabackup to test installed files
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Jan 24, 2020
1 parent 3e7069d commit 3ea9691
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
27 changes: 17 additions & 10 deletions systemtests/CMakeLists.txt
Expand Up @@ -84,9 +84,11 @@ macro(handle_python_plugin_modules test_name)

string(REGEX MATCH ^python-fd.* starts_with_python-fd ${test_name})
if(starts_with_python-fd)
list(APPEND PYMODULES_TO_LINK_TO_SRC filed/BareosFdWrapper.py
filed/BareosFdPluginBaseclass.py filed/bareos_fd_consts.py
filed/bareos-fd-mock-test.py
list(APPEND PYMODULES_TO_LINK_TO_SRC
BareosFdWrapper.py
BareosFdPluginBaseclass.py
bareos_fd_consts.py
bareos-fd-mock-test.py
)
endif()

Expand All @@ -111,8 +113,9 @@ macro(handle_python_plugin_modules test_name)
endif()

if(${test_name} STREQUAL python-fd-percona-xtrabackup-plugin-test)
list(APPEND PYMODULES_TO_LINK_TO_SRC filed/BareosFdPluginPerconaXtraBackup.py
filed/bareos-fd-percona-xtrabackup.py
list(APPEND PYMODULES_TO_LINK_TO_SRC
BareosFdPluginPerconaXtraBackup.py
bareos-fd-percona-xtrabackup.py
)
endif()

Expand All @@ -138,7 +141,7 @@ macro(handle_python_plugin_modules test_name)
get_filename_component(PYMODULE_NAME ${PYMODULE_SOURCEPATH} NAME)
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink
${PROJECT_SOURCE_DIR}/../core/src/plugins/${PYMODULE_SOURCEPATH}
${python_plugin_module_src_dir}/${PYMODULE_SOURCEPATH}
${python_plugin_module_src_test_dir}/${PYMODULE_NAME}
)
endforeach()
Expand Down Expand Up @@ -283,18 +286,22 @@ set(logdir "log")
set(mon_dir_password "mon_dir_password")
set(mon_fd_password "mon_fd_password")
set(mon_sd_password "mon_sd_password")
set(python_plugin_module_src_dir ${CMAKE_SOURCE_DIR}/core/src/plugins)
#set(python_plugin_module_src_dir ${CMAKE_SOURCE_DIR}/core/src/plugins)
set(python_plugin_module_src_dir /usr/lib64/bareos/plugins)
set(plugindirtmp ${PROJECT_BINARY_DIR}/plugindirtmp)
set(rscripts ${PROJECT_BINARY_DIR}/scripts)

if(TARGET python-dir)
get_target_property(dir_plugin_binary_path python-dir BINARY_DIR)
#get_target_property(dir_plugin_binary_path python-dir BINARY_DIR)
set(dir_plugin_binary_path /usr/lib64/bareos/plugins)
endif()
if(TARGET python-sd)
get_target_property(sd_plugin_binary_path python-sd BINARY_DIR)
#get_target_property(sd_plugin_binary_path python-sd BINARY_DIR)
set(sd_plugin_binary_path /usr/lib64/bareos/plugins)
endif()
if(TARGET python-fd)
get_target_property(fd_plugin_binary_path python-fd BINARY_DIR)
#get_target_property(fd_plugin_binary_path python-fd BINARY_DIR)
set(fd_plugin_binary_path /usr/lib64/bareos/plugins)
endif()

set(sbindir ${PROJECT_BINARY_DIR}/sbin)
Expand Down
2 changes: 1 addition & 1 deletion systemtests/bin/bareos
Expand Up @@ -2,4 +2,4 @@
# script to start and stop daemons for individual test
. ./environment
${scripts}/bareos-config initialize_database_driver
${scripts}/bareos $@
${rscripts}/bareos $@
5 changes: 2 additions & 3 deletions systemtests/scripts/setup
@@ -1,10 +1,9 @@
#!/bin/sh
echo "running $0"
echo "running $0 with scripts from ${scripts}"
${scripts}/bareos-config initialize_database_driver
. ${scripts}/functions
. ${rscripts}/functions

print_debug "drop database \"${db_name}\" (${DBTYPE})"
#${scripts}/drop_bareos_tables ${DBTYPE} >/dev/null 2>&1
${scripts}/drop_bareos_database ${DBTYPE} >/dev/null 2>&1

print_debug "creating database \"${db_name}\" (${DBTYPE})"
Expand Down
8 changes: 4 additions & 4 deletions systemtests/tests/backup-bareos-test/testrunner
Expand Up @@ -8,6 +8,10 @@ export TestName

JobName=backup-bareos-fd
. ./environment
. ${rscripts}/functions

${rscripts}/cleanup
${rscripts}/setup

echo "
testing information:
Expand All @@ -21,10 +25,6 @@ scripts: ${scripts}



. ${rscripts}/functions

${rscripts}/cleanup
${rscripts}/setup


# Directory to backup.
Expand Down
Expand Up @@ -9,10 +9,10 @@ export TestName

JobName=backup-bareos-fd
. ./environment
. ${scripts}/functions
. ${rscripts}/functions

${scripts}/cleanup
${scripts}/setup
${rscripts}/cleanup
${rscripts}/setup

xtrabackup_test_db="${db_name}_xtrabackup"
BCONSOLE="${current_test_directory}/bin/bconsole"
Expand Down

0 comments on commit 3ea9691

Please sign in to comment.