xattr03.at 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. #
  3. # Test suite for GNU tar.
  4. # Copyright (C) 2012 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. # Setup of the trusted.* domain under privileged user.
  22. AT_SETUP([xattrs: trusted.* attributes])
  23. AT_KEYWORDS([xattrs xattr03])
  24. AT_TAR_CHECK([
  25. AT_PRIVILEGED_PREREQ
  26. AT_XATTRS_PREREQ
  27. mkdir dir
  28. mkdir dir/subdir
  29. mkdir dir/subdir/subsubdir
  30. genfile --file dir/file1
  31. genfile --file dir/subdir/file2
  32. setfattr -n trusted.test -v OurFile1Value dir/file1
  33. setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
  34. setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir
  35. tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
  36. rm -rf dir
  37. tar --xattrs --xattrs-include=trusted* -xf archive.tar
  38. getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$
  39. getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$
  40. getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$
  41. ],
  42. [0],
  43. [trusted.test="OurFile1Value"
  44. trusted.test="OurFile2Value"
  45. trusted.test="OurDirValue"
  46. ])
  47. AT_CLEANUP