<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-05-17)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-05-17 Bharath Suri <bharath.s.jois@gmail.com>

        * psxfile01/test.c, psxfile01/psxfile01.scn: This file now
        exercises the _rename_r in libcsupport. For now, it also
        provides two fsmount_me_h handlers to enable certain error
        checking paths
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/ChangeLog.diff?r1=text&tr1=1.261&r2=text&tr2=1.262&diff_format=h">M</a></td><td width='1%'>1.262</td><td width='100%'>testsuites/psxtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfile01/psxfile01.scn.diff?r1=text&tr1=1.8&r2=text&tr2=1.9&diff_format=h">M</a></td><td width='1%'>1.9</td><td width='100%'>testsuites/psxtests/psxfile01/psxfile01.scn</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfile01/test.c.diff?r1=text&tr1=1.21&r2=text&tr2=1.22&diff_format=h">M</a></td><td width='1%'>1.22</td><td width='100%'>testsuites/psxtests/psxfile01/test.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.261 rtems/testsuites/psxtests/ChangeLog:1.262
--- rtems/testsuites/psxtests/ChangeLog:1.261   Wed Apr 28 10:01:51 2010
+++ rtems/testsuites/psxtests/ChangeLog Mon May 17 12:56:12 2010
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2010-05-17    Bharath Suri <bharath.s.jois@gmail.com>
+
+       * psxfile01/test.c, psxfile01/psxfile01.scn: This file now
+       exercises the _rename_r in libcsupport. For now, it also
+       provides two fsmount_me_h handlers to enable certain error
+       checking paths
+
</font> 2010-04-28        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * psxfile01/test.c: Add check for errno on chdir(NULL).

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxfile01/psxfile01.scn:1.8 rtems/testsuites/psxtests/psxfile01/psxfile01.scn:1.9
--- rtems/testsuites/psxtests/psxfile01/psxfile01.scn:1.8       Tue Apr 24 18:04:59 2001
+++ rtems/testsuites/psxtests/psxfile01/psxfile01.scn   Mon May 17 12:56:12 2010
</font><font color='#997700'>@@ -1,8 +1,7 @@
</font><font color='#880000'>-NOTE: If you get the following assertion, then your target does not
-have enough memory in the heap used by malloc to allocate all the
-files used during this test:
</font><font color='#000088'>+Could not open '/dev/kqemu' - QEMU acceleration layer not activated: No such file or directory
+Initialized console on port COM1 9600-8-N-1
</font> 
<font color='#880000'>-assertion "memory" failed: file "...../c/src/lib/libc/memfile.c", line 340
</font><font color='#000088'>+<span style="background-color: #FF0000"><CR></span>
</font> 
 *** FILE TEST 1 ***
 *************** Dump of Entire IMFS ***************
<font color='#997700'>@@ -13,13 +12,15 @@
</font> stat of /dev/console
 ....st_dev     (0x0:0x0)
 ....st_ino     3  may vary by small amount
<font color='#880000'>-....mode  = 00020771
</font><font color='#000088'>+....mode  = 00020755
</font> ....nlink = 1
 ....uid = 0
 ....gid = 0
 ....atime = Fri Jan  1 00:00:00 1988
 ....mtime = Fri Jan  1 00:00:00 1988
 ....ctime = Fri Jan  1 00:00:00 1988
<font color='#000088'>+....st_blksize 0
+....st_blocks  0
</font> 
 mkdir /dev/tty
 
<font color='#997700'>@@ -54,11 +55,39 @@
</font> mknod /tmp/joel
 (0)the first write!!!
 
