1#!/bin/sh
2#
3# Run a simple Verify InitCatalog, then Verify Catalog
4#
5TestName="verify-cat-test"
6JobName=VerifyCatalog
7. scripts/functions
8
9cwd=`pwd`
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#echo "${cwd}/do_all" >${cwd}/tmp/file-list
26#echo "${cwd}/do_all_tapes" >>${cwd}/tmp/file-list
27#echo "${cwd}/do_file" >>${cwd}/tmp/file-list
28
29change_jobname NightlySave $JobName
30start_test
31
32cat <<END_OF_DATA >tmp/bconcmds
33@output /dev/null
34messages
35@$out tmp/log1.out
36@#exec "sh -c 'touch ${BackupDirectory}/xxx_new_file'"
37run job=VerifyVolume level=InitCatalog yes
38wait
39messages
40@#
41@# now do a verify Catalog
42@#
43@$out ${cwd}/tmp/original
44@#exec "sh -c 'rm -f ${BackupDirectory}/xxx_new_file'"
45run job=VerifyVolume level=Catalog yes
46wait
47messages
48quit
49END_OF_DATA
50
51run_bareos
52
53sleep 2
54check_for_zombie_jobs storage=File
55stop_bareos
56
57grep "^  Termination: *Verify 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