]> git.sur5r.net Git - bacula/bacula/blob - regress/win32/tests/restore-disk-seek-test.cmd
Final changes
[bacula/bacula] / regress / win32 / tests / restore-disk-seek-test.cmd
1 REM
2 REM Run a backup of the full bacula build directory, but with the
3 REM   Maximum File Size set. Then do a restore of a few files to kick in
4 REM   disk seeking (not yet enabled), and ensure that the restored files
5 REM   match. Even though disk seeking is not yet enabled, this is a good test,
6 REM   and once it is enabled, this will test it.
7 REM
8 SET TestName=restore-disk-seek-test
9 SET JobName=restore-disk-seek
10
11 CALL scripts\functions set_debug 1
12 CALL scripts\functions copy_test_confs
13
14 ECHO %CD:\=/%/tmp/build >\tmp\file-list
15
16 IF EXIST tmp\build RD /s /q  tmp\build
17 MKDIR tmp\build
18
19 REM Copy only the .c files (to be restored)
20 REM  set files to "*.c" for all c files
21 SET files=ua_tree.c ua_update.c
22 REM SET files=*.c
23 FOR %%i in ( %files% ) DO COPY build\src\dird\%%i tmp\build >nul 2>&1
24 DIR /b tmp\build >tmp\1
25 sed -e "s;^;%CD:\=/%/tmp/build/;" tmp\1 >tmp\restore-list
26
27 REM At this point restore-list contains the list
28 REM  of files we will restore
29 DEL tmp\1
30
31 REM Now backup *everything* 
32 IF EXIST tmp\build RD /s /q  tmp\build
33 MKDIR tmp\build
34 COPY build\src\dird\* tmp\build >nul 2>&1
35 REM Enable MaximumFileSize
36 COPY bin\bacula-sd.conf tmp\1 >nul 2>&1
37 sed "s;# Maximum File Size;  Maximum File Size;" tmp\1 >bin\bacula-sd.conf
38
39 CALL scripts\functions change_jobname CompressedTest %JobName%
40 CALL scripts\functions start_test
41
42 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\restore-disk-seek-test.bscr >tmp\bconcmds
43
44 CALL scripts\functions run_bacula
45 CALL scripts\functions check_for_zombie_jobs storage=File
46 CALL scripts\functions stop_bacula
47
48 REM Now setup a control directory of only what we *should* restore
49 RD /s /q tmp\build
50 MKDIR tmp\build
51 FOR %%i in ( %files% ) DO COPY build\src\dird\%%i tmp\build >nul 2>&1
52
53 CALL scripts\functions check_two_logs
54 CALL scripts\functions check_restore_tmp_build_diff
55 CALL scripts\functions end_test