3 # Run a backup of the Bacula build directory with some acls
6 # The fs have to be mount with the acl option (mount -o remount,acl,user_xattr /tmp)
7 # on ubuntu, it needs the attr package
9 TestName="backup-acl-test"
18 # Zap out any schedule in default conf file so that
19 # it doesn't start during our test
22 echo "s% Schedule =%# Schedule =%g" > $outf
23 echo "s/Options {/Options { aclsupport=yes; xattrsupport = yes/" >> $outf
24 cp ${cwd}/bin/bacula-dir.conf $cwd/tmp/1
25 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
33 cp ${cwd}/bin/bconsole $d
34 setfacl -m d:user:$uid:r-x $d/testdir
35 setfacl -m d:user:root:-wx $d/testdir
36 setfacl -m user:nobody:--- $d/testdir
37 setfacl -m user:nobody:--- $d/bconsole
38 setfacl -m group:nogroup:--x $d/bconsole
39 cp ${cwd}/bin/bconsole $d/testdir
40 cp ${cwd}/bin/bconsole $d/other
41 setfattr -n bacula.test -v rulez $d/other
44 getfacl -R acl > $cwd/tmp/org
45 getfattr -R acl > $cwd/tmp/attr.org
48 change_jobname Client1 $JobName
51 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
54 @$out ${cwd}/tmp/log1.out
55 label volume=TestVolume001 storage=File pool=Default
62 @$out ${cwd}/tmp/log2.out
63 restore where=${cwd}/tmp/bacula-restores select all done
72 check_for_zombie_jobs storage=File
75 ( cd $cwd/tmp/bacula-restores/$cwd/build
76 getfacl -R acl > $cwd/tmp/new
77 getfattr -R acl > $cwd/tmp/attr.new
80 diff $cwd/tmp/org $cwd/tmp/new
85 diff $cwd/tmp/attr.org $cwd/tmp/attr.new