]> Dogcows Code - chaz/tar/blob - tests/xattr03.at
Prepare for implementing extended attribute support.
[chaz/tar] / tests / xattr03.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 #
3 # Test suite for GNU tar.
4 # Copyright (C) 2012 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 # Test description:
20 #
21 # Setup of the trusted.* domain under privileged user.
22
23 AT_SETUP([xattrs: trusted.* attributes])
24 AT_KEYWORDS([xattrs xattr03])
25
26 AT_TAR_CHECK([
27 AT_PRIVILEGED_PREREQ
28 AT_XATTRS_PREREQ
29
30 mkdir dir
31 mkdir dir/subdir
32 mkdir dir/subdir/subsubdir
33 genfile --file dir/file1
34 genfile --file dir/subdir/file2
35
36 setfattr -n trusted.test -v OurFile1Value dir/file1
37 setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
38 setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir
39
40 tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
41
42 rm -rf dir
43
44 tar --xattrs --xattrs-include=trusted* -xf archive.tar
45
46 getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$
47 getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$
48 getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$
49 ],
50 [0],
51 [trusted.test="OurFile1Value"
52 trusted.test="OurFile2Value"
53 trusted.test="OurDirValue"
54 ])
55
56 AT_CLEANUP
This page took 0.040066 seconds and 5 git commands to generate.