]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/etc-test-root
Add Allow Duplicate Jobs to copy-uncopied-test regression test for bug #1751
[bacula/bacula] / regress / tests / etc-test-root
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 #
6 TestName="etc-test-root"
7 . scripts/functions
8
9 scripts/cleanup
10 scripts/copy-test-confs
11 echo "/etc" >${cwd}/tmp/file-list
12
13 start_test
14
15 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
16 @$out /dev/null
17 messages
18 @$out ${cwd}/tmp/log1.out
19 label storage=File
20 TestVolume001
21 run job=NightlySave
22 yes
23 wait
24 messages
25 @# 
26 @# now do a restore
27 @#
28 @$out ${cwd}/tmp/log2.out
29 restore where=${cwd}/tmp/bacula-restores select    
30 unmark *
31 mark *
32 done
33 yes
34 wait
35 messages
36 quit
37 END_OF_DATA
38
39 run_bacula
40 check_for_zombie_jobs storage=File
41 stop_bacula
42
43 # more cleanup needed below
44
45 cd /
46 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1       
47 cd ${cwd}/tmp/bacula-restores
48 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2
49 sort <${cwd}/tmp/1 >${cwd}/tmp/original
50 sort <${cwd}/tmp/2 >${cwd}/tmp/restored
51 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
52 cd ${cwd}
53 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null
54 if [ $? != 0 ] ; then
55    echo " "
56    echo " "
57    echo "  ===== !!!! etc-test-root failed !!!! ===== "
58    echo "  ===== !!!! etc-test-root failed !!!! ===== " >>test.out
59    echo " "
60 else
61    echo "  ===== etc-test-root OK ===== "
62    echo "  ===== etc-test-root OK ===== " >>test.out
63    scripts/cleanup
64 fi