]> git.sur5r.net Git - bacula/bacula/blob - regress/win32/tests/bsr-opt-test.cmd
Copy trunk regress into Branch
[bacula/bacula] / regress / win32 / tests / bsr-opt-test.cmd
1 REM
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
6 REM   works.
7 REM
8 SET TestName=bsr-opt-test
9 SET JobName=bsr-opt
10
11 CALL scripts\functions set_debug 0
12 CALL scripts\functions copy_test_confs
13
14 ECHO %CD:\=/%/build >\tmp\file-list
15
16 CALL scripts\functions change_jobname NightlySave %JobName%
17 CALL scripts\functions start_test
18
19 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\bsr-opt-test.bscr >tmp\bconcmds
20
21 CALL scripts\functions run_bacula
22 CALL scripts\functions check_for_zombie_jobs storage=File1
23 CALL scripts\functions stop_bacula
24 REM
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.
28 REM
29 grep TestVolume002 working\restore.bsr >nul 2>&1
30 SET bsrstat=%ERRORLEVEL%
31 CALL scripts\functions check_two_logs
32
33 diff -r build\src\cats tmp\bacula-restores\%CD::=%\build\src\cats >nul 2>&1
34 SET /A errcount = %bsrstat% + %bstat% + %rstat%
35 IF %errcount% NEQ 0 (
36    ECHO.
37    ECHO.
38    ECHO   !!!!! bsr-opt-test Bacula source failed!!! !!!!! 
39    ECHO   !!!!! bsr-opt-test failed!!! !!!!!  >>test.out
40
41    SET /A errcount = %bstat% + %rstat%
42    IF %errcount% NEQ 0 (
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
48    ) ELSE (
49       ECHO   !!!!! Restored files differ          !!!!! 
50       ECHO   !!!!! Restored files differ          !!!!!  >>test.out
51    )
52    ECHO.
53 ) ELSE (
54    ECHO   ===== bsr-opt-test Bacula source OK %TIME% ===== 
55    ECHO   ===== bsr-opt-test OK %TIME% =====  >>test.out
56    CALL scripts\cleanup
57 )