xattr05.at 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. #
  3. # Test suite for GNU tar.
  4. # Copyright 2012-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: Test for archiving/extracting of extended attributes
  18. # having the '=' character in its keyword.
  19. #
  20. # Relevant mailing list thread:
  21. #
  22. # http://lists.gnu.org/archive/html/bug-tar/2012-10/msg00017.html
  23. AT_SETUP([xattrs: keywords with '=' and '%'])
  24. AT_KEYWORDS([xattrs xattr05 chdir])
  25. AT_TAR_CHECK([
  26. AT_XATTRS_PREREQ
  27. mkdir dir
  28. mkdir output
  29. genfile --file dir/file
  30. setfattr -n user.=NAME%3D= -v value dir/file
  31. getfattr -d dir/file | grep -v '# ' > before
  32. # archive whole directory including binary xattrs
  33. tar --xattrs -cf archive.tar -C dir .
  34. tar --xattrs -xf archive.tar -C output
  35. getfattr -d output/file | grep -v '# ' > after
  36. diff before after
  37. ],
  38. [0],
  39. [])
  40. AT_CLEANUP