Ticket #1642: psximfs02-changes

File psximfs02-changes, 3.3 KB (added by Bharath Suri, on 07/30/10 at 13:31:57)

Patch @ testsuites/psxtests/psximfs02

Line 
1Index: init.c
2===================================================================
3RCS file: /usr1/CVS/rtems/testsuites/psxtests/psximfs02/init.c,v
4retrieving revision 1.1
5diff -u -r1.1 init.c
6--- init.c      29 Jul 2010 22:40:50 -0000      1.1
7+++ init.c      30 Jul 2010 13:47:58 -0000
8@@ -20,7 +20,7 @@
9 #include <rtems/libio.h>
10 
11 extern Heap_Control  *RTEMS_Malloc_Heap;
12-
13+void IMFS_dump( void );
14 rtems_task Init(
15   rtems_task_argument argument
16 )
17@@ -129,13 +129,39 @@
18   rtems_test_assert( status == -1 );
19   rtems_test_assert( errno == ENOMEM );
20 
21+  puts( "Freeing allocated memory" );
22+  free( alloc_ptr );
23+
24   puts( "Attempt to stat a hardlink -- expect ENOTSUP" );
25   status = lstat( "/node-link", &stat_buf );
26   rtems_test_assert( status == -1 );
27   rtems_test_assert( errno == ENOTSUP );
28 
29+  puts( "Changing euid to 10" );
30+  status = seteuid( 10 );
31+  rtems_test_assert( status == 0 );
32+
33+  puts( "Attempt chmod on /node -- expect EPERM" );
34+  status = chmod( "/node", S_IRUSR );
35+  rtems_test_assert( status == -1 );
36+  rtems_test_assert( errno == EPERM );
37+
38+  puts( "Attempt chown on /node -- expect EPERM" );
39+  status = chown( "/node", 10, 10 );
40+  rtems_test_assert( status == -1 );
41+  rtems_test_assert( errno == EPERM );
42+
43+  puts( "Changing euid back to 0 [root]" );
44+  status = seteuid( 0 );
45+  rtems_test_assert( status == 0 );
46+
47+  puts( "Creating a fifo -- OK" );
48+  status = mkfifo( "/fifo", S_IRWXU );
49+  rtems_test_assert( status == 0 );
50+
51+  IMFS_dump();
52
53   puts( "*** END OF TEST IMFS 02 ***" );
54-  rtems_test_exit(0);
55 }
56 
57 /* configuration information */
58@@ -149,5 +175,8 @@
59 
60 #define CONFIGURE_INIT
61 
62+#define CONFIGURE_FIFOS_ENABLED
63+#define CONFIGURE_MAXIMUM_FIFOS 1
64+
65 #include <rtems/confdefs.h>
66 /* end of file */
67Index: psximfs02.doc
68===================================================================
69RCS file: /usr1/CVS/rtems/testsuites/psxtests/psximfs02/psximfs02.doc,v
70retrieving revision 1.1
71diff -u -r1.1 psximfs02.doc
72--- psximfs02.doc       29 Jul 2010 22:40:50 -0000      1.1
73+++ psximfs02.doc       30 Jul 2010 13:47:58 -0000
74@@ -22,6 +22,9 @@
75   + symlink
76   + mount
77   + lstat
78+  + IMFS_dump
79+  + chmod
80+  + chown
81 
82 concepts:
83 
84Index: psximfs02.scn
85===================================================================
86RCS file: /usr1/CVS/rtems/testsuites/psxtests/psximfs02/psximfs02.scn,v
87retrieving revision 1.1
88diff -u -r1.1 psximfs02.scn
89--- psximfs02.scn       29 Jul 2010 22:40:50 -0000      1.1
90+++ psximfs02.scn       30 Jul 2010 13:47:58 -0000
91@@ -33,5 +33,29 @@
92 Freeing allocated memory
93 Allocate most of heap
94 Attempt to create /node-slink-2 for /node -- expect ENOMEM
95+Freeing allocated memory
96 Attempt to stat a hardlink -- expect ENOTSUP
97+Changing euid to 10
98+Attempt chmod on /node -- expect EPERM
99+Attempt chown on /node -- expect EPERM
100+Changing euid back to 0 [root]
101+Creating a fifo -- OK
102+*************** Dump of Entire IMFS ***************
103+/
104+....dev/
105+........console (device 0, 0)
106+....dir00/
107+........dir01/
108+........dir01-link0 links not printed
109+........dir01-link1 links not printed
110+........dir01-link2 links not printed
111+........dir01-link3 links not printed
112+........dir01-link4 links not printed
113+........dir01-link5 links not printed
114+........dir01-link6 links not printed
115+....node (file 0)
116+....node-link links not printed
117+....node-slink links not printed
118+....fifo FIFO not printed
119+***************       End of Dump        ***************
120 *** END OF TEST IMFS 02 ***