label04.at 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2010-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: Test the functionality of the --label option used in
  16. # conjunction with an operation, other than create. It was broken
  17. # in versions up to 1.23.
  18. # References: <15929_1268069389_4B95340D_15929_35_1_D621E31C29598A43AF7B4BBD30CCDDFD0838294A@fr0-mailmb04.res.airbus.corp>
  19. #
  20. AT_SETUP([label with non-create option])
  21. AT_KEYWORDS([label label04])
  22. AT_TAR_CHECK([
  23. exec <&-
  24. genfile --file file
  25. decho "# Create volume"
  26. tar -c -f archive --label='New volume' file
  27. decho "# Update: wrong label"
  28. tar -rf archive --label='My volume' file; echo $?
  29. decho "# Update: right label"
  30. tar -rf archive --label='New volume' file
  31. ],
  32. [0],
  33. [# Create volume
  34. # Update: wrong label
  35. 2
  36. # Update: right label
  37. ],
  38. [# Create volume
  39. # Update: wrong label
  40. tar: Volume 'New volume' does not match 'My volume'
  41. tar: Error is not recoverable: exiting now
  42. # Update: right label
  43. ],[],[],[gnu,oldgnu,posix])
  44. AT_CLEANUP