Skip to content

Commit

Permalink
systemtests: backup-bareos-test: run installed binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Jan 24, 2020
1 parent c0d0f0f commit 3e7069d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
6 changes: 3 additions & 3 deletions systemtests/CMakeLists.txt
Expand Up @@ -188,14 +188,14 @@ macro(prepare_testdir_for_daemon_run)
)
file(MAKE_DIRECTORY "${current_test_directory}/sbin")
create_symlink(
"${CMAKE_CURRENT_BINARY_DIR}/sbin/bareos-dir" "${BAREOS_DIRECTOR_BINARY}"
"/sbin/bareos-dir" "${BAREOS_DIRECTOR_BINARY}"
)
create_symlink(
"${CMAKE_CURRENT_BINARY_DIR}/sbin/bareos-sd"
"/sbin/bareos-sd"
"${BAREOS_STORAGEDAEMON_BINARY}"
)
create_symlink(
"${CMAKE_CURRENT_BINARY_DIR}/sbin/bareos-fd"
"/sbin/bareos-fd"
"${BAREOS_FILEDAEMON_BINARY}"
)
endmacro()
Expand Down
9 changes: 6 additions & 3 deletions systemtests/environment.in
Expand Up @@ -3,8 +3,11 @@ PROJECT_SOURCE_DIR=@PROJECT_SOURCE_DIR@
CMAKE_BINARY_DIR=@CMAKE_BINARY_DIR@

PROJECT_BINARY_DIR=@PROJECT_BINARY_DIR@
bin=${PROJECT_BINARY_DIR}/bin
sbin=${PROJECT_BINARY_DIR}/sbin
#bin=${PROJECT_BINARY_DIR}/bin
#sbin=${PROJECT_BINARY_DIR}/sbin

bin=/usr/bin
sbin=/usr/sbin

BAREOS_UNITTESTS_BINARY_DIR=$CMAKE_BINARY_DIR/core/src/tests

Expand All @@ -26,7 +29,7 @@ dumps=${current_test_directory}/dumps
plugindir=${PROJECT_BINARY_DIR}/plugins
plugindirtmp=${PROJECT_BINARY_DIR}/pluginstmp
rscripts=${PROJECT_BINARY_DIR}/scripts
scripts=${PROJECT_BINARY_DIR}/scripts
scripts=/usr/lib/bareos/scripts
cats=${PROJECT_BINARY_DIR}/cats
src=${PROJECT_BINARY_DIR}/src
tmpsrc=${PROJECT_BINARY_DIR}/tmpsrc
Expand Down
14 changes: 7 additions & 7 deletions systemtests/scripts/functions
Expand Up @@ -404,15 +404,15 @@ start_bareos()
zstat=0
estat=0
if test "$debug" -eq 1 ; then
"${scripts}/bareos-ctl-dir" start -m -d 100
"${scripts}/bareos-ctl-sd" start -m -d 100
"${scripts}/bareos-ctl-fd" start -m "$1" -d 100
"${rscripts}/bareos-ctl-dir" start -m -d 100
"${rscripts}/bareos-ctl-sd" start -m -d 100
"${rscripts}/bareos-ctl-fd" start -m "$1" -d 100
else
"${scripts}/bareos" start >/dev/null 2>&1
"${rscripts}/bareos" start >/dev/null 2>&1
fi

# check daemons
DAEMON_STATUS_OUT="$("${scripts}/bareos" status)"
DAEMON_STATUS_OUT="$("${rscripts}/bareos" status)"
DAEMON_STATUS=$?
print_debug "$DAEMON_STATUS_OUT"

Expand Down Expand Up @@ -467,9 +467,9 @@ run_bscan_db()
stop_bareos()
{
if test "$debug" -eq 1 ; then
"${scripts}/bareos" stop
"${rscripts}/bareos" stop
else
"${scripts}/bareos" stop 2>&1 >/dev/null
"${rscripts}/bareos" stop 2>&1 >/dev/null
fi
}

Expand Down
19 changes: 16 additions & 3 deletions systemtests/tests/backup-bareos-test/testrunner
Expand Up @@ -8,10 +8,23 @@ export TestName

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

${scripts}/cleanup
${scripts}/setup
echo "
testing information:
dir: $(readlink -f ${BAREOS_DIRECTOR_BINARY})
sd: $(readlink -f ${BAREOS_STORAGEDAEMON_BINARY})
fd: $(readlink -f ${BAREOS_FILEDAEMON_BINARY})
sbin: ${sbin}
scripts: ${scripts}
"




. ${rscripts}/functions

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


# Directory to backup.
Expand Down

0 comments on commit 3e7069d

Please sign in to comment.