]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/backup-acl-test
ebl Tweak the test to use "wait mount" instead of sleep
[bacula/bacula] / regress / tests / backup-acl-test
index 026ff31009d3dd468cfac26361b81e9175dcee40..0b5eb4b71ca969fba3272bb618d27e1e232b2b15 100755 (executable)
@@ -6,6 +6,10 @@
 # The fs have to be mount with the acl option (mount -o remount,acl,user_xattr /tmp)
 # on ubuntu, it needs the attr package
 #
+# For this script to work, you will also need a number of acl packages loaded
+#   not default on Debian derivatives: 
+#   apt-get install acl libacl1 libacl1-dev attr
+#
 TestName="backup-acl-test"
 JobName=backup
 . scripts/functions
@@ -20,7 +24,7 @@ scripts/copy-confs
 #
 outf="tmp/sed_tmp"
 echo "s%  Schedule =%# Schedule =%g" > $outf
-echo "s/Options {/Options { aclsupport=yes/" >> $outf
+echo "s/Options {/Options { aclsupport=yes; xattrsupport = yes/" >> $outf
 cp ${cwd}/bin/bacula-dir.conf  $cwd/tmp/1
 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
 
@@ -38,9 +42,12 @@ setfacl -m user:nobody:--- $d/bconsole
 setfacl -m group:nogroup:--x $d/bconsole
 cp ${cwd}/bin/bconsole $d/testdir
 cp ${cwd}/bin/bconsole $d/other
-#setfattr -n bacula -v rulez $d/other
+setfattr -n bacula.test -v rulez $d/other
 
-(cd $cwd/build; getfacl -R acl > $cwd/tmp/org)
+( cd $cwd/build
+  getfacl -R acl > $cwd/tmp/org
+  getfattr -R acl > $cwd/tmp/attr.org
+)
 
 change_jobname Client1 $JobName
 start_test
@@ -50,6 +57,9 @@ cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 messages
 @$out ${cwd}/tmp/log1.out
 label volume=TestVolume001 storage=File pool=Default
+setdebug level=400 trace=1 client
+setdebug level=300 trace=1 director
+setdebug level=300 trace=1 storage
 run job=$JobName yes
 wait
 messages
@@ -69,14 +79,26 @@ run_bacula
 check_for_zombie_jobs storage=File
 stop_bacula
 
-(cd $cwd/tmp/bacula-restores/$cwd/build; getfacl -R acl > $cwd/tmp/new)
+( cd $cwd/tmp/bacula-restores/$cwd/build
+  getfacl -R acl > $cwd/tmp/new
+  getfattr -R acl > $cwd/tmp/attr.new
+)
 
 diff $cwd/tmp/org $cwd/tmp/new
 if [ $? -ne 0 ]; then
    rstat=1
 fi
 
+diff $cwd/tmp/attr.org $cwd/tmp/attr.new
+if [ $? -ne 0 ]; then
+   rstat=1
+fi
+
 check_two_logs
 check_restore_diff
 
+if [ x$REGRESS_DEBUG != x ]; then
+  rm -rf $d
+fi
+
 end_test