/
testrunner
executable file
·66 lines (53 loc) · 1.27 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
#!/bin/bash
set -e
set -o pipefail
set -u
#
# Run a simple backup
# then restore it.
#
TestName="$(basename "$(pwd)")"
export TestName
JobName=backup-bareos-fd
#shellcheck source=../environment.in
. ./environment
#shellcheck source=../scripts/functions
. "${rscripts}"/functions
"${rscripts}"/cleanup
"${rscripts}"/setup
# Fill ${BackupDirectory} with data.
setup_data
start_test
cat <<END_OF_DATA >"$tmp/bconcmds"
@$out /dev/null
messages
@$out $tmp/log1.out
label volume=TestVolume001 storage=File pool=Full
run job=$JobName yes
run job=$JobName yes
status director
status client
status storage=File
wait
messages
update jobid=2 jobtype=archive
@#
@# now do a restore
@#
@$out $tmp/list-backups.out
list backups client=bareos-fd
@$out $tmp/llist-backups.out
llist backups client=bareos-fd
quit
END_OF_DATA
run_bareos "$@"
check_for_zombie_jobs storage=File
echo "Checking list backups for jobtype=backup"
grep -F '1 | backup-bareos-fd | bareos-fd' "$tmp/list-backups.out"
echo "Checking llist backups for jobtype=backup"
grep -F 'jobid: 1' "$tmp/llist-backups.out"
echo "Checking list backups for jobtype=archive"
grep -F '2 | backup-bareos-fd | bareos-fd' "$tmp/list-backups.out"
echo "Checking llist backups for jobtype=archive"
grep -F 'jobid: 2' "$tmp/llist-backups.out"
end_test