/
testrunner
executable file
·70 lines (56 loc) · 1.15 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
#!/bin/sh
#
# Run a simple backup
# then restore it.
#
TestName="$(basename "$(pwd)")"
export TestName
JobName=backup-bareos-fd
. ./environment
. ${rscripts}/functions
${rscripts}/cleanup
${rscripts}/setup
echo "
testing information:
dir: $(readlink -f ${BAREOS_DIRECTOR_BINARY})
sd: $(readlink -f ${BAREOS_STORAGEDAEMON_BINARY})
fd: $(readlink -f ${BAREOS_FILEDAEMON_BINARY})
sbin: ${sbin}
scripts: ${scripts}
"
# Directory to backup.
# This directory will be created by setup_data().
BackupDirectory="${tmp}/data"
# Use a tgz to setup data to be backed up.
# Data will be placed at "${tmp}/data/".
setup_data
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 yes
status director
status client
status storage=File
wait
messages
@#
@# now do a restore
@#
@$out $tmp/log2.out
wait
restore client=bareos-fd fileset=SelfTest where=$tmp/bareos-restores select all done
yes
wait
messages
quit
END_OF_DATA
run_bareos
check_for_zombie_jobs storage=File
stop_bareos
check_two_logs
check_restore_diff ${BackupDirectory}
end_test