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