]> Dogcows Code - chaz/tar/blob - tests/capabs_raw01.at
Prepare for implementing extended attribute support.
[chaz/tar] / tests / capabs_raw01.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: Test if file capabilities are archived/restored correctly
20 # using just the default xattr support (capabilities are stored/restored in
21 # binary format -> system dependant).
22
23 AT_SETUP([capabilities: binary store/restore])
24 AT_KEYWORDS([xattrs capabilities capabs_raw01])
25
26 AT_TAR_CHECK([
27 AT_PRIVILEGED_PREREQ
28 AT_XATTRS_PREREQ
29 AT_CAPABILITIES_UTILS_PREREQ
30
31 mkdir dir
32 genfile --file dir/file
33
34 setcap "= cap_chown=ei" dir/file
35
36 # archive whole directory including binary xattrs
37 tar --xattrs -cf archive.tar dir
38
39 # clear the directory
40 rm -rf dir
41
42 # restore _all_ xattrs (not just the user.* domain)
43 tar --xattrs --xattrs-include='*' -xf archive.tar
44
45 getcap dir/file
46 ],
47 [0],
48 [dir/file = cap_chown+ei
49 ])
50
51 AT_CLEANUP
This page took 0.03766 seconds and 5 git commands to generate.