]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/backup-to-null
Backport from Bacula Enterprise
[bacula/bacula] / regress / tests / backup-to-null
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 
9 #   to /dev/null Of course, it's not possible to restore ;-)
10 #
11 TestName="backup-to-null"
12 JobName=backuptonull
13
14
15 . scripts/functions
16
17 scripts/cleanup
18 scripts/copy-fifo-confs
19
20 echo "${cwd}/build" >${cwd}/tmp/file-list
21
22 change_jobname NightlySave $JobName
23 rm -f ${cwd}/tmp/log1.out ${cwd}/tmp/log2.out
24 start_test
25
26
27 # Write out bconsole commands
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @$out /dev/null
30 messages
31 @$out ${cwd}/tmp/log1.out
32 @#setdebug level=200 storage=Dummy
33 label storage=Dummy volume=TestVolume001 slot=0 pool=Default
34 run job=$JobName yes
35 status storage=Dummy
36 @sleep 1
37 wait
38 @sleep 3
39 messages
40 quit
41 END_OF_DATA
42
43 run_bacula
44 check_for_zombie_jobs storage=Dummy
45 stop_bacula
46
47 #
48 # Now do a second backup after making a few changes
49 #
50 touch ${cwd}/build/src/dird/*.c
51 echo "test test" > ${cwd}/build/src/dird/xxx
52
53 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
54 @$out /dev/null
55 messages
56 @$out ${cwd}/tmp/log2.out
57 list volumes
58 run job=$JobName yes
59 wait
60 list volumes
61 @sleep 3
62 messages
63 quit
64 END_OF_DATA
65
66 run_bacula
67 check_for_zombie_jobs storage=Dummy
68 stop_bacula
69
70 grep "^  Termination: *Backup OK" ${cwd}/tmp/log1.out 2>&1 >/dev/null
71 bstat=$?
72 grep "^  Termination: *Backup OK" ${cwd}/tmp/log2.out 2>&1 >/dev/null
73 dstat=$?
74
75 # not yet implemented
76 rstat=0
77
78 end_test