Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
fixes fileset-multiple-options-blocks
Browse files Browse the repository at this point in the history
The option blocks in the fileset have been wrong.
The options block did only match the directory,
not the content of the directories.
  • Loading branch information
joergsteffens committed Jun 24, 2017
1 parent 3a5fcd4 commit f58c945
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 31 deletions.
Expand Up @@ -3,33 +3,31 @@ FileSet {
Include {

Options {
exclude = yes
signature=MD5
wild=@tmpdir@/data/*1
signature = MD5
wilddir = @tmpdir@/data/*1
wild = @tmpdir@/data/*1/*
}
Options {
signature=MD5
signature = MD5
compression = GZIP
wild=@tmpdir@/data/*2
wilddir = @tmpdir@/data/*2
wild = @tmpdir@/data/*2/*
}
Options {
signature=MD5
signature = MD5
compression = GZIP9
wild=@tmpdir@/data/*3
wilddir = @tmpdir@/data/*3
wild = @tmpdir@/data/*3/*
}
Options {
signature=MD5
signature = MD5
compression = LZ4
wild=@tmpdir@/data/*4
wilddir = @tmpdir@/data/*4
wild = @tmpdir@/data/*4/*
}
Options {
exclude = yes
wild=@tmpdir@/data/*5
}
Options {
signature=MD5
compression = GZIP9
wild=@tmpdir@/data/*6
exclude = yes
wild = "*"
}

File=@tmpdir@/data/
Expand Down
21 changes: 6 additions & 15 deletions tests/fileset-multiple-options-blocks
Expand Up @@ -5,15 +5,6 @@
#
# Check to use multiple fileset option blocks.
#
# NOT WORKING:
# * using different compression methods per block (with wild).
# Only compression option from last option block is evaluated.
# * using different signatures per block (with wild).
# Only signature option from last option block is evaluated.
#
# WORKING:
# * using multiple exclude option blocks (with wild).
#

# Define the Name of the test as "TestName".
# Should be the same as the filename, therefore we use the filename as default.
Expand Down Expand Up @@ -46,7 +37,7 @@ copy_configs

for i in 1 2 3 4 5 6; do
mkdir -p ${tmp}/data/data$i
echo "test" > ${tmp}/data/data$i/test.dat
echo "test" > ${tmp}/data/data${i}/test.dat
done

# start the test
Expand Down Expand Up @@ -92,18 +83,18 @@ check_two_logs
# check for differences between original files and restored files
# gives an error, because top-level data directory is not backuped
# (and has therefore other permissions)
#check_restore_diff ${BackupDirectory}/data1
if [ -e ${tmp}/bareos-restores/${BackupDirectory}/data1 ]; then
set_error "Directory data1 has been restored, however it should be excluded from the backup."
fi
check_restore_diff ${BackupDirectory}/data1
check_restore_diff ${BackupDirectory}/data2
check_restore_diff ${BackupDirectory}/data3
check_restore_diff ${BackupDirectory}/data4
#check_restore_diff ${BackupDirectory}/data5
if [ -e ${tmp}/bareos-restores/${BackupDirectory}/data5 ]; then
set_error "Directory data5 has been restored, however it should be excluded from the backup."
fi
check_restore_diff ${BackupDirectory}/data6
#check_restore_diff ${BackupDirectory}/data6
if [ -e ${tmp}/bareos-restores/${BackupDirectory}/data6 ]; then
set_error "Directory data6 has been restored, however it should be excluded from the backup."
fi

# do some manual testing
if ! [ -d ${BackupDirectory} ]; then
Expand Down

0 comments on commit f58c945

Please sign in to comment.