multiv10.at 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2015-2023 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. # Description: When creating multivolume archives, the bufmap code in
  18. # buffer.c implicitly assumed that the members are stored in the archive
  19. # in a contiguous fashion, ignoring the member (and eventual extended) headers
  20. # between them. This worked until the member header happened to be at
  21. # the very beginning of the volume, in which case its length was included in
  22. # the calculation of the stored size and size left to store. Due to this,
  23. # the GNUFileParts extended header contained invalid GNU.volume.offset value,
  24. # and the resulting archive failed to extract properly. The bug affected
  25. # versions of tar up to 1.29.90 (commit da8d0659a6).
  26. #
  27. # This test case also checks that GNUFileParts headers are not displayed in
  28. # verbose mode.
  29. #
  30. # Reported by: <[email protected]>
  31. # References:
  32. # <CAE7Kiz_0oMqGdzkoh0FbOd=hUoPhtHHYhjZveM_4hEku081QFQ@mail.gmail.com>,
  33. # http://lists.gnu.org/archive/html/bug-tar/2017-05/msg00007.html
  34. #
  35. AT_SETUP([file start at the beginning of a posix volume])
  36. AT_KEYWORDS([multivolume multiv multiv10])
  37. AT_TAR_CHECK([
  38. set -e
  39. genfile --length=15360 --file data1
  40. genfile --length=15360 --file data2
  41. tar -v -c -L 10 -M -f 1.tar -f 2.tar -f 3.tar -f 4.tar -f 5.tar data1 data2
  42. tar -M -t -f 1.tar -f 2.tar -f 3.tar -f 4.tar -f 5.tar
  43. mkdir out
  44. tar -C out -M -x -f 1.tar -f 2.tar -f 3.tar -f 4.tar -f 5.tar
  45. cmp data1 out/data1
  46. cmp data2 out/data2
  47. ],
  48. [0],
  49. [data1
  50. data2
  51. data1
  52. data2
  53. ],
  54. [],[],[],[posix])
  55. AT_CLEANUP