1#!/bin/sh
2#
3# Run a simple backup
4#   then verify the catalog.
5#
6TestName="verify-vol-tape"
7JobName=VerifyVol
8. scripts/functions
9
10require_tape_drive
11
12scripts/cleanup-tape
13scripts/copy-tape-confs
14
15change_jobname NightlySave $JobName
16
17# Directory to backup.
18# This directory will be created by setup_data().
19BackupDirectory="${tmp}/data"
20
21# Use a tgz to setup data to be backuped.
22# Data will be placed at "${tmp}/data/".
23setup_data data/small.tgz
24
25# the default fileset FS_TESTJOB backups all file and directories defined in "${tmp}/file-list".
26echo "${BackupDirectory}" >${tmp}/file-list
27
28
29start_test
30
31cat <<END_OF_DATA >tmp/bconcmds
32@$out /dev/null
33messages
34@$out tmp/log1.out
35setdebug level=1 storage=tape sd
36label storage=tape volume=TestVolume001 pool=Default
37run job=$JobName yes
38wait
39messages
40@#
41@# now do a verify volume
42@#
43@$out ${cwd}/tmp/original
44run job=VerifyTape pool=Default
45yes
46wait
47messages
48quit
49END_OF_DATA
50
51run_bareos
52
53sleep 2
54check_for_zombie_jobs storage=tape
55stop_bareos
56
57grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
58bstat=$?
59grep "^  Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null
60rstat=$?
61dstat=0
62end_test
63