3 # Attempt to backup and restore a file with the delta plugin
11 scripts/copy-plugin-confs
13 cat << EOF >> $conf/bacula-dir.conf
25 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "FileSet", "FS_DELTA", "Job", "pluginTest")'
26 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Accurate", "yes", "Job", "pluginTest")'
28 # install the delta plugin
29 make -C build/src/plugins/fd install-test-plugin >/dev/null
33 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
36 @$out ${cwd}/tmp/log1.out
37 label storage=File volume=TestVolume001
38 setdebug level=150 client=$CLIENT
39 estimate job=$JobName level=Full
40 setdebug level=50 client=$CLIENT
41 run job=$JobName comment="read 400 bytes of passwd" yes
45 run job=$JobName comment="read 100 bytes of group" level=Incremental yes
48 run job=$JobName comment="read 100 bytes of hosts" level=Incremental yes
51 run job=$JobName comment="read 100 bytes of services" level=Incremental yes
60 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
65 @$out ${cwd}/tmp/log2.out
66 setdebug level=50 client=$CLIENT
67 restore where=$tmp select all done
71 @exec "mv $tmp/delta.txt $tmp/delta.OK.txt"
72 restore where=$tmp jobid=1
78 @$out ${cwd}/tmp/log3.out
80 setdebug level=0 client=$CLIENT
90 head -c 50 /etc/passwd > $tmp/source
91 head -c 50 /etc/group >> $tmp/source
92 head -c 50 /etc/hosts >> $tmp/source
93 head -c 100 /etc/services >> $tmp/source
94 head -c 400 /etc/passwd | tail -c 150 >> $tmp/source
96 diff -u $tmp/source $tmp/delta.OK.txt > $tmp/d
98 print_debug "ERROR: delta.OK.txt and source are different, restore failed"
102 head -c 400 /etc/passwd > $tmp/source2
103 diff -u $tmp/source2 $tmp/delta.txt > $tmp/d
104 if [ $? -ne 0 ]; then
105 print_debug "ERROR: delta.txt and source2 are different, restore failed"