2 REM Run a simple backup of the Bacula build directory then create some
3 REM new files, do an Incremental and restore those two files.
5 SET TestName=incremental-test
6 SET JobName=Incremental
8 CALL scripts\functions set_debug 0
9 CALL scripts\functions copy_test_confs
11 ECHO %CD:\=/%/tmp/build>${cwd}/tmp/file-list
14 COPY build\src\dird\*.c tmp\build >nul 2>&1
16 ECHO %CD:\=/%/tmp/build/ficheriro1.txt>tmp\restore-list
17 ECHO %CD:\=/%/tmp/build/ficheriro2.txt>>tmp\restore-list
19 CALL scripts\functions change_jobname CompressedTest %JobName%
20 CALL scripts\functions start_test
22 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\incremental-test.1.bscr >tmp\bconcmds
24 CALL scripts\functions run_bacula
25 CALL scripts\functions check_for_zombie_jobs storage=File
27 REM Now create two new files to be restored later
30 ECHO ficheriro1.txt >tmp\build\ficheriro1.txt
31 COPY tmp\build\dird.c tmp\build\ficheriro2.txt >nul 2>&1
33 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\incremental-test.2.bscr >tmp\bconcmds
35 CALL scripts\functions run_bconsole
38 touch tmp\build\ficheriro1.txt
39 touch tmp\build\ficheriro2.txt
41 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\incremental-test.3.bscr >tmp\bconcmds
43 CALL scripts\functions run_bconsole
47 COPY tmp\build\ficheriro2.txt tmp\build\1 >nul 2>&1
48 sed -e "s;a;b;g" tmp\build\1 >tmp\build\ficheriro2.txt
51 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\incremental-test.4.bscr >tmp\bconcmds
53 CALL scripts\functions run_bconsole
56 touch tmp\build\ficheriro1.txt
57 touch tmp\build\ficheriro2.txt
58 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\incremental-test.3.bscr >tmp\bconcmds
60 CALL scripts\functions run_bconsole
63 touch tmp\build\ficheriro1.txt
64 touch tmp\build\ficheriro2.txt
65 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\incremental-test.3.bscr >tmp\bconcmds
67 CALL scripts\functions run_bconsole
70 touch tmp\build\ficheriro1.txt
71 touch tmp\build\ficheriro2.txt
72 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\incremental-test.3.bscr >tmp\bconcmds
74 CALL scripts\functions run_bconsole
76 touch tmp\build\ficheriro1.txt
77 touch tmp\build\ficheriro2.txt
79 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\incremental-test.5.bscr >tmp\bconcmds
81 CALL scripts\functions run_bconsole
82 CALL scripts\functions check_for_zombie_jobs storage=File
83 CALL scripts\functions stop_bacula
85 CALL scripts\functions check_two_logs
87 REM Delete .c files because we will only restored the txt files
90 CALL scripts\functions check_restore_tmp_build_diff
91 CALL scripts\functions end_test