1# Process this file with autom4te to create testsuite. -*- Autotest -*- 2 3# Test suite for GNU tar. 4# Copyright 2010-2021 Free Software Foundation, Inc. 5 6# This file is part of GNU tar. 7 8# GNU tar is free software; you can redistribute it and/or modify 9# it under the terms of the GNU General Public License as published by 10# the Free Software Foundation; either version 3 of the License, or 11# (at your option) any later version. 12 13# GNU tar is distributed in the hope that it will be useful, 14# but WITHOUT ANY WARRANTY; without even the implied warranty of 15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16# GNU General Public License for more details. 17 18# You should have received a copy of the GNU General Public License 19# along with this program. If not, see <http://www.gnu.org/licenses/>. 20 21# Description: Test the functionality of the --test-label option. 22# In versions up to 1.23 it did not match the documentation. This 23# test case follows the examples from "9.7 Including a Label in the Archive". 24# References: <15929_1268069389_4B95340D_15929_35_1_D621E31C29598A43AF7B4BBD30CCDDFD0838294A@fr0-mailmb04.res.airbus.corp> 25# 26 27AT_SETUP([test-label option]) 28AT_KEYWORDS([label label03 test-label]) 29 30AT_TAR_CHECK([ 31exec <&- 32genfile --file file 33tar -c --label='iamalabel' --file iamanarchive file 34tar -c --file unlabeled.tar file 35decho "# Display label" 36tar --test-label --file=iamanarchive; echo $? 37decho "# Display label: unlabeled" 38tar --test-label --file=unlabeled.tar; echo $? 39decho "# Test label: success" 40tar --test-label --file=iamanarchive 'iamalabel'; echo $? 41decho "# Test label: failure" 42tar --test-label --file=iamanarchive 'amalabel'; echo $? 43decho "# Test label: unlabeled" 44tar --test-label --file=unlabeled.tar 'amalabel'; echo $? 45decho "# Test label, verbose: success" 46tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? 47decho "# Test label, verbose: failure" 48tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? 49decho "# Test label: multiple arguments" 50tar --test-label --file=iamanarchive a iamalabel b; echo $? 51decho "# Test label: wildcards" 52tar --test-label --file=iamanarchive --wildcards '*label'; echo $? 53], 54[0], 55[# Display label 56iamalabel 570 58# Display label: unlabeled 590 60# Test label: success 610 62# Test label: failure 631 64# Test label: unlabeled 651 66# Test label, verbose: success 67iamalabel 680 69# Test label, verbose: failure 70iamalabel 711 72# Test label: multiple arguments 730 74# Test label: wildcards 750 76], 77[# Display label 78# Display label: unlabeled 79# Test label: success 80# Test label: failure 81# Test label: unlabeled 82# Test label, verbose: success 83# Test label, verbose: failure 84tar: Archive label mismatch 85# Test label: multiple arguments 86# Test label: wildcards 87],[],[],[gnu,oldgnu,posix]) 88 89AT_CLEANUP 90