<font color='#000088'>+rename /tmp/joel to /tmp/drjoel
+rename /tmp/drjoel to /tmp/joel
+rename /tmp/drjoel to /tmp/joel - Should result in an error since old path is not valid
+rename /tmp/joel to /tmp/drjoel/joel - Should result in an error since new path is not valid
+changing dir to /tmp
+rename joel to drjoel
+rename drjoel to joel
+creating directory /imfs
+creating directory /imfs/hidden_on_mount
+mounting filesystem with IMFS_ops at /imfs
+creating directory /imfs/test (on newly mounted filesystem)
+attempt to rename directory joel to /imfs/test/joel - should fail with EXDEV
+changing dir to /
+attempt to rename across filesystem, with old path having a parent node
+attempt to rename tmp/joel to /imfs/test/joel
+Unmounting /imfs
+Mounting filesystem @ /imfs with no support for evalformake
+change directory to /imfs
+exercise _rename_r, with target on /imfs - expected ENOTSUP
+attempt to rename /tmp/joel to joel
+change directory to /
+Mounting filesystem @ /imfs with no support for rename
+creating directory /imfs/test
+creating directory /imfs/test/old_dir
+changing to /
+attempt to rename imfs/old_dir to imfs/new_dir
+unmounting /imfs
+End of _rename_r tests
</font> (10)the first write!!!
 
<font color='#880000'>-stat( /tmp/joel ) returned
</font><font color='#000088'>+stat( /tmp/joel ) returned<span style="background-color: #FF0000"> </span>
</font> ....st_dev     (0x0:0x0)
<font color='#880000'>-....st_ino     10  may vary by small amount
</font><font color='#000088'>+....st_ino     12  may vary by small amount
</font> ....mode  = 00100700
 ....nlink = 1
 ....uid = 0
<font color='#997700'>@@ -66,6 +95,8 @@
</font> ....atime = Sat Dec 31 09:00:00 1988
 ....mtime = Sat Dec 31 09:00:00 1988
 ....ctime = Sat Dec 31 09:00:00 1988
<font color='#000088'>+....st_blksize 0
+....st_blocks  0
</font> unlink /tmp/joel
 unlink /tmp/joel
 mknod /tmp/joel
<font color='#997700'>@@ -85,10 +116,11 @@
</font> 
 (513)the first write!!!
 
<font color='#880000'>-(139743)
-stat( /tmp/joel ) returned
</font><font color='#000088'>+Skipping maximum file size test since max_size is 4329344 bytes
+That is likely to be bigger than the available RAM on many targets.
+stat( /tmp/joel ) returned<span style="background-color: #FF0000"> </span>
</font> ....st_dev     (0x0:0x0)
<font color='#880000'>-....st_ino     11  may vary by small amount
</font><font color='#000088'>+....st_ino     13  may vary by small amount
</font> ....mode  = 00100700
 ....nlink = 1
 ....uid = 0
<font color='#997700'>@@ -96,17 +128,21 @@
</font> ....atime = Sat Dec 31 09:00:00 1988
 ....mtime = Sat Dec 31 09:00:00 1988
 ....ctime = Sat Dec 31 09:00:00 1988
<font color='#000088'>+....st_blksize 0
+....st_blocks  0
</font> stat of /tmp/j
 stat(/tmp/j) returned -1 (errno=2)
 ....st_dev     (0x0:0x0)
 ....st_ino     3  may vary by small amount
<font color='#880000'>-....mode  = 00020771
</font><font color='#000088'>+....mode  = 00020755
</font> ....nlink = 1
 ....uid = 0
 ....gid = 0
 ....atime = Fri Jan  1 00:00:00 1988
 ....mtime = Fri Jan  1 00:00:00 1988
 ....ctime = Fri Jan  1 00:00:00 1988
<font color='#000088'>+....st_blksize 0
+....st_blocks  0
</font> fopen of /tmp/j
 fprintf to /tmp/j
 (1) 26 characters written to the file
<font color='#997700'>@@ -115,34 +151,38 @@
</font> (4) 26 characters written to the file
 (5) 26 characters written to the file
 ....st_dev     (0x0:0x0)
<font color='#880000'>-....st_ino     12  may vary by small amount
-....mode  = 00100660
</font><font color='#000088'>+....st_ino     14  may vary by small amount
+....mode  = 00100644
</font> ....nlink = 1
 ....uid = 0
 ....gid = 0
 ....atime = Sat Dec 31 09:00:00 1988
 ....mtime = Sat Dec 31 09:00:00 1988
 ....ctime = Sat Dec 31 09:00:00 1988
<font color='#000088'>+....st_blksize 0
+....st_blocks  0
</font> This is call 1 to fprintf
 This is call 2 to fprintf
 This is call 3 to fprintf
 This is call 4 to fprintf
 This is call 5 to fprintf
 ....st_dev     (0x0:0x0)
