xattr02.at 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. # Cooperation of the '-C' option and storing/restoring extended attributes.
  22. AT_SETUP([xattrs: change directory with -C option])
  23. AT_KEYWORDS([xattrs xattr02])
  24. AT_TAR_CHECK([
  25. AT_XATTRS_PREREQ
  26. mkdir dir
  27. mkdir dir/subdir
  28. mkdir dir/subdir/subsubdir
  29. genfile --file dir/file1
  30. genfile --file dir/subdir/file2
  31. setfattr -n user.test -v OurFile1Value dir/file1
  32. setfattr -n user.test -v OurFile2Value dir/subdir/file2
  33. setfattr -n user.test -v OurDirValue dir/subdir/subsubdir
  34. tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
  35. rm -rf dir
  36. tar --xattrs -xf archive.tar
  37. getfattr -h -d file1 | grep -v -e '^#' -e ^$
  38. getfattr -h -d file2 | grep -v -e '^#' -e ^$
  39. getfattr -h -d subsubdir | grep -v -e '^#' -e ^$
  40. ],
  41. [0],
  42. [user.test="OurFile1Value"
  43. user.test="OurFile2Value"
  44. user.test="OurDirValue"
  45. ])
  46. AT_CLEANUP