Welcome to mirror list, hosted at ThFree Co, Russian Federation.

testrunner « py2plug-fd-local-fileset-basic « tests « systemtests - github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d0e2a29ba27daefbc0960b7d8bf5b862f77f3706 (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
set -e
set -o pipefail
set -u
#
# This systemtest tests the plugin functionality
# of the Bareos FD by using the supplied module
#   bareos-fd-local-fileset.py
#
# The module will backup some files.
# This plugin is not intended for production,
# but is only a minimal example that shows
# how to use the python plugin interface.
# File attributes like uses and times will not be saved.
#
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

# this test does not work with links, because
# python 2 does not support setting mtime on links
# they are restored properly but with wrong timestamps
# This is supposed to work with the future plugin-fd interface
# using Python3
find ${tmp}/data/weird-files -type l -exec rm {} \;
find tmp/data/weird-files -links +1 -type f -exec rm {} \;
rm tmp/data/weird-files/*utf*
print_debug "$(locale)"

start_test

cat <<END_OF_DATA >$tmp/bconcmds
@$out /dev/null
messages
@$out $tmp/log1.out
setdebug level=800 client trace=1
label volume=TestVolume001 storage=File pool=Full
run job=$JobName yes
status director
status client
status storage=File
wait
messages
END_OF_DATA

run_bareos "$@"
if is_debug; then
    cat ${working_dir}/*.trace
fi
check_for_zombie_jobs storage=File
stop_bareos

cat <<END_OF_DATA >$tmp/bconcmds
@#
@# now do a restore
@#
@$out $tmp/log2.out
restore client=bareos-fd fileset=PluginTest where=$tmp/bareos-restores select all done yes
status client=bareos-fd
wait
messages
END_OF_DATA

run_bareos "$@"
check_for_zombie_jobs storage=File

check_two_logs
check_restore_diff ${BackupDirectory}

end_test