<font color='#880000'>-....st_ino     12  may vary by small amount
-....mode  = 00100660
</font><font color='#000088'>+....st_ino     14  may vary by small amount
+....mode  = 00100644
</font> ....nlink = 1
 ....uid = 0
 ....gid = 0
 ....atime = Sat Dec 31 09:00:01 1988
 ....mtime = Sat Dec 31 09:00:00 1988
 ....ctime = Sat Dec 31 09:00:00 1988
<font color='#000088'>+....st_blksize 0
+....st_blocks  0
</font> *************** Dump of Entire IMFS ***************
 /
 ....dev/
 ........console (device 0, 0)
 ........tty/
<font color='#880000'>-............S3 (device 255, 128)
</font><font color='#000088'>+............S3 (device 128, 255)
</font> ........test_console (device 0, 0)
 ....etc/
 ........passwd (file 0)
<font color='#997700'>@@ -150,25 +190,29 @@
</font> ........my_dir/
 ........tom (file 0)
 ........john (file 0)
<font color='#880000'>-........joel (file 279487)
</font><font color='#000088'>+........joel (file 533)
</font> ........j (file 130)
<font color='#000088'>+....imfs/
+........hidden_on_mount/
</font> ***************       End of Dump        ***************
 truncate /tmp/j to length of 40
 ....st_dev     (0x0:0x0)
<font color='#880000'>-....st_ino     12  may vary by small amount
-....mode  = 00100660
</font><font color='#000088'>+....st_ino     14  may vary by small amount
+....mode  = 00100644
</font> ....nlink = 1
 ....uid = 0
 ....gid = 0
 ....atime = Sat Dec 31 09:00:02 1988
 ....mtime = Sat Dec 31 09:00:00 1988
 ....ctime = Sat Dec 31 09:00:00 1988
<font color='#000088'>+....st_blksize 0
+....st_blocks  0
</font> *************** Dump of Entire IMFS ***************
 /
 ....dev/
 ........console (device 0, 0)
 ........tty/
<font color='#880000'>-............S3 (device 255, 128)
</font><font color='#000088'>+............S3 (device 128, 255)
</font> ........test_console (device 0, 0)
 ....etc/
 ........passwd (file 0)
<font color='#997700'>@@ -177,6 +221,8 @@
</font> ........tom (file 0)
 ........john (file 0)
 ........j (file 40)
<font color='#000088'>+....imfs/
+........hidden_on_mount/
</font> ***************       End of Dump        ***************
 truncate /tmp/j to length of 0
 truncate /tmp to length of 0 should fail with EISDIR
<font color='#997700'>@@ -187,7 +233,7 @@
</font> ....dev/
 ........console (device 0, 0)
 ........tty/
<font color='#880000'>-............S3 (device 255, 128)
</font><font color='#000088'>+............S3 (device 128, 255)
</font> ........test_console (device 0, 0)
 ....etc/
 ........passwd (file 0)
<font color='#997700'>@@ -196,6 +242,8 @@
</font> ........tom (file 0)
 ........john (file 0)
 ........j (file 0)
<font color='#000088'>+....imfs/
+........hidden_on_mount/
</font> ***************       End of Dump        ***************
 Writing First File
 Writing Second File
<font color='#997700'>@@ -204,5 +252,5 @@
</font> 
 (0)this is a test line
 this is a test line
<font color='#880000'>-*** END OF FILE TEST 1 ***
</font> 
<font color='#000088'>+*** END OF FILE TEST 1 ***
</font>
<font color='#006600'>diff -u rtems/testsuites/psxtests/psxfile01/test.c:1.21 rtems/testsuites/psxtests/psxfile01/test.c:1.22
--- rtems/testsuites/psxtests/psxfile01/test.c:1.21     Wed Apr 28 10:01:51 2010
+++ rtems/testsuites/psxtests/psxfile01/test.c  Mon May 17 12:56:13 2010
</font><font color='#997700'>@@ -30,6 +30,7 @@
</font> #include <errno.h>
 #include <string.h>
 #include <ctype.h>
