numeric.at 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2015-2016 Free Software Foundation, Inc.
  4. #
  5. # GNU tar is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  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. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. AT_SETUP([--numeric-owner basic tests])
  18. AT_KEYWORDS([options numeric numeric-owner])
  19. m4_pushdef([TESTOP],[
  20. decho $1
  21. tar $1 -vvf a dir --numeric-owner |dnl
  22. awk -vowner=$MYUID/$MYGID '@S|@2==owner {print "OK"; next} {print}'
  23. tar $1 -vvf a dir |dnl
  24. awk -vowner=$MYUSR/$MYGRP '@S|@2==owner {print "OK"; next} {print}'
  25. ])
  26. AT_TAR_CHECK([
  27. mkdir dir
  28. genfile --file dir/file
  29. MYUID=$(id -u) || AT_SKIP_TEST
  30. MYGID=$(id -g) || AT_SKIP_TEST
  31. MYUSR=$(id -un) || AT_SKIP_TEST
  32. MYGRP=$(id -gn) || AT_SKIP_TEST
  33. TESTOP([--create])
  34. TESTOP([--list])
  35. TESTOP([--diff])
  36. TESTOP([--extract])
  37. ],
  38. [0],
  39. [--create
  40. OK
  41. OK
  42. OK
  43. OK
  44. --list
  45. OK
  46. OK
  47. OK
  48. OK
  49. --diff
  50. OK
  51. OK
  52. OK
  53. OK
  54. --extract
  55. OK
  56. OK
  57. OK
  58. OK
  59. ],
  60. [--create
  61. --list
  62. --diff
  63. --extract
  64. ],[],[],[posix,gnu,ustar,oldgnu])
  65. AT_CLEANUP
  66. m4_popdef([TESTOP])