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

Commit

Permalink
Added checks for lzfast lib compression algorithms.
Browse files Browse the repository at this point in the history
Also fixed the dartfile and the all-disk-tests script.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
pstorz authored and Marco van Wieringen committed Jun 6, 2013
1 parent ff5bdc7 commit 1b30dbb
Show file tree
Hide file tree
Showing 9 changed files with 441 additions and 13 deletions.
11 changes: 9 additions & 2 deletions DartTestfile.txt.in
@@ -1,5 +1,3 @@
ADD_TEST(disk:rerun-test "@regressdir@/tests/rerun-test")
ADD_TEST(disk:subscription-test "@regressdir@/tests/subscription-test")
ADD_TEST(disk:acl-xattr-test "@regressdir@/tests/acl-xattr-test")
ADD_TEST(disk:action-on-purge-test "@regressdir@/tests/action-on-purge-test")
ADD_TEST(disk:accurate-test "@regressdir@/tests/accurate-test")
Expand Down Expand Up @@ -98,6 +96,15 @@ ADD_TEST(disk:quota-softquota-test "@regressdir@/tests/quota-softquota-test")
ADD_TEST(disk:quota-hardquota-test "@regressdir@/tests/quota-hardquota-test")
ADD_TEST(disk:quota-includefailed-test "@regressdir@/tests/quota-includefailed-test")
ADD_TEST(disk:bandwidth-limit-per-client-test "@regressdir@/tests/bandwidth-limit-per-client-test")
ADD_TEST(disk:rerun-test "@regressdir@/tests/rerun-test")
ADD_TEST(disk:status-schedule-test "@regressdir@/tests/status-schedule-test")
ADD_TEST(disk:subscription-test "@regressdir@/tests/subscription-test")
ADD_TEST(disk:lz4-encrypt-test "@regressdir@/tests/lz4-encrypt-test")
ADD_TEST(disk:lz4-test "@regressdir@/tests/lz4-test")
ADD_TEST(disk:lz4hc-encrypt-test "@regressdir@/tests/lz4hc-encrypt-test")
ADD_TEST(disk:lz4hc-test "@regressdir@/tests/lz4hc-test")
ADD_TEST(disk:lzfast-encrypt-test "@regressdir@/tests/lzfast-encrypt-test")
ADD_TEST(disk:lzfast-test "@regressdir@/tests/lzfast-test")

ADD_TEST(tape:scsi-crypto-tape "@regressdir@/tests/scsi-crypto-test")
ADD_TEST(tape:ansi-label-tape "@regressdir@/tests/ansi-label-tape")
Expand Down
9 changes: 9 additions & 0 deletions all-disk-tests
Expand Up @@ -118,6 +118,15 @@ echo "Start non-root virtual disk autochanger tests" >>test.out
./run tests/quota-hardquota-test
./run tests/quota-includefailed-test
./run tests/bandwidth-limit-per-client-test
./run tests/rerun-test
./run tests/status-schedule-test
./run tests/subscription-test
./run tests/lz4-encrypt-test
./run tests/lz4-test
./run tests/lz4hc-encrypt-test
./run tests/lz4hc-test
./run tests/lzfast-encrypt-test
./run tests/lzfast-test
# Turn back on after next_vol.c bug is fixed
# ./run tests/next-vol-test
echo "End non-root virtual disk autochanger tests"
Expand Down
107 changes: 96 additions & 11 deletions scripts/new-test-bareos-dir.conf.in
Expand Up @@ -130,6 +130,7 @@ Job {
Maximum Concurrent Jobs = 10
}

