1#!/bin/sh 2# 3# Run a simple backup using the Sparse option 4# then restore it. 5# 6TestName="sparse-lzo-test" 7JobName=Sparse-lzo 8. scripts/functions 9 10# 11# See if library is linked against libfastlz 12# 13if ! check_linked_against lzo2; then 14 echo "$TestName skipped: not linked for lzo2 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 33 34start_test 35 36cat >${cwd}/tmp/bconcmds <<END_OF_DATA 37@$out /dev/null 38messages 39@$out ${cwd}/tmp/log1.out 40label storage=File volume=TestVolume001 41run job=SparseLZOTest yes 42wait 43messages 44@# 45@# now do a restore 46@# 47@$out ${cwd}/tmp/log2.out 48restore where=${cwd}/tmp/bareos-restores select all storage=File done 49yes 50wait 51messages 52quit 53END_OF_DATA 54 55run_bareos 56check_for_zombie_jobs storage=File 57stop_bareos 58 59check_two_logs 60check_restore_diff 61end_test 62