From 121c359882abca3667b12faac5684b2682cc48a8 Mon Sep 17 00:00:00 2001 From: Philipp Storz Date: Mon, 6 Jan 2020 11:12:06 +0100 Subject: [PATCH] rename BareosFdPercona.py to BareosFdPluginPercona.py --- ...sFdPercona.py => BareosFdPluginPercona.py} | 0 core/src/plugins/filed/bareos-fd-percona.py | 2 +- .../bareos-dir.d/fileset/PerconaTest.conf.in | 4 +- .../python-fd-percona-plugin-test/testrunner | 98 ++++++++++++------- 4 files changed, 65 insertions(+), 39 deletions(-) rename core/src/plugins/filed/{BareosFdPercona.py => BareosFdPluginPercona.py} (100%) diff --git a/core/src/plugins/filed/BareosFdPercona.py b/core/src/plugins/filed/BareosFdPluginPercona.py similarity index 100% rename from core/src/plugins/filed/BareosFdPercona.py rename to core/src/plugins/filed/BareosFdPluginPercona.py diff --git a/core/src/plugins/filed/bareos-fd-percona.py b/core/src/plugins/filed/bareos-fd-percona.py index 738aa12976d..40dc7bd271c 100644 --- a/core/src/plugins/filed/bareos-fd-percona.py +++ b/core/src/plugins/filed/bareos-fd-percona.py @@ -13,7 +13,7 @@ from BareosFdWrapper import * # This module contains the used plugin class -from BareosFdPercona import * +from BareosFdPluginPercona import * def load_bareos_plugin(context, plugindef): ''' diff --git a/systemtests/tests/python-fd-percona-plugin-test/etc/bareos/bareos-dir.d/fileset/PerconaTest.conf.in b/systemtests/tests/python-fd-percona-plugin-test/etc/bareos/bareos-dir.d/fileset/PerconaTest.conf.in index dccd4b86ed9..71d41f37201 100644 --- a/systemtests/tests/python-fd-percona-plugin-test/etc/bareos/bareos-dir.d/fileset/PerconaTest.conf.in +++ b/systemtests/tests/python-fd-percona-plugin-test/etc/bareos/bareos-dir.d/fileset/PerconaTest.conf.in @@ -1,10 +1,10 @@ FileSet { Name = "PerconaTest" - Description = "Test the Plugin functionality of the oVirt Plugin." + Description = "Test the Plugin functionality of the Percona Plugin." Include { Options { signature = MD5 } - Plugin = "python:module_path=@python_plugin_module_src_test_dir@:module_name=bareos-fd-percona:ca=@current_test_directory@/etc/bareos/percona-ca.cert:server=@percona_server@:username=@percona_user@:password=@percona_password@:vm_name=@percona_vm_name@:include_disk_aliases=@percona_include_disk_alias@" + Plugin = "python:module_path=@python_plugin_module_src_test_dir@:module_name=bareos-fd-percona" } } diff --git a/systemtests/tests/python-fd-percona-plugin-test/testrunner b/systemtests/tests/python-fd-percona-plugin-test/testrunner index 15bd742cc32..962a6316e79 100755 --- a/systemtests/tests/python-fd-percona-plugin-test/testrunner +++ b/systemtests/tests/python-fd-percona-plugin-test/testrunner @@ -1,6 +1,6 @@ #!/bin/sh # -# This systemtest tests the oVirt plugin functionality +# This systemtest tests the Percona plugin functionality # of the Bareos FD by using the supplied module # BareosFdPluginPercona.py # @@ -14,53 +14,79 @@ JobName=backup-bareos-fd ${scripts}/cleanup ${scripts}/setup -# Directory to backup. -# This directory will be created by setup_data(). -# BackupDirectory="${tmp}/data" +BCONSOLE="${current_test_directory}/bin/bconsole" -# Use a tgz to setup data to be backed up. -# Data will be placed at "${tmp}/data/". -# setup_data start_test +echo "------ running PERCONA tests" +echo "drop database ${db_name}_percona" | mysql +echo "create database ${db_name}_percona" | mysql +echo "CREATE TABLE test ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, data VARCHAR(100), created TIMESTAMP DEFAULT NOW()) " | mysql ${db_name}_percona +echo "insert into test (data) VALUES ('test eintrag 1') " | mysql ${db_name}_percona + + + +#cat <$tmp/bconcmds +#@$out /dev/null +#messages +#@$out $tmp/log1.out +#setdebug level=100 storage=File +#label volume=TestVolume001 storage=File pool=Full +#run job=$JobName level=Full yes +#status director +#status client +#status storage=File +#wait +#messages +#@# +#@# now do a restore +#@# +#@$out $tmp/log2.out +#wait +#restore client=bareos-fd fileset=PerconaTest where=$tmp/bareos-restores pluginoptions=python:local=yes select all done +#yes +#wait +#messages +#quit +#END_OF_DATA + + cat <$tmp/bconcmds -@$out /dev/null -messages @$out $tmp/log1.out -setdebug level=100 storage=File -label volume=TestVolume001 storage=File pool=Full -run job=$JobName level=Full yes -status director -status client -status storage=File -wait -messages -@# -@# now do a restore -@# -@$out $tmp/log2.out -wait -restore client=bareos-fd fileset=PerconaTest where=$tmp/bareos-restores pluginoptions=python:local=yes select all done -yes -wait -messages -quit +run job=$JobName +wait JobName=$JobName +status dir END_OF_DATA +run_bareos + +echo "insert into test (data) VALUES ('test eintrag 2') " | mysql ${db_name}_percona +cat <$tmp/bconcmds +@$out $tmp/log1.out +run job=$JobName +wait JobName=$JobName +status dir +END_OF_DATA run_bareos + +cat <$tmp/bconcmds +@$out $tmp/log2.out +RESTORECMD="restore client=bareos-fd fileset=PerconaTest yes restorejob=RestoreFile select all\rdone\r" +wait JobName=RestoreFile +END_OF_DATA + +# Check if xtrabackup has extracted some files at least +# TODO: verify that xtrabackup --prepare works and eventually do complete datbase restore +ls -lR $tmp/bareos-restores/_percona/ +if [ -z "$(ls -A $tmp/bareos-restores/_percona/)" ]; then + echo "No restore data found" + estat=1 +fi + check_for_zombie_jobs storage=File stop_bareos check_two_logs -# Check restored disk image content -restored_disk_image=$(find $tmp/bareos-restores -type f | grep -v "\.ovf" | tail -1) -if [ $(strings $restored_disk_image | tail -1) == "BareosTest" ]; then - echo "Restored disk image content OK" -else - echo "Restored disk image ERROR: Does not contain expected string" - dstat=1 -fi - end_test