3 # Run a backup of the Bacula build directory with some acls
6 # Your filesystem must be mounted with the acl option (mount -o remount,acl,user_xattr /tmp)
7 # on ubuntu, the attr package must be installed
9 # For this script to work, you will also need a number of acl packages loaded
10 # not default on Debian derivatives:
11 # apt-get install acl libacl1 libacl1-dev attr
13 TestName="acl-xattr-test"
19 # Require getfacl to be installed
20 getfacl Makefile 2>&1 >/dev/null
21 if test $? -ne 0; then
22 echo "$TestName skipped: getfacl not installed"
26 # Require attr to be installed
27 attr -l Makefile 2>&1 >/dev/null
28 if test $? -ne 0; then
29 echo "$TestName skipped: attr not installed"
37 # Zap out any schedule in default conf file so that
38 # it doesn't start during our test
41 echo "s% Schedule =%# Schedule =%g" > $outf
42 echo "s/Options {/Options { aclsupport=yes; xattrsupport = yes/" >> $outf
43 cp ${cwd}/bin/bacula-dir.conf $cwd/tmp/1
44 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
52 cp ${cwd}/bin/bconsole $d
53 setfacl -m d:user:$uid:r-x $d/testdir
54 setfacl -m d:user:root:-wx $d/testdir
55 setfacl -m user:nobody:--- $d/testdir
56 setfacl -m user:nobody:--- $d/bconsole
57 setfacl -m group:nogroup:--x $d/bconsole
58 cp ${cwd}/bin/bconsole $d/testdir
59 cp ${cwd}/bin/bconsole $d/other
60 attr -s bacula.test -V rulez $d/other 2>/dev/null 1>/dev/null
63 getfacl -R acl > $cwd/tmp/org
64 attr -g bacula.test $d/other > $cwd/tmp/attr.org
67 change_jobname BackupClient1 $JobName
70 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
73 @$out ${cwd}/tmp/log1.out
74 label volume=TestVolume001 storage=File pool=Default
75 setdebug level=400 trace=1 client
76 setdebug level=300 trace=1 director
77 setdebug level=300 trace=1 storage
84 @$out ${cwd}/tmp/log2.out
85 restore where=${cwd}/tmp/bacula-restores select all done
94 check_for_zombie_jobs storage=File
97 ( cd $cwd/tmp/bacula-restores/$cwd/build
98 getfacl -R acl > $cwd/tmp/new
99 attr -g bacula.test $d/other > $cwd/tmp/attr.new
102 diff -u $cwd/tmp/org $cwd/tmp/new
103 if [ $? -ne 0 ]; then
107 diff $cwd/tmp/attr.org $cwd/tmp/attr.new
108 if [ $? -ne 0 ]; then
115 if [ x$REGRESS_DEBUG != x ]; then