]> git.cworth.org Git - tar/blob - tests/label03.at
upstream: Fix extraction of device nodes.
[tar] / tests / label03.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 --test-label option.
20 # In versions up to 1.23 it did not match the documentation. This
21 # test case follows the examples from "9.7 Including a Label in the Archive".
22 # References: <15929_1268069389_4B95340D_15929_35_1_D621E31C29598A43AF7B4BBD30CCDDFD0838294A@fr0-mailmb04.res.airbus.corp>
23 #
24
25 AT_SETUP([test-label option])
26 AT_KEYWORDS([label label03 test-label])
27
28 AT_TAR_CHECK([
29 exec <&-
30 genfile --file file
31 tar -c --label='iamalabel' --file iamanarchive file
32 tar -c --file unlabeled.tar file
33 decho "# Display label"
34 tar --test-label --file=iamanarchive; echo $?
35 decho "# Display label: unlabeled"
36 tar --test-label --file=unlabeled.tar; echo $?
37 decho "# Test label: success"
38 tar --test-label --file=iamanarchive 'iamalabel'; echo $?
39 decho "# Test label: failure"
40 tar --test-label --file=iamanarchive 'amalabel'; echo $?
41 decho "# Test label: unlabeled"
42 tar --test-label --file=unlabeled.tar 'amalabel'; echo $?
43 decho "# Test label, verbose: success"
44 tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $?
45 decho "# Test label, verbose: failure"
46 tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $?
47 decho "# Test label: multiple arguments"
48 tar --test-label --file=iamanarchive a iamalabel b; echo $?
49 decho "# Test label: wildcards"
50 tar --test-label --file=iamanarchive --wildcards '*label'; echo $?
51 ],
52 [0],
53 [# Display label
54 iamalabel
55 0
56 # Display label: unlabeled
57 0
58 # Test label: success
59 0
60 # Test label: failure
61 1
62 # Test label: unlabeled
63 1
64 # Test label, verbose: success
65 iamalabel
66 0
67 # Test label, verbose: failure
68 iamalabel
69 1
70 # Test label: multiple arguments
71 0
72 # Test label: wildcards
73 0
74 ],
75 [# Display label
76 # Display label: unlabeled
77 # Test label: success
78 # Test label: failure
79 # Test label: unlabeled
80 # Test label, verbose: success
81 # Test label, verbose: failure
82 tar: Archive label mismatch
83 # Test label: multiple arguments
84 # Test label: wildcards
85 ],[],[],[gnu,oldgnu,posix])
86
87 AT_CLEANUP