1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright (C) 2010 Free Software Foundation, Inc.
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)
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.
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/>.
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>
25 AT_SETUP([test-label option])
26 AT_KEYWORDS([label label03 test-label])
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 $?
56 # Display label: unlabeled
62 # Test label: unlabeled
64 # Test label, verbose: success
67 # Test label, verbose: failure
70 # Test label: multiple arguments
72 # Test label: wildcards
76 # Display label: unlabeled
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])