dirrem02.at 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2017-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:
  16. #
  17. # When an explicitly named directory disappears during creation
  18. # of incremental dump, tar should still exit with TAREXIT_FAILURE (2).
  19. #
  20. # For further details see dirrem01.at
  21. # Remark: This file is based on 'filerem01/02.at', which are test-cases for
  22. # vanishing files.
  23. AT_SETUP([explicitly named directory removed before reading])
  24. AT_KEYWORDS([create incremental listed dirchange dirrem dirrem02])
  25. AT_TAR_CHECK([
  26. mkdir dir
  27. mkdir dir/sub
  28. genfile --file dir/file1
  29. genfile --file dir/sub/file2
  30. case "$TEST_TAR_FORMAT" in
  31. posix) CPT=5;;
  32. gnu) CPT=3;;
  33. *) AT_SKIP_TEST
  34. esac
  35. genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
  36. tar --blocking-factor=1 -c -f archive.tar \
  37. --listed-incremental db \
  38. --warning=no-file-changed \
  39. -v dir dir/sub >/dev/null
  40. ],
  41. [2],
  42. [ignore],
  43. [tar: dir: Directory is new
  44. tar: dir/sub: Directory is new
  45. tar: dir/sub: Cannot open: No such file or directory
  46. tar: Exiting with failure status due to previous errors
  47. ],[],[],[gnu,posix])
  48. AT_CLEANUP