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