#!/bin/sh # # Copyright (C) 2000-2015 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # # Run a backup of the build directory but force it to have # a comm error, and check that it restarts correctly. # TestName="restart-job-test" JobName=RestartJob . scripts/functions scripts/cleanup scripts/copy-test-confs echo "${cwd}/build" >${cwd}/tmp/file-list change_jobname NightlySave $JobName start_test cat <${cwd}/tmp/bconcmds @output /dev/null messages @$out ${cwd}/tmp/log1.out setdebug level=0 trace=0 hangup=596 client @#setdebug level=20 dir label storage=File volume=TestVolume001 slot=1 drive=0 run job=$JobName yes wait messages sql select * from JobMedia where JobId=1; quit END_OF_DATA run_bacula scripts/check_for_zombie_jobs storage=File cat <${cwd}/tmp/bconcmds @output /dev/null messages @# @# now do a restore @# @$out ${cwd}/tmp/log2.out restore where=$tmp/bacula-restores storage=File select all done yes wait messages quit END_OF_DATA run_bconsole scripts/check_for_zombie_jobs storage=File stop_bacula check_two_logs check_restore_diff end_test