xattr05.at 1.4 KB

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