multiv03.at 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2004-2007, 2013-2014, 2016-2017 Free Software Foundation,
  4. # Inc.
  5. # This file is part of GNU tar.
  6. # GNU tar is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  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. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Problem: GNU multivolume archives are not able to continue on members
  17. # with filenames longer than 100 characters. Versions of tar <= 1.14
  18. # were not checking filename lengths and produced malformed multivolume
  19. # headers.
  20. # References: <[email protected]>
  21. # http://lists.gnu.org/archive/html/bug-tar/2004-08/msg00012.html
  22. # <[email protected]>
  23. #
  24. AT_SETUP([MV archive & long filenames])
  25. AT_KEYWORDS([multivolume multiv multiv03])
  26. AT_TAR_CHECK([
  27. AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'`
  28. BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'`
  29. cat > ../experr <<EOF
  30. tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
  31. tar: '$BFILE' is possibly continued on this volume: header contains truncated name
  32. EOF
  33. cat > ../expout <<EOF
  34. $AFILE
  35. separator-1
  36. separator-2
  37. EOF
  38. genfile --length 15360 --file $AFILE
  39. exec <&-
  40. tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
  41. tar -tM -f arch.1 -f arch.2 || exit 1
  42. echo separator-1
  43. genfile --length 15360 --file $BFILE
  44. tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1
  45. echo separator-2
  46. mv $BFILE bfile
  47. tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
  48. cmp $BFILE bfile
  49. ],
  50. [0],
  51. [expout],
  52. [experr],
  53. [],[],[gnu, oldgnu])
  54. AT_CLEANUP