-
Notifications
You must be signed in to change notification settings - Fork 256
/
testrunner-error-full-restore
executable file
·70 lines (55 loc) · 1.3 KB
/
testrunner-error-full-restore
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/bash
set -e
set -o pipefail
set -u
#
# Provoke a fatal error during a restore and check that the right
# termination text is displayed.
# The error is provoked by temporarily renaming the volume.
#
TestName="$(basename "$(pwd)")"
export TestName
#shellcheck source=../environment.in
. ./environment
#shellcheck source=../scripts/functions
. "${rscripts}"/functions
#shellcheck source=functions
. functions
start_test
# we must ensure that the restore directory exists before we try to make it
# read only.
mv storage/TestVolume001{,.c}
cat <<END_OF_DATA >"$tmp/bconcmds"
@$out /dev/null
messages
@$out $log_home/setup.out
setdebug level=100 storage=File
status director
status client
status storage=File
wait
messages
@$out $log_home/jobs.out
list jobs
@$out $log_home/should-hang.out
restore client=bareos-fd fileset=SelfTest where=$tmp/bareos-restores select all done yes
@sleep 6
messages
quit
END_OF_DATA
run_bconsole
bin/bareos restart
cat <<END_OF_DATA >"$tmp/bconcmds"
@$out $log_home/should-show-error.out
wait
messages
quit
END_OF_DATA
run_bconsole
check_for_zombie_jobs storage=File
check_preconditions
expect_grep "Termination:.*Restore Error" \
"$log_home/should-show-error.out" \
"Restore of job in removed volume was not set as failed!"
mv storage/TestVolume001{.c,}
end_test