acls02.at 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. #
  3. # Test suite for GNU tar.
  4. # Copyright (C) 2011 Free Software Foundation, Inc.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3, or (at your option)
  9. # any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. # Test description:
  20. #
  21. # This is basic test for acl support.
  22. AT_SETUP([acls: work with -C])
  23. AT_KEYWORDS([xattrs acls acls02])
  24. AT_TAR_CHECK([
  25. AT_XATTRS_UTILS_PREREQ
  26. AT_ACLS_PREREQ
  27. mkdir dir
  28. mkdir dir/subdir
  29. genfile --file dir/subdir/file
  30. MYNAME=$( id -un )
  31. setfacl -m u:$MYNAME:--x dir/subdir
  32. setfacl -m u:$MYNAME:--x dir/subdir/file
  33. cd dir
  34. getfattr -h -m. -d subdir subdir/file > ../before
  35. cd ..
  36. tar --acls -cf archive.tar -C dir subdir
  37. rm -rf dir
  38. mkdir dir
  39. tar --acls -xf archive.tar -C dir
  40. cd dir
  41. getfattr -h -m. -d subdir subdir/file > ../after
  42. cd ..
  43. diff before after
  44. test "$?" = 0
  45. ],
  46. [0],
  47. [])
  48. AT_CLEANUP