filerem01.at 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2009-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: when a file in a deep directory disappeared during creation
  16. # of incremental dump, tar v. <1.23 would exit with TAREXIT_FAILURE (2).
  17. # However, such events are quite common and don't necessarily constitute
  18. # an error. Exiting with code 2 in such cases makes it impossible to
  19. # distinguish serious errors from benign ones.
  20. #
  21. # Starting from tar 1.22.90, tar exits with TAREXIT_DIFFERS (1)
  22. # instead.
  23. #
  24. # Reported by: Solar Designer <[email protected]>
  25. #
  26. # References: <[email protected]>
  27. # http://lists.gnu.org/archive/html/bug-tar/2009-03/msg00000.html
  28. #
  29. AT_SETUP([file removed as we read it])
  30. AT_KEYWORDS([create incremental listed filechange filerem filerem01])
  31. AT_TAR_CHECK([
  32. mkdir dir
  33. mkdir dir/sub
  34. genfile --file dir/file1
  35. genfile --file dir/sub/file2
  36. genfile --run --checkpoint=3 --unlink dir/file1 -- \
  37. tar --blocking-factor=1 -c -f archive.tar \
  38. --listed-incremental db -v dir >/dev/null
  39. ],
  40. [1],
  41. [ignore],
  42. [tar: dir: Directory is new
  43. tar: dir/sub: Directory is new
  44. tar: dir/file1: File removed before we read it
  45. ],[],[],[gnu, posix])
  46. # Timing information:
  47. #
  48. # For -Hgnu the above command line takes about 8 seconds to execute and
  49. # produces:
  50. #
  51. # tar: dir: Directory is new
  52. # tar: dir/sub: Directory is new
  53. # dir/
  54. # tar: Write checkpoint 1
  55. # tar: Write checkpoint 2
  56. # dir/sub/
  57. # tar: Write checkpoint 3
  58. # tar: Write checkpoint 4
  59. # dir/file1
  60. # tar: Write checkpoint 5
  61. # dir/sub/file2
  62. # tar: Write checkpoint 6
  63. # tar: Write checkpoint 7
  64. # tar: Write checkpoint 8
  65. #
  66. # For -Hposix the above command line takes about 14 seconds to execute and
  67. # produces:
  68. #
  69. # ./tar: dir: Directory is new
  70. # ./tar: dir/sub: Directory is new
  71. # dir/
  72. # ./tar: Write checkpoint 1
  73. # ./tar: Write checkpoint 2
  74. # ./tar: Write checkpoint 3
  75. # dir/sub/
  76. # ./tar: Write checkpoint 4
  77. # ./tar: Write checkpoint 5
  78. # ./tar: Write checkpoint 6
  79. # dir/file1
  80. # ./tar: Write checkpoint 7
  81. # ./tar: Write checkpoint 8
  82. # ./tar: Write checkpoint 9
  83. # dir/sub/file2
  84. # ./tar: Write checkpoint 10
  85. # ./tar: Write checkpoint 11
  86. # ./tar: Write checkpoint 12
  87. # ./tar: Write checkpoint 13
  88. # ./tar: Write checkpoint 14
  89. AT_CLEANUP