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