]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-jobs-test
Big backport from Enterprise
[bacula/bacula] / regress / tests / two-jobs-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the Bacula build directory using the compressed option
9 #   then backup a second time and finally restore it
10 #
11 TestName="two-jobs-test"
12 JobName=Two-Jobs
13 . scripts/functions
14
15 cwd=`pwd`
16 scripts/cleanup
17 scripts/copy-test-confs
18 echo "${cwd}/build" >${cwd}/tmp/file-list
19
20 #echo "${cwd}/build/src/Makefile" >${cwd}/tmp/file-list
21 #echo "${cwd}/build/src/Makefile.in" >>${cwd}/tmp/file-list
22 #echo "${cwd}/build/src/testprogs.tar.gz" >>${cwd}/tmp/file-list
23 #echo "${cwd}/build/src/dummy" >>${cwd}/tmp/file-list
24 #echo "${cwd}/build/src/stored" >>${cwd}/tmp/file-list
25 #echo "${cwd}/build/src/dird" >>${cwd}/tmp/file-list
26 #echo "${cwd}/build/src/filed" >>${cwd}/tmp/file-list
27 #echo "${cwd}/build/src/console" >>${cwd}/tmp/file-list
28 #echo "${cwd}/build/src/qt-console" >>${cwd}/tmp/file-list
29 #echo "${cwd}/build/src/cats" >>${cwd}/tmp/file-list
30
31 change_jobname CompressedTest $JobName
32 start_test
33
34 cat >tmp/bconcmds <<END_OF_DATA
35 setdebug level=4  storage=File
36 @output /dev/null
37 messages
38 @$out/dev/null
39 estimate job=$JobName listing
40 estimate job=$JobName
41 estimate job=$JobName
42 messages
43 @$out tmp/log1.out
44 label storage=File volume=TestVolume001
45 run job=$JobName yes
46 wait
47 messages
48 quit
49 END_OF_DATA
50
51 run_bacula
52 check_for_zombie_jobs storage=File 
53
54 #echo "Backup 1 done"
55 #$bin/bls -d 4 -v -c $conf/bacula-sd.conf -V 'TestVolume001' FileStorage
56 touch ${cwd}/build/src/dird/dird_conf.c
57 #
58 # run a second job
59 #
60 cat >tmp/bconcmds <<END_OF_DATA
61 @output /dev/null
62 messages
63 @$out tmp/log1.out
64 setdebug level=4  storage=File
65 run level=Full job=$JobName
66 yes
67 wait
68 messages
69 @# 
70 @# now do several restores to ensure we cleanup between jobs
71 @#
72 @output /dev/null
73 restore where=${cwd}/tmp/bacula-restores select all storage=File done
74 yes
75 wait
76 setdebug level=4  storage=File
77 restore where=${cwd}/tmp/bacula-restores select all storage=File done
78 yes
79 wait
80 @$out tmp/log2.out
81 setdebug level=4  storage=File
82 restore where=${cwd}/tmp/bacula-restores select storage=File
83 unmark *
84 mark *
85 lsmark
86 done
87 yes
88 wait
89 messages
90 quit
91 $bin/bls -d 4 -v -c $conf/bacula-sd.conf -V 'TestVolume001' FileStorage
92 END_OF_DATA
93
94 run_bconsole
95 check_for_zombie_jobs storage=File
96 stop_bacula
97
98 check_two_logs
99 check_restore_diff
100 #cd ${cwd}/tmp/bacula-restores/${cwd}/build
101 #for i in src/*; do \
102 #  diff -ur $i ${cwd}/build/$i
103 #  if test $? -ne 0; then
104 #    dstat=$?
105 #  fi
106 # done
107 end_test