/
testrunner
executable file
·67 lines (53 loc) · 1.16 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
#!/bin/bash
set -e
set -o pipefail
#
# 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
BackupFile="${tmp}/file-with-acl"
RestoreFile="${tmp}/bareos-restores/${BackupFile}"
acl_should="${tmp}/acl_should.txt"
acl_is="${tmp}/acl_is.txt"
mkdir -p "${BackupDirectory}"
touch "${BackupFile}"
setfacl -m user:0:r-x "${BackupFile}"
getfacl "${BackupFile}" | grep -vF file: >"$acl_should"
start_test
cat <<END_OF_DATA >$tmp/bconcmds
@$out /dev/null
messages
@$out $tmp/log1.out
setdebug level=1000 client=bareos-fd trace=1
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
check_two_logs
getfacl "${RestoreFile}" | grep -vF file: >"$acl_is"
diff -u "$acl_should" "$acl_is" || estat=1
end_test