##### LZO
Job {
Name = "LZOTest"
Type = Backup
Expand All @@ -144,6 +145,101 @@ Job {
SpoolData=yes
}

FileSet {
Name = "LZOSet"
Include {
Options {
signature=MD5
compression=LZO
}
File = <@tmpdir@/file-list
}
}
###### LZO END

##### lzfast
Job {
Name = "lzfastTest"
Type = Backup
Client=@hostname@-fd
FileSet="lzfastSet"
Storage = File
Messages = Standard
Pool = Default
Maximum Concurrent Jobs = 10
Write Bootstrap = "@working_dir@/NightlySave.bsr"
Max Run Time = 30min
SpoolData=yes
}

FileSet {
Name = "lzfastSet"
Include {
Options {
signature=MD5
compression=lzfast
}
File = <@tmpdir@/file-list
}
}
###### lzfast END

##### lz4
Job {
Name = "lz4Test"
Type = Backup
Client=@hostname@-fd
FileSet="lz4Set"
Storage = File
Messages = Standard
Pool = Default
Maximum Concurrent Jobs = 10
Write Bootstrap = "@working_dir@/NightlySave.bsr"
Max Run Time = 30min
SpoolData=yes
}

FileSet {
Name = "lz4Set"
Include {
Options {
signature=MD5
compression=lz4
}
File = <@tmpdir@/file-list
}
}
###### lz4 END

##### lz4hc
Job {
Name = "lz4hcTest"
Type = Backup
Client=@hostname@-fd
FileSet="lz4hcSet"
Storage = File
Messages = Standard
Pool = Default
Maximum Concurrent Jobs = 10
Write Bootstrap = "@working_dir@/NightlySave.bsr"
Max Run Time = 30min
SpoolData=yes
}

FileSet {
Name = "lz4hcSet"
Include {
Options {
signature=MD5
compression=lz4hc
}
File = <@tmpdir@/file-list
}
}
###### lz4hc END



Job {
Name = "SparseLZOTest"
Type = Backup
Expand Down Expand Up @@ -265,17 +361,6 @@ FileSet {
}
}

FileSet {
Name = "LZOSet"
Include {
Options {
signature=MD5
compression=LZO
}
File = <@tmpdir@/file-list
}
}

FileSet {
Name = "FIFOSet"
Include {
Expand Down
51 changes: 51 additions & 0 deletions tests/lz4-encrypt-test
@@ -0,0 +1,51 @@
#!/bin/sh
#
# Run a simple backup with encryption and compression of the Bareos build directory
# then verify the signatures.
#
TestName="lzo-encrypt-test"
JobName=lz4Test
. scripts/functions

scripts/cleanup
scripts/copy-crypto-confs
echo "${cwd}/build" >${cwd}/tmp/file-list

# set compatible mode for filedaemon so that lz4hc is allowed
cp ${scripts}/bareos-fd.conf ${scripts}/bareos-fd.conf.tmp
sed -e 's#FileDaemon {.*#FileDaemon { compatible=no#' < ${scripts}/bareos-fd.conf.tmp > ${scripts}/bareos-fd.conf

start_test

cat <<END_OF_DATA >${cwd}/tmp/bconcmds
@$out /dev/null
messages
@$out ${cwd}/tmp/log1.out
label storage=File volume=TestVolume001
run job=$JobName yes
wait
messages
list volumes
@#
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
@# setdebug level=0 fd
restore where=${cwd}/tmp/bareos-restores storage=File
5
mark *
done
yes
wait
messages
quit
END_OF_DATA

run_bareos
sleep 2
check_for_zombie_jobs storage=File
stop_bareos

check_two_logs
check_restore_diff
end_test
57 changes: 57 additions & 0 deletions tests/lz4-test
@@ -0,0 +1,57 @@
#!/bin/sh
#
# Run a simple backup of the Bareos build directory using the compressed option
# then restore it.
#
TestName="lz4-test"
JobName=lz4
. scripts/functions

scripts/cleanup
scripts/copy-test-confs
echo "${cwd}/build" >${cwd}/tmp/file-list


# set compatible mode for filedaemon so that lz4hc is allowed
cp ${scripts}/bareos-fd.conf ${scripts}/bareos-fd.conf.tmp
sed -e 's#FileDaemon {.*#FileDaemon { compatible=no#' < ${scripts}/bareos-fd.conf.tmp > ${scripts}/bareos-fd.conf

start_test

cat <<END_OF_DATA >${cwd}/tmp/bconcmds
@$out /dev/null
messages
@$out ${cwd}/tmp/log1.out
status all
status all
messages
label storage=File volume=TestVolume001
run job=lz4Test storage=File yes
wait
messages
@#
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
restore where=${cwd}/tmp/bareos-restores select storage=File
unmark *
mark *
done
yes
wait
messages
quit
END_OF_DATA

run_bareos
check_for_zombie_jobs storage=File
stop_bareos

check_two_logs
check_restore_diff
grep " Software Compression" ${cwd}/tmp/log1.out | grep "%" 2>&1 1>/dev/null
if [ $? != 0 ] ; then
echo " !!!!! No compression !!!!!"
bstat=1
fi
end_test
51 changes: 51 additions & 0 deletions tests/lz4hc-encrypt-test
@@ -0,0 +1,51 @@
#!/bin/sh
#
# Run a simple backup with encryption and compression of the Bareos build directory
# then verify the signatures.
#
TestName="lzo-encrypt-test"
JobName=lz4hcTest
. scripts/functions

scripts/cleanup
scripts/copy-crypto-confs
echo "${cwd}/build" >${cwd}/tmp/file-list

# set compatible mode for filedaemon so that lz4hc is allowed
cp ${scripts}/bareos-fd.conf ${scripts}/bareos-fd.conf.tmp
sed -e 's#FileDaemon {.*#FileDaemon { compatible=no#' < ${scripts}/bareos-fd.conf.tmp > ${scripts}/bareos-fd.conf

start_test

cat <<END_OF_DATA >${cwd}/tmp/bconcmds
@$out /dev/null
messages
@$out ${cwd}/tmp/log1.out
label storage=File volume=TestVolume001
run job=$JobName yes
wait
messages
list volumes
@#
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
@# setdebug level=0 fd
restore where=${cwd}/tmp/bareos-restores storage=File
5
mark *
done
yes
wait
messages
quit
END_OF_DATA

run_bareos
sleep 2
check_for_zombie_jobs storage=File
stop_bareos

check_two_logs
check_restore_diff
end_test
57 changes: 57 additions & 0 deletions tests/lz4hc-test
@@ -0,0 +1,57 @@
#!/bin/sh
#
# Run a simple backup of the Bareos build directory using the compressed option
# then restore it.
#
TestName="lz4hc-test"
JobName=lz4hc
. scripts/functions

scripts/cleanup
scripts/copy-test-confs
echo "${cwd}/build" >${cwd}/tmp/file-list


# set compatible mode for filedaemon so that lz4hc is allowed
cp ${scripts}/bareos-fd.conf ${scripts}/bareos-fd.conf.tmp
sed -e 's#FileDaemon {.*#FileDaemon { compatible=no#' < ${scripts}/bareos-fd.conf.tmp > ${scripts}/bareos-fd.conf

start_test

cat <<END_OF_DATA >${cwd}/tmp/bconcmds
@$out /dev/null
messages
@$out ${cwd}/tmp/log1.out
status all
status all
messages
label storage=File volume=TestVolume001
run job=lz4hcTest storage=File yes
wait
messages
@#
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
restore where=${cwd}/tmp/bareos-restores select storage=File
unmark *
mark *
done
yes
wait
messages
quit
END_OF_DATA

run_bareos
check_for_zombie_jobs storage=File
stop_bareos

check_two_logs
check_restore_diff
grep " Software Compression" ${cwd}/tmp/log1.out | grep "%" 2>&1 1>/dev/null
if [ $? != 0 ] ; then
echo " !!!!! No compression !!!!!"
bstat=1
fi
end_test

0 comments on commit 1b30dbb

Please sign in to comment.