dirrem01.at 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2017 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:
  16. #
  17. # When a directory in a deep directory disappeared during creation
  18. # of incremental dump, tar <= 1.29 exits with TAREXIT_FAILURE (2).
  19. #
  20. # In case of files tar does not return TAREXIT_FAILURE, but instead
  21. # it prints a warning and exits with TAREXIT_DIFFERS.
  22. #
  23. # This test checks whether this behaviour is mimicked for directories, too.
  24. # Remark: This file is based on 'filerem01.at', which is the test-case for
  25. # a vanishing file.
  26. AT_SETUP([directory removed before reading])
  27. AT_KEYWORDS([create incremental listed dirchange dirrem dirrem01])
  28. AT_TAR_CHECK([
  29. mkdir dir
  30. mkdir dir/sub
  31. genfile --file dir/file1
  32. genfile --file dir/sub/file2
  33. case "$TEST_TAR_FORMAT" in
  34. posix) CPT=5;;
  35. gnu) CPT=3;;
  36. *) AT_SKIP_TEST
  37. esac
  38. genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
  39. tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \
  40. --checkpoint-action='sleep=1' -c -f archive.tar \
  41. --listed-incremental db -v dir >/dev/null
  42. ],
  43. [1],
  44. [ignore],
  45. [tar: dir: Directory is new
  46. tar: dir/sub: Directory is new
  47. tar: dir/sub: file changed as we read it
  48. tar: dir/sub: File removed before we read it
  49. ],[],[],[gnu,posix])
  50. AT_CLEANUP