Git init
[framework/base/acl.git] / test / nfs / nfs-dir.test
1 This is a regression test for a bug in 2.4 kernels. The test must be run
2 as root on a machine that has a loopback mounted NFS export. The mount
3 must have root squashing enabled. The test must be run in the root of
4 the nfs mount, and requires the following environment variable:
5
6 EXPORT_PATH => the path that is mounted at the working directory.
7
8         Create a test directory and file.
9
10         $ umask 022
11         $ mkdir %{EXPORT_PATH}/test
12         $ echo blah > %{EXPORT_PATH}/test/blah
13
14         Make sure the file can be accessed before.
15
16         $ su bin
17         $ cat test/blah
18         > blah
19
20         Set up a situation that triggers the bug.
21
22         $ su
23         $ chmod go-rwx %{EXPORT_PATH}/test
24         $ setfacl -m u:bin:rx %{EXPORT_PATH}/test
25         $ ls -dl %{EXPORT_PATH}/test | awk '{print $1, $3, $4}'
26         > drwxr-x---+ root root
27         $ getfacl --omit-header %{EXPORT_PATH}/test 2> /dev/null
28         > user::rwx
29         > user:bin:r-x
30         > group::---
31         > mask::r-x
32         > other::---
33         >
34
35         This should also succeed. With the bug, reading the file would
36         fail with "Stale NFS file handle" or "Input/output error".
37
38         $ su bin
39         $ cat test/blah
40         > blah
41         $ sleep 3
42         $ cat test/blah
43         > blah
44         $ cat test/blah
45         > blah
46
47         Clean up.
48
49         $ su
50         $ rm -rf %{EXPORT_PATH}/test