Fix the difflink test
[tar.git] / tests / map.at
blob93a9ed428efbb392326b0575b1c5897b8640b120
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright 2015-2017 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)
9 # any later version.
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 # Check the --owner-map and --group-map options.
21 AT_SETUP([--owner-map and --group-map])
22 AT_KEYWORDS([owner map])
24 AT_TAR_CHECK([
25 export TZ=UTC0
27 genfile --file a
28 set -- `genfile --stat=uid,gid a`
29 cat > uid.map <<EOT
30 # Owner mapping
31 +$1     "Joe the Plumber:1234"
32 EOT
33 # Group mapping
34 cat > gid.map <<EOT
35 +$2     "Plumber's Union:5678"
36 EOT
38 tar --owner-map=uid.map\
39     --group-map=gid.map\
40     --owner="Fallback Owner:4321" \
41     --group="Fallback Group:8765" \
42     --mtime='@0' \
43     --mode='u=rw,go=r' \
44     -cf 1.tar a
46 tar -tvf 1.tar
47 tar --numeric-owner -tvf 1.tar
48     
49 > uid.map
50 > gid.map
52 tar --owner-map=uid.map\
53     --group-map=gid.map\
54     --owner="Fallback Owner:4321" \
55     --group="Fallback Group:8765" \
56     --mtime='@0' \
57     --mode='u=rw,go=r' \
58     -cf 2.tar a
60 tar -tvf 2.tar
61 tar --numeric-owner -tvf 2.tar
63 [0],
64 [-rw-r--r-- Joe the Plumber/Plumber's Union 0 1970-01-01 00:00 a
65 -rw-r--r-- 1234/5678         0 1970-01-01 00:00 a
66 -rw-r--r-- Fallback Owner/Fallback Group 0 1970-01-01 00:00 a
67 -rw-r--r-- 4321/8765         0 1970-01-01 00:00 a
69 [],[],[],[gnu])
71 AT_CLEANUP