/
testrunner
executable file
·92 lines (74 loc) · 2.08 KB
/
testrunner
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
#
# This systemtest tests the Percona plugin functionality
# of the Bareos FD by using the supplied module
# BareosFdPluginPercona.py
#
TestName="$(basename "$(pwd)")"
export TestName
JobName=backup-bareos-fd
. ./environment
. ${scripts}/functions
${scripts}/cleanup
${scripts}/setup
BCONSOLE="${current_test_directory}/bin/bconsole"
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 $tmp/log1.out
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
end_test