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 # written by Paul Eggert
21 # Check that 'tar' works even in a file-descriptor-limited environment.
23 AT_SETUP([scarce file descriptors])
24 AT_KEYWORDS([extract extrac11])
40 mkdir $dirs dest1 dest2 dest3 || exit
43 echo $file >$dir/$file || exit
48 # Check that "ulimit" itself works.
50 tar -cf archive1.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
51 tar -xf archive1.tar -C dest1 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
57 # Another test that "ulimit" itself works:
58 # tar should fail when completely starved of file descriptors.
60 tar -cf archive2.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
61 tar -xf archive2.tar -C dest2 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
67 # Tar should work when there are few, but enough, file descriptors.
69 tar -cf archive3.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
70 tar -xf archive3.tar -C dest3 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
72 diff -r a dest3/a >/dev/null 2>&1
73 ) || { diff -r a dest3/a; exit 1; }
75 [0],[],[],[],[],[gnu])