]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/strip-test
Use getfattr and setfattr on Linux not attr as that is a XFS tool which works too...
[bacula/bacula] / regress / tests / strip-test
index a7ef96d1e20fbfc338bcc5a94dcc9cf30a0dd969..dd892278a55790e5b2e74f95bf585b30b6dff408 100755 (executable)
@@ -10,7 +10,17 @@ scripts/cleanup
 scripts/copy-strip-confs
 
 
-echo "${cwd}/build/src/dird" >${cwd}/tmp/file-list
+# Make a copy of build/src/dird to be backed up
+rm -rf ${tmp}/$$-strip
+mkdir -p ${tmp}/$$-strip
+cp -rpf ${cwd}/build/src/dird/ ${tmp}/$$-strip/
+echo "${tmp}/$$-strip" >${cwd}/tmp/file-list
+
+# Now, strip the first 4 parts of the path (which is what
+#   the backup will do and put the result in rpath
+echo "${tmp}/$$-strip/" >${tmp}/1
+rpath=`cut -f5- -d'/' ${tmp}/1`
+#echo "========= $rpath"
 
 change_jobname NightlySave $JobName
 start_test
@@ -21,7 +31,7 @@ messages
 @$out ${cwd}/tmp/log1.out
 @#setdebug level=150 dir
 @#setdebug level=150 storage=FileStorage
-setdebug level=100 client
+setdebug level=100 client=$CLIENT
 label storage=FileStorage pool=Default volume=TestVolume001
 run job=$JobName storage=FileStorage pool=Default yes
 wait
@@ -32,6 +42,8 @@ END_OF_DATA
 
 run_bacula
 
+rm -rf ${cwd}/tmp/bacula-restores
+
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out /dev/null
 messages
@@ -39,12 +51,11 @@ messages
 @# now do a restore
 @#
 @$out ${cwd}/tmp/log2.out
-@#setdebug level=50 client
+@#setdebug level=50 client=$CLIENT
 restore where=${cwd}/tmp/bacula-restores select all storage=FileStorage done
 yes
 wait
 messages
-@$out
 quit
 END_OF_DATA
 
@@ -54,5 +65,14 @@ check_for_zombie_jobs storage=FileStorage
 stop_bacula
 
 check_two_logs
-#  check_restore_diff  do not check restore since we cannot backup all /etc
+#
+if test "$debug" -eq 1 ; then
+   diff -ur ${tmp}/$$-strip/ ${tmp}/bacula-restores/${rpath}
+else 
+   diff -r ${tmp}/$$-strip/ ${tmp}/bacula-restores/${rpath} 2>&1 >/dev/null
+fi
+dstat=$?
+
+rm -rf ${tmp}/$$-strip
+
 end_test