Skip to content

Commit

Permalink
systemtests: add weird files to systemtests
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Jan 31, 2020
1 parent 14b0c72 commit 0d9cace
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
1 change: 1 addition & 0 deletions systemtests/CMakeLists.txt
Expand Up @@ -506,6 +506,7 @@ set(DB_PASS @DB_PASS@)
set(DB_VERSION @DB_VERSION@)

configurefilestosystemtest("systemtests" "data" "*.tgz" COPYONLY "")
configurefilestosystemtest("systemtests" "data" "*.gz" COPYONLY "")

configurefilestosystemtest("systemtests" "scripts" "functions" @ONLY "")
configurefilestosystemtest("systemtests" "scripts" "reload_test_functions" @ONLY "")
Expand Down
Binary file added systemtests/data/weird-files.tar.gz
Binary file not shown.
28 changes: 10 additions & 18 deletions systemtests/scripts/functions
Expand Up @@ -112,27 +112,19 @@ cleanup()
#
setup_data()
{
SRC=${1:-../../data/small.tgz}
RC=0
data_dir="${tmp}/data"

if [ -z "$SRC" ]; then
set_error "setup_data: no source given."
return 1
fi
if [ ! -e "$SRC" ]; then
set_error "setup_data $SRC: $SRC not found."
return 1
fi
[ -d "$data_dir" ] || mkdir "$data_dir"

mkdir -p "${tmp}/data"
(cd "${tmp}/data" && tar xzf "${cwd}/$SRC")
RC=$?

# if [ ! -e ${tmp}/file-list ]; then
echo "${tmp}/data" >"${tmp}/file-list"
# fi
for tar in "../../data/small.tgz" "../../data/weird-files.tar.gz"; do
if [ ! -f "$tar" ]; then
set_error "setup_data: $tar not found."
return 1
fi
tar --directory="$data_dir" -xf "$tar" || return 1
done

return $RC
return 0
}

start_test()
Expand Down
7 changes: 4 additions & 3 deletions systemtests/tests/dbconvert-mysql-postgresql-test/testrunner
@@ -1,8 +1,9 @@
#!/bin/sh
#
# Run a simple backup
# then restore it.
# Run a simple backup on a mysql database
# then convert to postgresql and restore it.
#

TestName="$(basename "$(pwd)")"
export TestName

Expand Down Expand Up @@ -47,7 +48,7 @@ cp "${conf}"/bareos-dir.d/client/bareos-mysql-fd.conf.test "${conf}"/bareos-dir.
run_bareos
stop_bareos

/home/franku/01-prj/git/bareos-master/b/core/src/dird/dbconvert/bareos-dbconvert -c /home/franku/01-prj/git/bareos-master/b/systemtests/tests/dbconvert-mysql-postgresql-test/etc/bareos mysql postgresql
"${sbin}"/bareos-dbconvert -d -c ${current_test_directory}/etc/bareos mysql postgresql

cat <<END_OF_DATA >$tmp/bconcmds
@#
Expand Down

0 comments on commit 0d9cace

Please sign in to comment.