2 REM Run a simple backup of the Bacula build directory but
3 REM split the archive into two volumes, then restore
4 REM files on only one of the volumes and ensure that
5 REM the other volume is not used. I.e. bsr optimization
8 SET TestName=bsr-opt-test
11 CALL scripts\functions set_debug 0
12 CALL scripts\functions copy_test_confs
14 ECHO %CD:\=/%/build >\tmp\file-list
16 CALL scripts\functions change_jobname NightlySave %JobName%
17 CALL scripts\functions start_test
19 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\bsr-opt-test.bscr >tmp\bconcmds
21 CALL scripts\functions run_bacula
22 CALL scripts\functions check_for_zombie_jobs storage=File1
23 CALL scripts\functions stop_bacula
25 REM This test is not really reliable. What we want to do is
26 REM to select files on only one Volume, then insure here
27 REM that only one Volume is chosen.
29 grep TestVolume002 working\restore.bsr >nul 2>&1
30 SET bsrstat=%ERRORLEVEL%
31 CALL scripts\functions check_two_logs
33 diff -r build\src\cats tmp\bacula-restores\%CD::=%\build\src\cats >nul 2>&1
34 SET /A errcount = %bsrstat% + %bstat% + %rstat%
38 ECHO !!!!! bsr-opt-test Bacula source failed!!! !!!!!
39 ECHO !!!!! bsr-opt-test failed!!! !!!!! >>test.out
41 SET /A errcount = %bstat% + %rstat%
43 ECHO !!!!! Bad Job termination status !!!!!
44 ECHO !!!!! Bad Job termination status !!!!! >>test.out
45 ) ELSE IF %bsrstat% NEQ 0 (
46 ECHO !!!!! Volume selection error !!!!!
47 ECHO !!!!! Volume selection error !!!!! >>test.out
49 ECHO !!!!! Restored files differ !!!!!
50 ECHO !!!!! Restored files differ !!!!! >>test.out
54 ECHO ===== bsr-opt-test Bacula source OK %TIME% =====
55 ECHO ===== bsr-opt-test OK %TIME% ===== >>test.out