2 REM A set of useful functions to be sourced in each test
13 ECHO === Starting %TestName% at %TIME% ===
14 ECHO === Starting %TestName% at %TIME% === >>working\log
29 CALL scripts\bacula start
30 bin\bconsole -c bin\bconsole.conf <tmp\bconcmds
32 CALL scripts\bacula start >nul 2>&1
33 bin\bconsole -c bin\bconsole.conf <tmp\bconcmds >nul 2>&1
39 bin\bconsole -c bin\bconsole.conf <tmp\bconcmds
41 bin\bconsole -c bin\bconsole.conf <tmp\bconcmds >nul 2>&1
47 bin\btape -c bin\bacula-sd.conf DDS-4 <tmp\bconcmds | tee tmp\log1.out
49 bin\btape -c bin\bacula-sd.conf DDS-4 <tmp\bconcmds >tmp\log1.out 2>&1
55 bin\bscan %1 %2 %3 %4 %5 %6 %7 %8 %9 | tools\tee tmp\log.out
57 bin\bscan %1 %2 %3 %4 %5 %6 %7 %8 %9 >nul 2>&1
62 CALL scripts\bacula stop >nul 2>&1
65 :check_for_zombie_jobs
66 CALL scripts\check_for_zombie_jobs %1 %2
71 SET oldname=NightlySave
77 IF EXIST bin\1 DEL /f bin\1
78 REN bin\bacula-dir.conf 1
79 bin\sed -e "s;%oldname%;%newname%;g" bin\1 >bin\bacula-dir.conf
80 REM ECHO Job %oldname% changed to %newname%
84 tools\grep "^ Termination: *Backup OK" tmp\log1.out >nul 2>&1
85 SET bstat=%ERRORLEVEL%
86 tools\grep "^ Termination: *Restore OK" tmp\log2.out >nul 2>&1
87 SET rstat=%ERRORLEVEL%
91 tools\diff -r build tmp\bacula-restores\%CD::=%\build >nul 2>&1
92 SET dstat=%ERRORLEVEL%
95 :check_restore_tmp_build_diff
96 tools\diff -r tmp\build tmp\bacula-restores\%CD::=%\tmp\build >nul 2>&1
97 SET dstat=%ERRORLEVEL%
101 SET /a errcount=%bstat% + %rstat% + %dstat%
102 IF %errcount% NEQ 0 (
105 ECHO !!!!! %TestName% Bacula source failed!!! !!!!!
106 ECHO !!!!! %TestName% failed!!! !!!!! >>test.out
108 ECHO !!!!! Restored files differ !!!!!
109 ECHO !!!!! Restored files differ !!!!! >>test.out
111 ECHO !!!!! Bad Job termination status !!!!!
112 ECHO !!!!! Bad Job termination status !!!!! >>test.out
116 ECHO ===== %TestName% Bacula source OK %TIME% =====
117 ECHO ===== %TestName% OK %TIME% ===== >>test.out
118 IF %debug% EQU 0 scripts\cleanup
124 CALL scripts\copy-tape-confs >nul 2>&1
125 CALL scripts\cleanup-tape
129 CALL scripts\copy-test-confs >nul 2>&1