xattr04.at 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 the regression caused by tar update from 1.23 to
  20. # 1.26, Red Hat xattr patch was not ready for open->openat conversion.
  21. #
  22. # Related commit 4bde4f3. See the bug: https://bugzilla.redhat.com/717684
  23. AT_SETUP([xattrs: s/open/openat/ regression])
  24. AT_KEYWORDS([xattrs xattr04])
  25. AT_TAR_CHECK([
  26. AT_XATTRS_PREREQ
  27. mkdir dir
  28. mkdir output
  29. genfile --file dir/file
  30. setfattr -n user.test -v value dir/file
  31. # archive whole directory including binary xattrs
  32. tar --xattrs -cf archive.tar -C dir .
  33. tar --xattrs -xf archive.tar -C output
  34. ret=$?
  35. getfattr -h -d output/file | grep -v -e '^#' -e ^$
  36. exit $ret
  37. ],
  38. [0],
  39. [user.test="value"
  40. ])
  41. AT_CLEANUP