4
0

xattr02.at 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. #
  3. # Test suite for GNU tar.
  4. # Copyright 2011-2023 Free Software Foundation, Inc.
  5. # This file is part of GNU tar.
  6. # GNU tar 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 of the License, or
  9. # (at your option) any later version.
  10. # GNU tar is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #
  17. # Test description:
  18. #
  19. # Cooperation of the '-C' option and storing/restoring extended attributes.
  20. AT_SETUP([xattrs: change directory with -C option])
  21. AT_KEYWORDS([xattrs xattr02 chdir])
  22. AT_TAR_CHECK([
  23. AT_XATTRS_PREREQ
  24. mkdir dir
  25. mkdir dir/subdir
  26. mkdir dir/subdir/subsubdir
  27. genfile --file dir/file1
  28. genfile --file dir/subdir/file2
  29. setfattr -n user.test -v OurFile1Value dir/file1
  30. setfattr -n user.test -v OurFile2Value dir/subdir/file2
  31. setfattr -n user.test -v OurDirValue dir/subdir/subsubdir
  32. tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
  33. rm -rf dir
  34. tar --xattrs -xf archive.tar
  35. getfattr -h -d file1 | grep -v -e '^#' -e ^$
  36. getfattr -h -d file2 | grep -v -e '^#' -e ^$
  37. getfattr -h -d subsubdir | grep -v -e '^#' -e ^$
  38. ],
  39. [0],
  40. [user.test="OurFile1Value"
  41. user.test="OurFile2Value"
  42. user.test="OurDirValue"
  43. ])
  44. AT_CLEANUP