diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-03-02 10:18:10 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-03-13 12:23:44 +0100 |
commit | 3ba4f828e45141e9428a2c06d3d7c4bec3d5b404 (patch) | |
tree | f790e1259ffa11da3f993e58d2ceeb152b4133f3 /testsuites/psxtests/psxmount/test.c | |
parent | Filesystem: Reference counting for locations (diff) | |
download | rtems-3ba4f828e45141e9428a2c06d3d7c4bec3d5b404.tar.bz2 |
Filesystem: Read-only file system checks
o Make sure EROFS is indicated for write operations on a read-only file
system.
o Add error indication for read-only file systems in fchmod() and
fchown() according to POSIX.
Diffstat (limited to 'testsuites/psxtests/psxmount/test.c')
-rw-r--r-- | testsuites/psxtests/psxmount/test.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/testsuites/psxtests/psxmount/test.c b/testsuites/psxtests/psxmount/test.c index 1e80376685..6a113c725b 100644 --- a/testsuites/psxtests/psxmount/test.c +++ b/testsuites/psxtests/psxmount/test.c @@ -242,18 +242,41 @@ int main( * Create a directory that passes through the read only file system. */ - printf("create c/y/my_mount_point/../../y/my_mount_point/new_dir\n"); - status = mkdir("c/y/my_mount_point/../../y/my_mount_point/new_dir",S_IRWXU ); + printf("create c/y/my_mount_point/../../y/new_dir\n"); + status = mkdir("c/y/my_mount_point/../../y/new_dir",S_IRWXU ); rtems_test_assert( status == 0 ); - status = stat("c/y/my_mount_point/../../y/my_mount_point/new_dir",&statbuf ); + status = stat("c/y/my_mount_point/../../y/new_dir",&statbuf ); rtems_test_assert( status == 0 ); - status = stat("c/y/my_mount_point/new_dir/..", &statbuf ); + status = stat("c/y/new_dir", &statbuf ); rtems_test_assert( status == 0 ); /* * Attempt to mount a second file system at a used mount point. */ + printf("Verify a mount point returns EROFS for another mount\n"); + status = mount( + "null", + "/c/y/my_mount_point", + "imfs", + RTEMS_FILESYSTEM_READ_ONLY, + NULL ); + rtems_test_assert( status == -1 ); + rtems_test_assert( errno == EROFS); + + printf("Unmount /c/y/my_mount_point\n"); + status = unmount( "/c/y/my_mount_point" ); + rtems_test_assert( status == 0 ); + + printf("Mount a read-write file system at /c/y/my_mount_point\n"); + status = mount( + "null", + "/c/y/my_mount_point", + "imfs", + RTEMS_FILESYSTEM_READ_WRITE, + NULL ); + rtems_test_assert( status == 0 ); + printf("Verify a mount point returns EBUSY for another mount\n"); status = mount( "null", @@ -330,7 +353,7 @@ int main( "null", "/c/y/my_mount_point", "imfs", - RTEMS_FILESYSTEM_READ_ONLY, + RTEMS_FILESYSTEM_READ_WRITE, NULL ); rtems_test_assert( status == 0 ); |