diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 92edf0b70b3..2187246c603 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -923,6 +923,7 @@ message(" GAWK: ${GAWK}") message(" RPCGEN: ${RPCGEN}") message(" MTX: ${MTX}") message(" XTRABACKUP: ${XTRABACKUP}") +message(" MARIABACKUP: ${MARIABACKUP}") message(" DEVELOPER: ${developer}") message(" LocalBuildDefinitionsFile: ${BareosLocalBuildDefinitionsFile}") message(" HAVE_IS_TRIVIALLY_COPYABLE: ${HAVE_IS_TRIVIALLY_COPYABLE}") diff --git a/core/cmake/BareosFindPrograms.cmake b/core/cmake/BareosFindPrograms.cmake index ff46060be6f..0a23b390961 100644 --- a/core/cmake/BareosFindPrograms.cmake +++ b/core/cmake/BareosFindPrograms.cmake @@ -39,3 +39,5 @@ find_program(GDB gdb) find_program(DBX dbx) find_program(MDB mdb) find_program(XTRABACKUP xtrabackup) +find_program(MARIABACKUP mariabackup) + diff --git a/systemtests/CMakeLists.txt b/systemtests/CMakeLists.txt index d1c8de465ca..492b59fed75 100644 --- a/systemtests/CMakeLists.txt +++ b/systemtests/CMakeLists.txt @@ -397,7 +397,14 @@ else() list(APPEND SYSTEM_TESTS_DISABLED "python-fd-ovirt-plugin-test") endif() -if(TARGET python-fd AND XTRABACKUP) +if(XTRABACKUP) + set (XTRABACKUP_OR_MARIABACKUP ${XTRABACKUP}) +endif() +if(MARIABACKUP) + set (XTRABACKUP_OR_MARIABACKUP ${MARIABACKUP}) + set (extradumpoptions "--user=root") +endif() +if(TARGET python-fd AND XTRABACKUP_OR_MARIABACKUP ) list(APPEND SYSTEM_TESTS "python-fd-percona-xtrabackup-plugin-test") else() list(APPEND SYSTEM_TESTS_DISABLED "python-fd-percona-xtrabackup-plugin-test") diff --git a/systemtests/tests/python-fd-percona-xtrabackup-plugin-test/etc/bareos/bareos-dir.d/fileset/PerconaXtraBackupTest.conf.in b/systemtests/tests/python-fd-percona-xtrabackup-plugin-test/etc/bareos/bareos-dir.d/fileset/PerconaXtraBackupTest.conf.in index c9f103d1433..60702c1d7a5 100644 --- a/systemtests/tests/python-fd-percona-xtrabackup-plugin-test/etc/bareos/bareos-dir.d/fileset/PerconaXtraBackupTest.conf.in +++ b/systemtests/tests/python-fd-percona-xtrabackup-plugin-test/etc/bareos/bareos-dir.d/fileset/PerconaXtraBackupTest.conf.in @@ -5,6 +5,6 @@ FileSet { Options { signature = MD5 } - Plugin = "python:module_path=@python_plugin_module_src_test_dir@:module_name=bareos-fd-percona-xtrabackup" + Plugin = "python:module_path=@python_plugin_module_src_test_dir@:module_name=bareos-fd-percona-xtrabackup:dumpbinary=@XTRABACKUP_OR_MARIABACKUP@:extradumpoptions=@extradumpoptions@" } } diff --git a/systemtests/tests/python-fd-percona-xtrabackup-plugin-test/testrunner b/systemtests/tests/python-fd-percona-xtrabackup-plugin-test/testrunner index a1d2c9e8c85..9c07b973e8b 100755 --- a/systemtests/tests/python-fd-percona-xtrabackup-plugin-test/testrunner +++ b/systemtests/tests/python-fd-percona-xtrabackup-plugin-test/testrunner @@ -15,55 +15,47 @@ ${scripts}/cleanup ${scripts}/setup xtrabackup_test_db="${db_name}_xtrabackup" +BCONSOLE="${current_test_directory}/bin/bconsole" start_test -echo "------ running PERCONA tests" echo "drop database ${xtrabackup_test_db}" | mysql echo "create database ${xtrabackup_test_db}" | mysql echo "CREATE TABLE test ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, data VARCHAR(100), created TIMESTAMP DEFAULT NOW()) " | mysql ${xtrabackup_test_db} echo "insert into test (data) VALUES ('test entry 1') " | mysql ${xtrabackup_test_db} -BCONSOLE="${current_test_directory}/bin/bconsole" - run_bareos echo "@$out $tmp/log1.out" | $BCONSOLE COMMAND="run job=$JobName" -echo -e "$COMMAND \ryes\rwait" | $BCONSOLE #| grep "Job queued. JobId=" -#sleep 5 -echo -e "wait JobName=$JobName" | $BCONSOLE -#sleep 2 +echo "$COMMAND yes" | $BCONSOLE +echo "wait JobName=$JobName" | $BCONSOLE echo "status dir" | $BCONSOLE # insert data and run incremental echo "insert into test (data) VALUES ('test entry 2') " | mysql ${xtrabackup_test_db} COMMAND="$COMMAND level=Incremental" -echo -e "$COMMAND \ryes\rwait" | $BCONSOLE #| grep "Job queued. JobId=" -#sleep 5 -echo -e "wait JobName=$JobName" | $BCONSOLE -#sleep 2 +echo "$COMMAND yes" | $BCONSOLE #| grep "Job queued. JobId=" +echo "wait JobName=$JobName" | $BCONSOLE echo "status dir" | $BCONSOLE # run incremental again without any new data -echo -e "$COMMAND \ryes\rwait" | $BCONSOLE #| grep "Job queued. JobId=" -#sleep 5 -echo -e "wait JobName=$JobName" | $BCONSOLE -#sleep 2 +echo "$COMMAND yes" | $BCONSOLE #| grep "Job queued. JobId=" +echo "wait JobName=$JobName" | $BCONSOLE echo "status dir" | $BCONSOLE # run restore -RESTORECMD="restore client=bareos-fd fileset=PerconaXtraBackupTest yes restorejob=RestoreFile select all\rdone\r" +RESTORECMD="restore client=bareos-fd fileset=PerconaXtraBackupTest yes restorejob=RestoreFile select all done" echo "@$out $tmp/log2.out" | $BCONSOLE -JOBID=`echo -e "$RESTORECMD" | $BCONSOLE | grep "Job queued. JobId=" | sed s'/.*=//' ` +JOBID=`echo "$RESTORECMD" | $BCONSOLE | grep "Job queued. JobId=" | sed s'/.*=//' ` -echo -e "wait jobid=$JOBID" | $BCONSOLE | grep -q "JobStatus=OK" +echo "wait jobid=$JOBID" | $BCONSOLE | grep -q "JobStatus=OK" if [[ $? != 0 ]]; then echo "Restore Job $JOBID failed" estat=1