1#!/bin/sh
2#
3# Run a simple backup using the compressed option
4#   then restore it.
5#
6TestName="lz4-test"
7JobName=lz4
8. scripts/functions
9
10#
11# See if library is linked against libfastlz
12#
13if ! check_linked_against fastlz; then
14   echo "$TestName skipped: not linked for fastlz compression"
15   exit 0
16fi
17
18scripts/cleanup
19scripts/copy-test-confs
20
21# Directory to backup.
22# This directory will be created by setup_data().
23BackupDirectory="${tmp}/data"
24
25# Use a tgz to setup data to be backuped.
26# Data will be placed at "${tmp}/data/".
27setup_data data/small.tgz
28
29# the default fileset FS_TESTJOB backups all file and directories defined in "${tmp}/file-list".
30echo "${BackupDirectory}" >${tmp}/file-list
31
32
33start_test
34
35cat <<END_OF_DATA >${cwd}/tmp/bconcmds
36@$out /dev/null
37messages
38@$out ${cwd}/tmp/log1.out
39status all
40status all
41messages
42label storage=File volume=TestVolume001
43run job=lz4Test storage=File yes
44wait
45messages
46@#
47@# now do a restore
48@#
49@$out ${cwd}/tmp/log2.out
50restore where=${cwd}/tmp/bareos-restores select storage=File
51unmark *
52mark *
53done
54yes
55wait
56messages
57quit
58END_OF_DATA
59
60run_bareos
61check_for_zombie_jobs storage=File
62stop_bareos
63
64check_two_logs
65check_restore_diff
66grep " Software Compression" ${cwd}/tmp/log1.out | grep "%" 2>&1 1>/dev/null
67if [ $? != 0 ] ; then
68   echo "  !!!!! No compression !!!!!"
69   bstat=1
70fi
71end_test
72