-
Notifications
You must be signed in to change notification settings - Fork 256
/
testrunner.in
executable file
·65 lines (55 loc) · 1.43 KB
/
testrunner.in
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
#!/bin/bash
set -e
set -u
#
# This systemtest tests the oVirt plugin functionality
# of the Bareos FD by using the supplied module
# BareosFdPluginOvirt.py
#
TestName="$(basename "$(pwd)")"
export TestName
JobName=backup-bareos-fd
#shellcheck source=../environment.in
. ./environment
JobName=backup-bareos-fd
#shellcheck source=../scripts/functions
. "${rscripts}"/functions
"${rscripts}"/cleanup
"${rscripts}"/setup
curl -k -o ${BAREOS_CONFIG_DIR}/ovirt-ca.cert "https://$OVIRT_SERVER/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA"
start_test
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=OvirtTest where=$tmp/bareos-restores pluginoptions=@python_module_name@:local=yes select all done
yes
wait
messages
quit
END_OF_DATA
run_bareos "$@"
check_for_zombie_jobs storage=File
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