diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-02 18:19:35 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-02 18:19:35 +0000 |
commit | 189b89efb39e047185c4189991a1bbfa792ba05c (patch) | |
tree | 080cb4dbe4d653ab136bf0185656fe628e8918f0 /testsuites/psxtests/psximfs02/init.c | |
parent | 2010-08-02 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-189b89efb39e047185c4189991a1bbfa792ba05c.tar.bz2 |
2010-07-30 Bharath Suri <bharath.s.jois@gmail.com>
PR 1642/testing
* psximfs02/init.c, psximfs02/psximfs02.scn,
psximfs02/psximfs02.doc: Added test cases to exercise chmod(),
chown() and routines in imfs_debug.c.
Diffstat (limited to 'testsuites/psxtests/psximfs02/init.c')
-rw-r--r-- | testsuites/psxtests/psximfs02/init.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/testsuites/psxtests/psximfs02/init.c b/testsuites/psxtests/psximfs02/init.c index 1454cd1a3e..132e546c86 100644 --- a/testsuites/psxtests/psximfs02/init.c +++ b/testsuites/psxtests/psximfs02/init.c @@ -20,7 +20,7 @@ #include <rtems/libio.h> extern Heap_Control *RTEMS_Malloc_Heap; - +void IMFS_dump( void ); rtems_task Init( rtems_task_argument argument ) @@ -129,11 +129,38 @@ rtems_task Init( rtems_test_assert( status == -1 ); rtems_test_assert( errno == ENOMEM ); + puts( "Freeing allocated memory" ); + free( alloc_ptr ); + puts( "Attempt to stat a hardlink -- expect ENOTSUP" ); status = lstat( "/node-link", &stat_buf ); rtems_test_assert( status == -1 ); rtems_test_assert( errno == ENOTSUP ); + puts( "Changing euid to 10" ); + status = seteuid( 10 ); + rtems_test_assert( status == 0 ); + + puts( "Attempt chmod on /node -- expect EPERM" ); + status = chmod( "/node", S_IRUSR ); + rtems_test_assert( status == -1 ); + rtems_test_assert( errno == EPERM ); + + puts( "Attempt chown on /node -- expect EPERM" ); + status = chown( "/node", 10, 10 ); + rtems_test_assert( status == -1 ); + rtems_test_assert( errno == EPERM ); + + puts( "Changing euid back to 0 [root]" ); + status = seteuid( 0 ); + rtems_test_assert( status == 0 ); + + puts( "Creating a fifo -- OK" ); + status = mkfifo( "/fifo", S_IRWXU ); + rtems_test_assert( status == 0 ); + + IMFS_dump(); + puts( "*** END OF TEST IMFS 02 ***" ); rtems_test_exit(0); } @@ -149,5 +176,8 @@ rtems_task Init( #define CONFIGURE_INIT +#define CONFIGURE_FIFOS_ENABLED +#define CONFIGURE_MAXIMUM_FIFOS 1 + #include <rtems/confdefs.h> /* end of file */ |