label04.at 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2010 Free Software Foundation, Inc.
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3, or (at your option)
  7. # any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. # Description: Test the functionality of the --label option used in
  15. # conjunction with an operation, other than create. It was broken
  16. # in versions up to 1.23.
  17. # References: <15929_1268069389_4B95340D_15929_35_1_D621E31C29598A43AF7B4BBD30CCDDFD0838294A@fr0-mailmb04.res.airbus.corp>
  18. #
  19. AT_SETUP([label with non-create option])
  20. AT_KEYWORDS([label label04])
  21. AT_TAR_CHECK([
  22. exec <&-
  23. genfile --file file
  24. decho "# Create volume"
  25. tar -c -f archive --label='New volume' file
  26. decho "# Update: wrong label"
  27. tar -rf archive --label='My volume' file; echo $?
  28. decho "# Update: right label"
  29. tar -rf archive --label='New volume' file
  30. ],
  31. [0],
  32. [# Create volume
  33. # Update: wrong label
  34. 2
  35. # Update: right label
  36. ],
  37. [# Create volume
  38. # Update: wrong label
  39. tar: Volume 'New volume' does not match 'My volume'
  40. tar: Error is not recoverable: exiting now
  41. # Update: right label
  42. ],[],[],[gnu,oldgnu,posix])
  43. AT_CLEANUP