1#!/bin/sh
2#
3# Run a simple backup  using the Sparse option
4#   then restore it.
5#
6TestName="sparse-test"
7JobName=SparseTest
8. scripts/functions
9
10scripts/cleanup
11scripts/copy-test-confs
12
13# Directory to backup.
14# This directory will be created by setup_data().
15BackupDirectory="${tmp}/data"
16
17# Use a tgz to setup data to be backuped.
18# Data will be placed at "${tmp}/data/".
19setup_data data/small.tgz
20
21# the default fileset FS_TESTJOB backups all file and directories defined in "${tmp}/file-list".
22echo "${BackupDirectory}" >${tmp}/file-list
23
24
25
26start_test
27
28cat >${cwd}/tmp/bconcmds <<END_OF_DATA
29@$out /dev/null
30messages
31@$out ${cwd}/tmp/log1.out
32label storage=File volume=TestVolume001
33run job=$JobName yes
34wait
35messages
36@#
37@# now do a restore
38@#
39@$out ${cwd}/tmp/log2.out
40restore where=${cwd}/tmp/bareos-restores select storage=File
41unmark *
42mark *
43done
44yes
45wait
46messages
47quit
48END_OF_DATA
49
50run_bareos
51check_for_zombie_jobs storage=File
52stop_bareos
53
54check_two_logs
55check_restore_diff
56end_test
57