Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rename BareosFdPercona.py to BareosFdPluginPercona.py
  • Loading branch information
pstorz authored and franku committed Jan 13, 2020
1 parent e7f19b7 commit 121c359
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 39 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion core/src/plugins/filed/bareos-fd-percona.py
Expand Up @@ -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):
'''
Expand Down
@@ -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"
}
}
98 changes: 62 additions & 36 deletions 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
#
Expand All @@ -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 <<END_OF_DATA >$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 <<END_OF_DATA >$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 <<END_OF_DATA >$tmp/bconcmds
@$out $tmp/log1.out
run job=$JobName
wait JobName=$JobName
status dir
END_OF_DATA
run_bareos

cat <<END_OF_DATA >$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

0 comments on commit 121c359

Please sign in to comment.