<font color='#000088'>+#include <rtems/imfs.h>
</font> 
 #include <rtems.h>
 #include <rtems/libio.h>
<font color='#997700'>@@ -37,7 +38,8 @@
</font> void test_case_reopen_append(void);
 
 char test_write_buffer[ 1024 ];
<font color='#880000'>-
</font><font color='#000088'>+rtems_filesystem_operations_table  IMFS_ops_no_evalformake;
+rtems_filesystem_operations_table  IMFS_ops_no_rename;
</font> /*
  *  File test support routines.
  */
<font color='#997700'>@@ -115,6 +117,30 @@
</font> 
 }
 
<font color='#000088'>+int no_evalformake_IMFS_initialize(
+  rtems_filesystem_mount_table_entry_t *temp_mt_entry
+)
+{
+   return IMFS_initialize_support(
+     temp_mt_entry,
+     &IMFS_ops_no_evalformake,
+     &IMFS_memfile_handlers,
+     &IMFS_directory_handlers
+   );
+}
+
+int no_rename_IMFS_initialize(
+  rtems_filesystem_mount_table_entry_t *temp_mt_entry
+)
+{
+   return IMFS_initialize_support(
+     temp_mt_entry,
+     &IMFS_ops_no_rename,
+     &IMFS_memfile_handlers,
+     &IMFS_directory_handlers
+   );
+}
+
</font> 
 /*
  *  Main entry point of the test
<font color='#997700'>@@ -144,6 +170,17 @@
</font>   time_t            ctime2;
   rtems_status_code rtems_status;
   rtems_time_of_day time;
<font color='#000088'>+  rtems_filesystem_mount_table_entry_t *mt_entry;
+
+  IMFS_ops_no_evalformake = IMFS_ops;
+  IMFS_ops_no_rename = IMFS_ops;
+
+  IMFS_ops_no_evalformake.fsmount_me_h = no_evalformake_IMFS_initialize;
+  IMFS_ops_no_evalformake.evalformake_h = NULL;
+
+  IMFS_ops_no_rename.fsmount_me_h = no_rename_IMFS_initialize;
+  IMFS_ops_no_rename.rename_h = NULL;
+
</font> 
   printf( "\n\n*** FILE TEST 1 ***\n" );
 
<font color='#997700'>@@ -336,6 +373,134 @@
</font>   test_write( "/tmp/joel", 0, "the first write!!!\n" );
   test_cat( "/tmp/joel", 0, 0 );
 
<font color='#000088'>+  /* Exercise _rename_r */
+
+  /* Simple rename test */
+  puts( "rename /tmp/joel to /tmp/drjoel");
+  status = _rename_r(NULL,"/tmp/joel","/tmp/drjoel");
+  rtems_test_assert(status == 0);
+
+  /* Simple rename test */
+  puts("rename /tmp/drjoel to /tmp/joel");
+  status = _rename_r(NULL,"/tmp/drjoel","/tmp/joel");
+  rtems_test_assert(status == 0);
+
+  /* Invalid old path */
+  puts("rename /tmp/drjoel to /tmp/joel - Should result in an error \
+since old path is not valid");
+  status = _rename_r(NULL,"/tmp/drjoel","/tmp/joel");
+  rtems_test_assert(status == -1);
+
+  /* Invalid new path */
+  puts("rename /tmp/joel to /tmp/drjoel/joel - Should result in an error \
+since new path is not valid");
+  status = _rename_r(NULL,"/tmp/joel","/tmp/drjoel/joel");
+  rtems_test_assert(status == -1);
+
+  puts("changing dir to /tmp");
+  status = chdir("/tmp/");
+  rtems_test_assert(status == 0);
+
+  puts("rename joel to drjoel");
+  status = _rename_r(NULL,"joel","drjoel");
+  rtems_test_assert(status == 0);
+
+  puts("rename drjoel to joel");
+  status = _rename_r(NULL,"drjoel","joel");
+  rtems_test_assert(status == 0);
+
+  /* Rename across file systems */
+  puts("creating directory /imfs");
+  status = mkdir("/imfs",0777);
+  rtems_test_assert(status == 0);
+  puts("creating directory /imfs/hidden_on_mount");
+  status = mkdir("/imfs/hidden_on_mount",0777);
+  rtems_test_assert(status == 0);
+
+  puts("mounting filesystem with IMFS_ops at /imfs");
+  status = mount(&mt_entry, &IMFS_ops,<span style="background-color: #FF0000"> </span>
+                RTEMS_FILESYSTEM_READ_WRITE,<span style="background-color: #FF0000"> </span>
+                NULL, "/imfs");
+  rtems_test_assert(status == 0);
+  rtems_test_assert(mt_entry != NULL);
+  puts("creating directory /imfs/test (on newly mounted filesystem)");
+  status = mkdir("/imfs/test", 0777);
+  rtems_test_assert(status == 0);
+
+  puts("attempt to rename directory joel to /imfs/test/joel - should fail with EXDEV");
+  status = _rename_r(NULL, "joel", "/imfs/test/joel");
+  rtems_test_assert(status == -1);
+  rtems_test_assert(errno == EXDEV);
+
+  puts("changing dir to /");
+  status = chdir("/");
+  rtems_test_assert(status == 0);
+
+  puts("attempt to rename across filesystem, with old path having a parent node");
+  puts("attempt to rename tmp/joel to /imfs/test/joel");
+  status = _rename_r(NULL, "tmp/joel", "/imfs/test/joel");
+  rtems_test_assert(status == -1);
+  rtems_test_assert(errno == EXDEV);
+
+  puts("Unmounting /imfs");
+  status = unmount("/imfs");
+  rtems_test_assert(status == 0);
+
+  puts("Mounting filesystem @ /imfs with no support for evalformake");
+<span style="background-color: #FF0000">  </span>
+  status = mount(&mt_entry, &IMFS_ops_no_evalformake,<span style="background-color: #FF0000"> </span>
+                RTEMS_FILESYSTEM_READ_WRITE,<span style="background-color: #FF0000"> </span>
+                NULL, "/imfs");
+  rtems_test_assert(status == 0);
+  rtems_test_assert(mt_entry != NULL);
+
+  puts("change directory to /imfs");
+  status = chdir("/imfs");
+  rtems_test_assert(status == 0);
+
+  puts("exercise _rename_r, with target on /imfs - expected ENOTSUP");
+  puts("attempt to rename /tmp/joel to joel");
+  status = _rename_r(NULL, "/tmp/joel", "joel");
+  rtems_test_assert(status == -1);
+  rtems_test_assert(errno == ENOTSUP);
+
+  puts("change directory to /");
+  status = chdir("/");
+  rtems_test_assert(status == 0);
+<span style="background-color: #FF0000">  </span>
+  status = unmount("/imfs");
+  rtems_test_assert(status == 0);
+
+
+  puts("Mounting filesystem @ /imfs with no support for rename");
+  status = mount(&mt_entry, &IMFS_ops_no_rename,<span style="background-color: #FF0000"> </span>
+                RTEMS_FILESYSTEM_READ_WRITE,<span style="background-color: #FF0000"> </span>
+                NULL, "/imfs");
+  rtems_test_assert(status == 0);
+  rtems_test_assert(mt_entry != NULL);
+
+  puts("creating directory /imfs/test");
+  status = mkdir("/imfs/test", 0777);
+  rtems_test_assert(status == 0);
+
+  puts("creating directory /imfs/test/old_dir");
+  status = mkdir("/imfs/test/old_dir", 0777);
+  rtems_test_assert(status == 0);
+
+  puts("changing to /");
+  status = chdir("/");
+<span style="background-color: #FF0000">  </span>
+  puts("attempt to rename imfs/old_dir to imfs/new_dir");
+  status = _rename_r(NULL, "imfs/test/old_dir", "imfs/test/new_dir");
+  rtems_test_assert(status == -1);
+  rtems_test_assert(errno == ENOTSUP);
+
+  puts("unmounting /imfs");
+  status = unmount("/imfs");
+  rtems_test_assert(status == 0);
+
+  puts("End of _rename_r tests");
+
</font>   /*
    *  Test simple write to a file at a non-0 offset in the first block
    */
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>