rename01.at 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-2023 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  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. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Description: Test basic handling of renamed directory in the incremental
  16. # archives.
  17. AT_SETUP([renamed dirs in incrementals])
  18. AT_KEYWORDS([incremental rename rename01])
  19. AT_TAR_CHECK([
  20. AT_SORT_PREREQ
  21. mkdir foo
  22. genfile --file foo/file1
  23. genfile --file foo/file2
  24. mkdir foo/bar
  25. genfile --file foo/bar/file
  26. echo "Creating base archive"
  27. tar -g incr -cf arch.1 -v foo
  28. mv foo/bar foo/baz
  29. echo "Creating incremental archive"
  30. tar -g incr -cf arch.2 -v foo
  31. mv foo old
  32. tar xfg arch.1 /dev/null
  33. echo "Begin directory listing 1"
  34. find foo | sort
  35. echo "End directory listing 1"
  36. tar xfg arch.2 /dev/null
  37. echo Begin directory listing 2
  38. find foo | sort
  39. echo End directory listing 2
  40. ],
  41. [0],
  42. [Creating base archive
  43. foo/
  44. foo/bar/
  45. foo/file1
  46. foo/file2
  47. foo/bar/file
  48. Creating incremental archive
  49. foo/
  50. foo/baz/
  51. Begin directory listing 1
  52. foo
  53. foo/bar
  54. foo/bar/file
  55. foo/file1
  56. foo/file2
  57. End directory listing 1
  58. Begin directory listing 2
  59. foo
  60. foo/baz
  61. foo/baz/file
  62. foo/file1
  63. foo/file2
  64. End directory listing 2
  65. ],
  66. [tar: foo: Directory is new
  67. tar: foo/bar: Directory is new
  68. tar: foo/baz: Directory has been renamed from 'foo/bar'
  69. ],
  70. [],[],[gnu, oldgnu, posix])
  71. AT_CLEANUP
  72. # End of rename01.at