3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory
12 TestName="dev-test-root"
18 scripts/copy-test-confs
19 echo "/dev" >${cwd}/tmp/file-list
23 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
26 @$out ${cwd}/tmp/log1.out
27 label storage=File volume=TestVolume001
28 run job=NightlySave yes
34 @$out ${cwd}/tmp/log2.out
35 restore where=${cwd}/tmp/bacula-restores select all done
43 check_for_zombie_jobs storage=File
46 # More cleanup needed below
49 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
50 cd ${cwd}/tmp/bacula-restores
51 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
54 # Use sed to cut out parts that *always* change
56 cat >sed.scr <<END_OF_DATA
58 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ptmx%dev/ptmx%
59 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ttyp1%dev/ttyp1%
60 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/null%dev/null%
63 # strip file system change messages then sed and sort
64 grep -v "Skip: File system change prohibited." original >1
65 sed -f sed.scr 1 | sort >original
68 sed -f sed.scr 1 | sort >restored
72 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null
76 echo " ===== !!!! dev-test-root failed !!!! ===== "
77 echo " ===== !!!! dev-test-root failed !!!! ===== " >>test.out
80 echo " ===== dev-test-root OK ===== "
81 echo " ===== dev-test-root OK ===== " >>test.out