change log for rtems (2011-08-01)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon Aug 1 15:11:58 UTC 2011
*jennifer*:
2011-08-01 Jennifer Averett <Jennifer.Averett at OARcorp.com>
* score/src/schedulersimplesmpschedule.c: Fix bug in smp simple
scheduler.
M 1.2895 cpukit/ChangeLog
M 1.3 cpukit/score/src/schedulersimplesmpschedule.c
diff -u rtems/cpukit/ChangeLog:1.2894 rtems/cpukit/ChangeLog:1.2895
--- rtems/cpukit/ChangeLog:1.2894 Mon Aug 1 02:27:24 2011
+++ rtems/cpukit/ChangeLog Mon Aug 1 09:17:44 2011
@@ -1,3 +1,8 @@
+2011-08-01 Jennifer Averett <Jennifer.Averett at OARcorp.com>
+
+ * score/src/schedulersimplesmpschedule.c: Fix bug in smp simple
+ scheduler.
+
2011-08-01 Sebastian Huber <sebastian.huber at embedded-brains.de>
* libfs/src/nfsclient/src/nfs.c: Fixed creation of directories.
diff -u rtems/cpukit/score/src/schedulersimplesmpschedule.c:1.2 rtems/cpukit/score/src/schedulersimplesmpschedule.c:1.3
--- rtems/cpukit/score/src/schedulersimplesmpschedule.c:1.2 Mon May 23 21:44:58 2011
+++ rtems/cpukit/score/src/schedulersimplesmpschedule.c Mon Aug 1 09:17:44 2011
@@ -93,12 +93,12 @@
}
if ( !_States_Is_ready( e->current_state ) ) {
- pheir = h;
+ pheir = e;
found_cpu = cpu;
found = true;
blocked = true;
D( "SCHED CPU=%d PHeir=0x%08x considering=0x%08x BLOCKED\n",
- cpu, h->Object.id, consider->Object.id );
+ cpu, e->Object.id, consider->Object.id );
continue;
}
@@ -182,6 +182,8 @@
* inversions and let threads run earlier.
*/
if ( !pheir->is_preemptible && h->is_preemptible ) {
+ D( "SCHED CPU=%d PHeir==0x%08x is NOT PREEMPTIBLE\n",
+ cpu, pheir->Object.id );
pheir = h;
found_cpu = cpu;
D( "SCHED CPU=%d PHeir=0x%08x considering=0x%08x PREEMPTIBLE\n",
*joel*:
2011-08-01 Xiang Cui <medivhc at gmail.com>
* Makefile.am, configure.ac, imfs_support/fs_config.h,
imfs_support/fs_support.c, mimfs_support/fs_config.h,
mimfs_support/fs_support.c: Add initial version of new filesystem
tests. There are multiple failures which need to be addressed by the
community.
* fsfchx/fsfchx.doc, fsfchx/init.c, fsfile01/fsfile01.doc,
fsfile01/test.c, fsfile01/test_cat.c, fsfile01/test_extend.c,
fsfile01/test_write.c, fsfile02/fsfile02.doc, fsfile02/init.c,
fsfstest/fs-test.c, fsfstest/fsfstest.doc, fsimfs01/fsimfs01.doc,
fsimfs01/init.c, fsimfs02/fsimfs02.doc, fsimfs02/init.c,
fslink/fslink.doc, fslink/test.c, fsmkdir/fsmkdir.doc,
fsmkdir/test.c, fsopen/fsopen.doc, fsopen/test.c,
fsrdwrv/fsrdwrv.doc, fsrdwrv/test.c, fsreaddir/fsreaddir.doc,
fsreaddir/test.c, fsrename/fsrename.doc, fsrename/test.c,
fsrmdir/test.c, fsrwfile/fsrwfile.doc, fsrwfile/init.c,
fsstat/fsstat.doc, fsstat/test.c, fssymlink/fssymlink.doc,
fssymlink/test.c, fstruncate/fstruncate.doc, fstruncate/test.c,
imfs_fsfchx/.cvsignore, imfs_fsfchx/Makefile.am,
imfs_fsfile01/.cvsignore, imfs_fsfile01/Makefile.am,
imfs_fsfile02/.cvsignore, imfs_fsfile02/Makefile.am,
imfs_fsfstest/.cvsignore, imfs_fsfstest/Makefile.am,
imfs_fsimfs01/.cvsignore, imfs_fsimfs01/Makefile.am,
imfs_fsimfs02/.cvsignore, imfs_fsimfs02/Makefile.am,
imfs_fslink/.cvsignore, imfs_fslink/Makefile.am,
imfs_fsmkdir/.cvsignore, imfs_fsmkdir/Makefile.am,
imfs_fsopen/.cvsignore, imfs_fsopen/Makefile.am,
imfs_fsrdwrv/.cvsignore, imfs_fsrdwrv/Makefile.am,
imfs_fsreaddir/.cvsignore, imfs_fsreaddir/Makefile.am,
imfs_fsrename/.cvsignore, imfs_fsrename/Makefile.am,
imfs_fsrmdir/.cvsignore, imfs_fsrmdir/Makefile.am,
imfs_fsrwfile/.cvsignore, imfs_fsrwfile/Makefile.am,
imfs_fsstat/.cvsignore, imfs_fsstat/Makefile.am,
imfs_fssymlink/.cvsignore, imfs_fssymlink/Makefile.am,
imfs_fstruncate/.cvsignore, imfs_fstruncate/Makefile.am,
mdosfs_fsfchx/.cvsignore, mdosfs_fsfchx/Makefile.am,
mdosfs_fsfile01/.cvsignore, mdosfs_fsfile01/Makefile.am,
mdosfs_fsfile02/.cvsignore, mdosfs_fsfile02/Makefile.am,
mdosfs_fsfstest/.cvsignore, mdosfs_fsfstest/Makefile.am,
mdosfs_fsimfs01/.cvsignore, mdosfs_fsimfs01/Makefile.am,
mdosfs_fsimfs02/.cvsignore, mdosfs_fsimfs02/Makefile.am,
mdosfs_fslink/.cvsignore, mdosfs_fslink/Makefile.am,
mdosfs_fsmkdir/.cvsignore, mdosfs_fsmkdir/Makefile.am,
mdosfs_fsopen/.cvsignore, mdosfs_fsopen/Makefile.am,
mdosfs_fsrdwrv/.cvsignore, mdosfs_fsrdwrv/Makefile.am,
mdosfs_fsreaddir/.cvsignore, mdosfs_fsreaddir/Makefile.am,
mdosfs_fsrename/.cvsignore, mdosfs_fsrename/Makefile.am,
mdosfs_fsrmdir/.cvsignore, mdosfs_fsrmdir/Makefile.am,
mdosfs_fsrwfile/.cvsignore, mdosfs_fsrwfile/Makefile.am,
mdosfs_fsstat/.cvsignore, mdosfs_fsstat/Makefile.am,
mdosfs_fssymlink/.cvsignore, mdosfs_fssymlink/Makefile.am,
mdosfs_fstruncate/.cvsignore, mdosfs_fstruncate/Makefile.am,
mdosfs_support/fs_config.h, mdosfs_support/fs_support.c,
mimfs_fsfchx/.cvsignore, mimfs_fsfchx/Makefile.am,
mimfs_fsfile01/.cvsignore, mimfs_fsfile01/Makefile.am,
mimfs_fsfile02/.cvsignore, mimfs_fsfile02/Makefile.am,
mimfs_fsfstest/.cvsignore, mimfs_fsfstest/Makefile.am,
mimfs_fsimfs01/.cvsignore, mimfs_fsimfs01/Makefile.am,
mimfs_fsimfs02/.cvsignore, mimfs_fsimfs02/Makefile.am,
mimfs_fslink/.cvsignore, mimfs_fslink/Makefile.am,
mimfs_fsmkdir/.cvsignore, mimfs_fsmkdir/Makefile.am,
mimfs_fsopen/.cvsignore, mimfs_fsopen/Makefile.am,
mimfs_fsrdwrv/.cvsignore, mimfs_fsrdwrv/Makefile.am,
mimfs_fsreaddir/.cvsignore, mimfs_fsreaddir/Makefile.am,
mimfs_fsrename/.cvsignore, mimfs_fsrename/Makefile.am,
mimfs_fsrmdir/.cvsignore, mimfs_fsrmdir/Makefile.am,
mimfs_fsrwfile/.cvsignore, mimfs_fsrwfile/Makefile.am,
mimfs_fsstat/.cvsignore, mimfs_fsstat/Makefile.am,
mimfs_fssymlink/.cvsignore, mimfs_fssymlink/Makefile.am,
mimfs_fstruncate/.cvsignore, mimfs_fstruncate/Makefile.am,
mrfs_fsfchx/.cvsignore, mrfs_fsfchx/Makefile.am,
mrfs_fsfile01/.cvsignore, mrfs_fsfile01/Makefile.am,
mrfs_fsfile02/.cvsignore, mrfs_fsfile02/Makefile.am,
mrfs_fsfstest/.cvsignore, mrfs_fsfstest/Makefile.am,
mrfs_fsimfs01/.cvsignore, mrfs_fsimfs01/Makefile.am,
mrfs_fsimfs02/.cvsignore, mrfs_fsimfs02/Makefile.am,
mrfs_fslink/.cvsignore, mrfs_fslink/Makefile.am,
mrfs_fsmkdir/.cvsignore, mrfs_fsmkdir/Makefile.am,
mrfs_fsopen/.cvsignore, mrfs_fsopen/Makefile.am,
mrfs_fsrdwrv/.cvsignore, mrfs_fsrdwrv/Makefile.am,
mrfs_fsreaddir/.cvsignore, mrfs_fsreaddir/Makefile.am,
mrfs_fsrename/.cvsignore, mrfs_fsrename/Makefile.am,
mrfs_fsrmdir/.cvsignore, mrfs_fsrmdir/Makefile.am,
mrfs_fsrwfile/.cvsignore, mrfs_fsrwfile/Makefile.am,
mrfs_fsstat/.cvsignore, mrfs_fsstat/Makefile.am,
mrfs_fssymlink/.cvsignore, mrfs_fssymlink/Makefile.am,
mrfs_fstruncate/.cvsignore, mrfs_fstruncate/Makefile.am,
mrfs_support/fs_config.h, mrfs_support/fs_support.c,
support/fstest.h, support/fstest_support.c, support/fstest_support.h,
support/ramdisk_support.c, support/ramdisk_support.h: New files.
M 1.3 testsuites/fstests/ChangeLog
M 1.3 testsuites/fstests/Makefile.am
M 1.2 testsuites/fstests/configure.ac
A 1.1 testsuites/fstests/fsfchx/fsfchx.doc
A 1.1 testsuites/fstests/fsfchx/init.c
A 1.1 testsuites/fstests/fsfile01/fsfile01.doc
A 1.1 testsuites/fstests/fsfile01/test.c
A 1.1 testsuites/fstests/fsfile01/test_cat.c
A 1.1 testsuites/fstests/fsfile01/test_extend.c
A 1.1 testsuites/fstests/fsfile01/test_write.c
A 1.1 testsuites/fstests/fsfile02/fsfile02.doc
A 1.1 testsuites/fstests/fsfile02/init.c
A 1.1 testsuites/fstests/fsfstest/fs-test.c
A 1.1 testsuites/fstests/fsfstest/fsfstest.doc
A 1.1 testsuites/fstests/fsimfs01/fsimfs01.doc
A 1.1 testsuites/fstests/fsimfs01/init.c
A 1.1 testsuites/fstests/fsimfs02/fsimfs02.doc
A 1.1 testsuites/fstests/fsimfs02/init.c
A 1.1 testsuites/fstests/fslink/fslink.doc
A 1.1 testsuites/fstests/fslink/test.c
A 1.1 testsuites/fstests/fsmkdir/fsmkdir.doc
A 1.1 testsuites/fstests/fsmkdir/test.c
A 1.1 testsuites/fstests/fsopen/fsopen.doc
A 1.1 testsuites/fstests/fsopen/test.c
A 1.1 testsuites/fstests/fsrdwrv/fsrdwrv.doc
A 1.1 testsuites/fstests/fsrdwrv/test.c
A 1.1 testsuites/fstests/fsreaddir/fsreaddir.doc
A 1.1 testsuites/fstests/fsreaddir/test.c
A 1.1 testsuites/fstests/fsrename/fsrename.doc
A 1.1 testsuites/fstests/fsrename/test.c
A 1.1 testsuites/fstests/fsrmdir/test.c
A 1.1 testsuites/fstests/fsrwfile/fsrwfile.doc
A 1.1 testsuites/fstests/fsrwfile/init.c
A 1.1 testsuites/fstests/fsstat/fsstat.doc
A 1.1 testsuites/fstests/fsstat/test.c
A 1.1 testsuites/fstests/fssymlink/fssymlink.doc
A 1.1 testsuites/fstests/fssymlink/test.c
A 1.1 testsuites/fstests/fstruncate/fstruncate.doc
A 1.1 testsuites/fstests/fstruncate/test.c
A 1.1 testsuites/fstests/imfs_fsfchx/.cvsignore
A 1.1 testsuites/fstests/imfs_fsfchx/Makefile.am
A 1.1 testsuites/fstests/imfs_fsfile01/.cvsignore
A 1.1 testsuites/fstests/imfs_fsfile01/Makefile.am
A 1.1 testsuites/fstests/imfs_fsfile02/.cvsignore
A 1.1 testsuites/fstests/imfs_fsfile02/Makefile.am
A 1.1 testsuites/fstests/imfs_fsfstest/.cvsignore
A 1.1 testsuites/fstests/imfs_fsfstest/Makefile.am
A 1.1 testsuites/fstests/imfs_fsimfs01/.cvsignore
A 1.1 testsuites/fstests/imfs_fsimfs01/Makefile.am
A 1.1 testsuites/fstests/imfs_fsimfs02/.cvsignore
A 1.1 testsuites/fstests/imfs_fsimfs02/Makefile.am
A 1.1 testsuites/fstests/imfs_fslink/.cvsignore
A 1.1 testsuites/fstests/imfs_fslink/Makefile.am
A 1.1 testsuites/fstests/imfs_fsmkdir/.cvsignore
A 1.1 testsuites/fstests/imfs_fsmkdir/Makefile.am
A 1.1 testsuites/fstests/imfs_fsopen/.cvsignore
A 1.1 testsuites/fstests/imfs_fsopen/Makefile.am
A 1.1 testsuites/fstests/imfs_fsrdwrv/.cvsignore
A 1.1 testsuites/fstests/imfs_fsrdwrv/Makefile.am
A 1.1 testsuites/fstests/imfs_fsreaddir/.cvsignore
A 1.1 testsuites/fstests/imfs_fsreaddir/Makefile.am
A 1.1 testsuites/fstests/imfs_fsrename/.cvsignore
A 1.1 testsuites/fstests/imfs_fsrename/Makefile.am
A 1.1 testsuites/fstests/imfs_fsrmdir/.cvsignore
A 1.1 testsuites/fstests/imfs_fsrmdir/Makefile.am
A 1.1 testsuites/fstests/imfs_fsrwfile/.cvsignore
A 1.1 testsuites/fstests/imfs_fsrwfile/Makefile.am
A 1.1 testsuites/fstests/imfs_fsstat/.cvsignore
A 1.1 testsuites/fstests/imfs_fsstat/Makefile.am
A 1.1 testsuites/fstests/imfs_fssymlink/.cvsignore
A 1.1 testsuites/fstests/imfs_fssymlink/Makefile.am
A 1.1 testsuites/fstests/imfs_fstruncate/.cvsignore
A 1.1 testsuites/fstests/imfs_fstruncate/Makefile.am
M 1.2 testsuites/fstests/imfs_support/fs_config.h
M 1.2 testsuites/fstests/imfs_support/fs_support.c
A 1.1 testsuites/fstests/mdosfs_fsfchx/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsfchx/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsfile01/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsfile01/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsfile02/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsfile02/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsfstest/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsfstest/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsimfs01/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsimfs01/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsimfs02/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsimfs02/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fslink/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fslink/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsmkdir/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsmkdir/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsopen/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsopen/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsrdwrv/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsrdwrv/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsreaddir/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsreaddir/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsrename/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsrename/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsrmdir/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsrmdir/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsrwfile/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsrwfile/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fsstat/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fsstat/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fssymlink/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fssymlink/Makefile.am
A 1.1 testsuites/fstests/mdosfs_fstruncate/.cvsignore
A 1.1 testsuites/fstests/mdosfs_fstruncate/Makefile.am
A 1.1 testsuites/fstests/mdosfs_support/fs_config.h
A 1.1 testsuites/fstests/mdosfs_support/fs_support.c
A 1.1 testsuites/fstests/mimfs_fsfchx/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsfchx/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsfile01/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsfile01/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsfile02/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsfile02/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsfstest/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsfstest/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsimfs01/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsimfs01/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsimfs02/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsimfs02/Makefile.am
A 1.1 testsuites/fstests/mimfs_fslink/.cvsignore
A 1.1 testsuites/fstests/mimfs_fslink/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsmkdir/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsmkdir/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsopen/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsopen/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsrdwrv/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsrdwrv/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsreaddir/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsreaddir/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsrename/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsrename/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsrmdir/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsrmdir/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsrwfile/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsrwfile/Makefile.am
A 1.1 testsuites/fstests/mimfs_fsstat/.cvsignore
A 1.1 testsuites/fstests/mimfs_fsstat/Makefile.am
A 1.1 testsuites/fstests/mimfs_fssymlink/.cvsignore
A 1.1 testsuites/fstests/mimfs_fssymlink/Makefile.am
A 1.1 testsuites/fstests/mimfs_fstruncate/.cvsignore
A 1.1 testsuites/fstests/mimfs_fstruncate/Makefile.am
M 1.2 testsuites/fstests/mimfs_support/fs_config.h
M 1.2 testsuites/fstests/mimfs_support/fs_support.c
A 1.1 testsuites/fstests/mrfs_fsfchx/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsfchx/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsfile01/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsfile01/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsfile02/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsfile02/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsfstest/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsfstest/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsimfs01/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsimfs01/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsimfs02/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsimfs02/Makefile.am
A 1.1 testsuites/fstests/mrfs_fslink/.cvsignore
A 1.1 testsuites/fstests/mrfs_fslink/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsmkdir/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsmkdir/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsopen/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsopen/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsrdwrv/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsrdwrv/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsreaddir/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsreaddir/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsrename/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsrename/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsrmdir/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsrmdir/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsrwfile/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsrwfile/Makefile.am
A 1.1 testsuites/fstests/mrfs_fsstat/.cvsignore
A 1.1 testsuites/fstests/mrfs_fsstat/Makefile.am
A 1.1 testsuites/fstests/mrfs_fssymlink/.cvsignore
A 1.1 testsuites/fstests/mrfs_fssymlink/Makefile.am
A 1.1 testsuites/fstests/mrfs_fstruncate/.cvsignore
A 1.1 testsuites/fstests/mrfs_fstruncate/Makefile.am
A 1.1 testsuites/fstests/mrfs_support/fs_config.h
A 1.1 testsuites/fstests/mrfs_support/fs_support.c
A 1.1 testsuites/fstests/support/fstest.h
A 1.1 testsuites/fstests/support/fstest_support.h
A 1.1 testsuites/fstests/support/fstest_support.c
A 1.1 testsuites/fstests/support/ramdisk_support.h
A 1.1 testsuites/fstests/support/ramdisk_support.c
diff -u rtems/testsuites/fstests/ChangeLog:1.2 rtems/testsuites/fstests/ChangeLog:1.3
--- rtems/testsuites/fstests/ChangeLog:1.2 Mon Jun 20 00:02:43 2011
+++ rtems/testsuites/fstests/ChangeLog Mon Aug 1 09:29:49 2011
@@ -1,3 +1,95 @@
+2011-08-01 Xiang Cui <medivhc at gmail.com>
+
+ * Makefile.am, configure.ac, imfs_support/fs_config.h,
+ imfs_support/fs_support.c, mimfs_support/fs_config.h,
+ mimfs_support/fs_support.c: Add initial version of new filesystem
+ tests. There are multiple failures which need to be addressed by the
+ community.
+ * fsfchx/fsfchx.doc, fsfchx/init.c, fsfile01/fsfile01.doc,
+ fsfile01/test.c, fsfile01/test_cat.c, fsfile01/test_extend.c,
+ fsfile01/test_write.c, fsfile02/fsfile02.doc, fsfile02/init.c,
+ fsfstest/fs-test.c, fsfstest/fsfstest.doc, fsimfs01/fsimfs01.doc,
+ fsimfs01/init.c, fsimfs02/fsimfs02.doc, fsimfs02/init.c,
+ fslink/fslink.doc, fslink/test.c, fsmkdir/fsmkdir.doc,
+ fsmkdir/test.c, fsopen/fsopen.doc, fsopen/test.c,
+ fsrdwrv/fsrdwrv.doc, fsrdwrv/test.c, fsreaddir/fsreaddir.doc,
+ fsreaddir/test.c, fsrename/fsrename.doc, fsrename/test.c,
+ fsrmdir/test.c, fsrwfile/fsrwfile.doc, fsrwfile/init.c,
+ fsstat/fsstat.doc, fsstat/test.c, fssymlink/fssymlink.doc,
+ fssymlink/test.c, fstruncate/fstruncate.doc, fstruncate/test.c,
+ imfs_fsfchx/.cvsignore, imfs_fsfchx/Makefile.am,
+ imfs_fsfile01/.cvsignore, imfs_fsfile01/Makefile.am,
+ imfs_fsfile02/.cvsignore, imfs_fsfile02/Makefile.am,
+ imfs_fsfstest/.cvsignore, imfs_fsfstest/Makefile.am,
+ imfs_fsimfs01/.cvsignore, imfs_fsimfs01/Makefile.am,
+ imfs_fsimfs02/.cvsignore, imfs_fsimfs02/Makefile.am,
+ imfs_fslink/.cvsignore, imfs_fslink/Makefile.am,
+ imfs_fsmkdir/.cvsignore, imfs_fsmkdir/Makefile.am,
+ imfs_fsopen/.cvsignore, imfs_fsopen/Makefile.am,
+ imfs_fsrdwrv/.cvsignore, imfs_fsrdwrv/Makefile.am,
+ imfs_fsreaddir/.cvsignore, imfs_fsreaddir/Makefile.am,
+ imfs_fsrename/.cvsignore, imfs_fsrename/Makefile.am,
+ imfs_fsrmdir/.cvsignore, imfs_fsrmdir/Makefile.am,
+ imfs_fsrwfile/.cvsignore, imfs_fsrwfile/Makefile.am,
+ imfs_fsstat/.cvsignore, imfs_fsstat/Makefile.am,
+ imfs_fssymlink/.cvsignore, imfs_fssymlink/Makefile.am,
+ imfs_fstruncate/.cvsignore, imfs_fstruncate/Makefile.am,
+ mdosfs_fsfchx/.cvsignore, mdosfs_fsfchx/Makefile.am,
+ mdosfs_fsfile01/.cvsignore, mdosfs_fsfile01/Makefile.am,
+ mdosfs_fsfile02/.cvsignore, mdosfs_fsfile02/Makefile.am,
+ mdosfs_fsfstest/.cvsignore, mdosfs_fsfstest/Makefile.am,
+ mdosfs_fsimfs01/.cvsignore, mdosfs_fsimfs01/Makefile.am,
+ mdosfs_fsimfs02/.cvsignore, mdosfs_fsimfs02/Makefile.am,
+ mdosfs_fslink/.cvsignore, mdosfs_fslink/Makefile.am,
+ mdosfs_fsmkdir/.cvsignore, mdosfs_fsmkdir/Makefile.am,
+ mdosfs_fsopen/.cvsignore, mdosfs_fsopen/Makefile.am,
+ mdosfs_fsrdwrv/.cvsignore, mdosfs_fsrdwrv/Makefile.am,
+ mdosfs_fsreaddir/.cvsignore, mdosfs_fsreaddir/Makefile.am,
+ mdosfs_fsrename/.cvsignore, mdosfs_fsrename/Makefile.am,
+ mdosfs_fsrmdir/.cvsignore, mdosfs_fsrmdir/Makefile.am,
+ mdosfs_fsrwfile/.cvsignore, mdosfs_fsrwfile/Makefile.am,
+ mdosfs_fsstat/.cvsignore, mdosfs_fsstat/Makefile.am,
+ mdosfs_fssymlink/.cvsignore, mdosfs_fssymlink/Makefile.am,
+ mdosfs_fstruncate/.cvsignore, mdosfs_fstruncate/Makefile.am,
+ mdosfs_support/fs_config.h, mdosfs_support/fs_support.c,
+ mimfs_fsfchx/.cvsignore, mimfs_fsfchx/Makefile.am,
+ mimfs_fsfile01/.cvsignore, mimfs_fsfile01/Makefile.am,
+ mimfs_fsfile02/.cvsignore, mimfs_fsfile02/Makefile.am,
+ mimfs_fsfstest/.cvsignore, mimfs_fsfstest/Makefile.am,
+ mimfs_fsimfs01/.cvsignore, mimfs_fsimfs01/Makefile.am,
+ mimfs_fsimfs02/.cvsignore, mimfs_fsimfs02/Makefile.am,
+ mimfs_fslink/.cvsignore, mimfs_fslink/Makefile.am,
+ mimfs_fsmkdir/.cvsignore, mimfs_fsmkdir/Makefile.am,
+ mimfs_fsopen/.cvsignore, mimfs_fsopen/Makefile.am,
+ mimfs_fsrdwrv/.cvsignore, mimfs_fsrdwrv/Makefile.am,
+ mimfs_fsreaddir/.cvsignore, mimfs_fsreaddir/Makefile.am,
+ mimfs_fsrename/.cvsignore, mimfs_fsrename/Makefile.am,
+ mimfs_fsrmdir/.cvsignore, mimfs_fsrmdir/Makefile.am,
+ mimfs_fsrwfile/.cvsignore, mimfs_fsrwfile/Makefile.am,
+ mimfs_fsstat/.cvsignore, mimfs_fsstat/Makefile.am,
+ mimfs_fssymlink/.cvsignore, mimfs_fssymlink/Makefile.am,
+ mimfs_fstruncate/.cvsignore, mimfs_fstruncate/Makefile.am,
+ mrfs_fsfchx/.cvsignore, mrfs_fsfchx/Makefile.am,
+ mrfs_fsfile01/.cvsignore, mrfs_fsfile01/Makefile.am,
+ mrfs_fsfile02/.cvsignore, mrfs_fsfile02/Makefile.am,
+ mrfs_fsfstest/.cvsignore, mrfs_fsfstest/Makefile.am,
+ mrfs_fsimfs01/.cvsignore, mrfs_fsimfs01/Makefile.am,
+ mrfs_fsimfs02/.cvsignore, mrfs_fsimfs02/Makefile.am,
+ mrfs_fslink/.cvsignore, mrfs_fslink/Makefile.am,
+ mrfs_fsmkdir/.cvsignore, mrfs_fsmkdir/Makefile.am,
+ mrfs_fsopen/.cvsignore, mrfs_fsopen/Makefile.am,
+ mrfs_fsrdwrv/.cvsignore, mrfs_fsrdwrv/Makefile.am,
+ mrfs_fsreaddir/.cvsignore, mrfs_fsreaddir/Makefile.am,
+ mrfs_fsrename/.cvsignore, mrfs_fsrename/Makefile.am,
+ mrfs_fsrmdir/.cvsignore, mrfs_fsrmdir/Makefile.am,
+ mrfs_fsrwfile/.cvsignore, mrfs_fsrwfile/Makefile.am,
+ mrfs_fsstat/.cvsignore, mrfs_fsstat/Makefile.am,
+ mrfs_fssymlink/.cvsignore, mrfs_fssymlink/Makefile.am,
+ mrfs_fstruncate/.cvsignore, mrfs_fstruncate/Makefile.am,
+ mrfs_support/fs_config.h, mrfs_support/fs_support.c,
+ support/fstest.h, support/fstest_support.c, support/fstest_support.h,
+ support/ramdisk_support.c, support/ramdisk_support.h: New files.
+
2011-06-20 Ralf Corsépius <ralf.corsepius at rtems.org>
* Makefile.am: Remove EXTRA_DIST.
diff -u rtems/testsuites/fstests/Makefile.am:1.2 rtems/testsuites/fstests/Makefile.am:1.3
--- rtems/testsuites/fstests/Makefile.am:1.2 Mon Jun 20 00:02:43 2011
+++ rtems/testsuites/fstests/Makefile.am Mon Aug 1 09:29:49 2011
@@ -4,9 +4,80 @@
ACLOCAL_AMFLAGS = -I ../aclocal
-SUBDIRS =
-SUBDIRS += imfs_fs01
-SUBDIRS += mimfs_fs01
+DIST_SUBDIRS = $(SUBDIRS) support
+EXTRA_DIST = support/ramdisk_support.c
+EXTRA_DIST += support/ramdisk_support.h
+EXTRA_DIST += support/fstest_support.c
+EXTRA_DIST += support/fstest_support.h
+
+SUBDIRS = imfs_fsfchx
+SUBDIRS += imfs_fsfile01
+SUBDIRS += imfs_fsfile02
+SUBDIRS += imfs_fsfstest
+SUBDIRS += imfs_fsimfs01
+SUBDIRS += imfs_fsimfs02
+SUBDIRS += imfs_fslink
+SUBDIRS += imfs_fsmkdir
+SUBDIRS += imfs_fsopen
+SUBDIRS += imfs_fsrdwrv
+SUBDIRS += imfs_fsreaddir
+SUBDIRS += imfs_fsrename
+SUBDIRS += imfs_fsrmdir
+SUBDIRS += imfs_fsrwfile
+SUBDIRS += imfs_fsstat
+SUBDIRS += imfs_fssymlink
+SUBDIRS += imfs_fstruncate
+SUBDIRS += mdosfs_fsfchx
+SUBDIRS += mdosfs_fsfile01
+SUBDIRS += mdosfs_fsfile02
+SUBDIRS += mdosfs_fsfstest
+SUBDIRS += mdosfs_fsimfs01
+SUBDIRS += mdosfs_fsimfs02
+SUBDIRS += mdosfs_fslink
+SUBDIRS += mdosfs_fsmkdir
+SUBDIRS += mdosfs_fsopen
+SUBDIRS += mdosfs_fsrdwrv
+SUBDIRS += mdosfs_fsreaddir
+SUBDIRS += mdosfs_fsrename
+SUBDIRS += mdosfs_fsrmdir
+SUBDIRS += mdosfs_fsrwfile
+SUBDIRS += mdosfs_fsstat
+SUBDIRS += mdosfs_fssymlink
+SUBDIRS += mdosfs_fstruncate
+SUBDIRS += mimfs_fsfchx
+SUBDIRS += mimfs_fsfile01
+SUBDIRS += mimfs_fsfile02
+SUBDIRS += mimfs_fsfstest
+SUBDIRS += mimfs_fsimfs01
+SUBDIRS += mimfs_fsimfs02
+SUBDIRS += mimfs_fslink
+SUBDIRS += mimfs_fsmkdir
+SUBDIRS += mimfs_fsopen
+SUBDIRS += mimfs_fsrdwrv
+SUBDIRS += mimfs_fsreaddir
+SUBDIRS += mimfs_fsrename
+SUBDIRS += mimfs_fsrmdir
+SUBDIRS += mimfs_fsrwfile
+SUBDIRS += mimfs_fsstat
+SUBDIRS += mimfs_fssymlink
+SUBDIRS += mimfs_fstruncate
+SUBDIRS += mrfs_fsfchx
+SUBDIRS += mrfs_fsfile01
+SUBDIRS += mrfs_fsfile02
+SUBDIRS += mrfs_fsfstest
+SUBDIRS += mrfs_fsimfs01
+SUBDIRS += mrfs_fsimfs02
+SUBDIRS += mrfs_fslink
+SUBDIRS += mrfs_fsmkdir
+SUBDIRS += mrfs_fsopen
+SUBDIRS += mrfs_fsrdwrv
+SUBDIRS += mrfs_fsreaddir
+SUBDIRS += mrfs_fsrename
+SUBDIRS += mrfs_fsrmdir
+SUBDIRS += mrfs_fsrwfile
+SUBDIRS += mrfs_fsstat
+SUBDIRS += mrfs_fssymlink
+SUBDIRS += mrfs_fstruncate
include $(top_srcdir)/../automake/subdirs.am
include $(top_srcdir)/../automake/local.am
diff -u rtems/testsuites/fstests/configure.ac:1.1 rtems/testsuites/fstests/configure.ac:1.2
--- rtems/testsuites/fstests/configure.ac:1.1 Wed Apr 20 16:30:14 2011
+++ rtems/testsuites/fstests/configure.ac Mon Aug 1 09:29:49 2011
@@ -77,8 +77,75 @@
AC_CHECK_SIZEOF([blkcnt_t])
# Explicitly list all Makefiles here
-AC_CONFIG_FILES([Makefile
-imfs_fs01/Makefile
-mimfs_fs01/Makefile
+AC_CONFIG_FILES([Makefile
+imfs_fsfchx/Makefile
+imfs_fsfile01/Makefile
+imfs_fsfile02/Makefile
+imfs_fsfstest/Makefile
+imfs_fsimfs01/Makefile
+imfs_fsimfs02/Makefile
+imfs_fslink/Makefile
+imfs_fsmkdir/Makefile
+imfs_fsopen/Makefile
+imfs_fsrdwrv/Makefile
+imfs_fsreaddir/Makefile
+imfs_fsrename/Makefile
+imfs_fsrmdir/Makefile
+imfs_fsrwfile/Makefile
+imfs_fsstat/Makefile
+imfs_fssymlink/Makefile
+imfs_fstruncate/Makefile
+mdosfs_fsfchx/Makefile
+mdosfs_fsfile01/Makefile
+mdosfs_fsfile02/Makefile
+mdosfs_fsfstest/Makefile
+mdosfs_fsimfs01/Makefile
+mdosfs_fsimfs02/Makefile
+mdosfs_fslink/Makefile
+mdosfs_fsmkdir/Makefile
+mdosfs_fsopen/Makefile
+mdosfs_fsrdwrv/Makefile
+mdosfs_fsreaddir/Makefile
+mdosfs_fsrename/Makefile
+mdosfs_fsrmdir/Makefile
+mdosfs_fsrwfile/Makefile
+mdosfs_fsstat/Makefile
+mdosfs_fssymlink/Makefile
+mdosfs_fstruncate/Makefile
+mimfs_fsfchx/Makefile
+mimfs_fsfile01/Makefile
+mimfs_fsfile02/Makefile
+mimfs_fsfstest/Makefile
+mimfs_fsimfs01/Makefile
+mimfs_fsimfs02/Makefile
+mimfs_fslink/Makefile
+mimfs_fsmkdir/Makefile
+mimfs_fsopen/Makefile
+mimfs_fsrdwrv/Makefile
+mimfs_fsreaddir/Makefile
+mimfs_fsrename/Makefile
+mimfs_fsrmdir/Makefile
+mimfs_fsrwfile/Makefile
+mimfs_fsstat/Makefile
+mimfs_fssymlink/Makefile
+mimfs_fstruncate/Makefile
+mrfs_fsfchx/Makefile
+mrfs_fsfile01/Makefile
+mrfs_fsfile02/Makefile
+mrfs_fsfstest/Makefile
+mrfs_fsimfs01/Makefile
+mrfs_fsimfs02/Makefile
+mrfs_fslink/Makefile
+mrfs_fsmkdir/Makefile
+mrfs_fsopen/Makefile
+mrfs_fsrdwrv/Makefile
+mrfs_fsreaddir/Makefile
+mrfs_fsrename/Makefile
+mrfs_fsrmdir/Makefile
+mrfs_fsrwfile/Makefile
+mrfs_fsstat/Makefile
+mrfs_fssymlink/Makefile
+mrfs_fstruncate/Makefile
+
])
AC_OUTPUT
diff -u /dev/null rtems/testsuites/fstests/fsfchx/fsfchx.doc:1.1
--- /dev/null Mon Aug 1 10:11:41 2011
+++ rtems/testsuites/fstests/fsfchx/fsfchx.doc Mon Aug 1 09:29:49 2011
@@ -0,0 +1,25 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fschx
+
+directives:
+
++ fchdir
++ fchmod
++ fchown
+
+concepts:
+
++ Exercise the fildes based operations - fchdir, fchmod, fchown
+
diff -u /dev/null rtems/testsuites/fstests/fsfchx/init.c:1.1
--- /dev/null Mon Aug 1 10:11:41 2011
+++ rtems/testsuites/fstests/fsfchx/init.c Mon Aug 1 09:29:49 2011
@@ -0,0 +1,243 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <limits.h>
+
+#include "fstest.h"
+
+void test(void)
+{
+ int status = 0;
+ int fd = 0;
+
+ puts( "\n\n*** TEST Posix file op tests - 01 ***" );
+
+ /****************************************************
+ * fchdir tests
+ ***************************************************/
+
+ puts( "Init - fchdir tests" );
+
+ puts( "Init - Attempt fchdir with bad file descriptor - expect EBADF" );
+ status = fchdir( 5 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBADF );
+
+ puts( "Init - Attempt fchdir with bad file descriptor - expect EBADF" );
+ status = fchdir( 3 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBADF );
+
+ puts( "Init - opening /newfile in write-mode -- OK" );
+ fd = open( "/newfile", O_WRONLY | O_CREAT, S_IWUSR );
+ rtems_test_assert( fd != -1 );
+
+ puts( "Init - fchdir on the file descriptor - expect EINVAL" );
+ status = fchdir( fd );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EINVAL|| errno==ENOTDIR );
+
+ puts(" Init - closing /newfile -- OK" );
+ status = close( fd );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - removing /newfile -- OK" );
+ status = unlink( "/newfile" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - opening /newfile in read-mode -- OK" );
+ fd = open( "/newfile", O_RDONLY | O_CREAT, S_IRUSR);
+ rtems_test_assert( fd != -1 );
+
+ puts( "Init - fchdir on the file descriptor - expect ENOTDIR" );
+ status = fchdir( fd );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTDIR );
+
+ puts( "Init - closing and removing /newfile -- OK" );
+ status = close( fd );
+ status |= unlink( "/newfile" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - create directory /tmp - RWX permissions -- OK" );
+ status = mkdir( "/tmp", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - open the /tmp, get the file descriptor -- OK" );
+ fd = open( "/tmp", O_RDONLY );
+ rtems_test_assert( fd != -1 );
+
+ puts( "Init - fchdir on the file descriptor -- OK" );
+ status = fchdir( fd );
+ rtems_test_assert( status == 0 );
+
+ /*
+ * It seems a bug that in dosfs rmdir returns EBUSY
+ * if one doesn't change dir first.
+ */
+#if defined(MDOSFS_TEST)
+ chdir("/");
+#endif
+ puts( "Init - close the file descriptor -- OK" );
+ status = close( fd );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - remove directory /tmp -- OK" );
+ status = rmdir( "/tmp" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - creating directory /tmp - read permission -- OK" );
+ status = mkdir( "/tmp", S_IRUSR );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - open the /tmp, get the file descriptor -- OK" );
+ fd = open( "/tmp", O_RDONLY );
+ rtems_test_assert( fd != -1 );
+
+#if defined(MDOSFS_TEST)
+#else
+ seteuid(6);
+ printf ("the uid is%d and the gid is %d \n",getuid(),getgid());
+
+ puts( "Init - attempt fchdir on the file descriptor -- expect EACCES" );
+ status = fchdir( fd );
+ rtems_test_assert( status == -1);
+ rtems_test_assert( errno == EACCES );
+
+ status=seteuid(0);
+#endif
+ puts( "Init - close the file descriptor -- OK" );
+ status = close( fd );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - remove directory /tmp -- OK" );
+ status = rmdir( "/tmp" );
+ rtems_test_assert( status == 0 );
+
+ puts( "End of fchdir tests" );
+
+
+ /****************************************************
+ * fchmod tests
+ ***************************************************/
+
+ puts( "\nInit - fchmod tests" );
+
+ puts( "Init - fchmod, with a bad file descriptor - expect EBADF" );
+ status = fchmod( 4, 0 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBADF );
+
+ puts( "Init - fchmod, with an unopened file descriptor - expect EBADF" );
+ status = fchmod( 3, 0 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBADF );
+
+ puts( "Init - open new file: /newfile in read-only mode -- OK" );
+ fd = open( "/newfile", O_RDONLY | O_CREAT, S_IRWXU );
+ rtems_test_assert( fd != -1 );
+
+ /*
+ *This test returns success in Linux
+ */
+
+#if !defined(__rtems__)
+ puts( "Init - fchmod, with the opened file descriptor - expect EINVAL" );
+ status = fchmod( fd, 0 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EINVAL );
+#endif
+
+ puts(" Init - close and remove /newfile" );
+ status = close( fd );
+ struct stat statbuf;
+ status= stat("/newfile",&statbuf);
+ rtems_test_assert(status==0);
+ printf("%04o\n",statbuf.st_mode);
+ status |= unlink( "/newfile" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - open new file: /newfile in read-write mode -- OK" );
+ fd = open( "/newfile", O_RDWR | O_CREAT, S_IRWXU );
+ rtems_test_assert( fd != -1 );
+
+ puts( "Init - fchmod, with the opened file descriptor -- OK" );
+ status = fchmod( fd, S_IRUSR );
+ rtems_test_assert( status == 0 );
+
+ puts(" Init - close and remove /newfile -- OK" );
+ status = close( fd );
+ status |= unlink( "/newfile" );
+ rtems_test_assert( status == 0 );
+
+ puts( "End of fchmod tests" );
+
+ /****************************************************
+ * fchown tests
+ ***************************************************/
+
+ puts( "\nInit - fchown tests" );
+
+ puts( "Init - fchown, with a bad file descriptor - expect EBADF" );
+ status = fchown( 4, 0, 0 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBADF );
+
+ puts( "Init - fchown, with an unopened file descriptor - expect EBADF" );
+ status = fchown( 3, 0, 0 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBADF );
+
+ puts( "Init - open new file: /newfile in read-only mode -- OK" );
+ fd = open( "/newfile", O_WRONLY | O_CREAT, S_IRWXU );
+ rtems_test_assert( fd != -1 );
+
+ puts( "Init - fchown, with the opened file descriptor - expect EINVAL" );
+ status = fchown( fd, 0, 0 );
+
+ status= fstat(fd, &statbuf);
+ rtems_test_assert( status == 0 );
+ printf("%04o\n",statbuf.st_mode);
+
+
+
+ puts(" Init - close and remove /newfile" );
+ status = close( fd );
+ status |= unlink( "/newfile" );
+
+
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - open new file: /newfile in read-write mode -- OK" );
+ fd = open( "/newfile", O_RDWR | O_CREAT, S_IRWXU );
+
+ rtems_test_assert( fd != -1 );
+#if defined(MDOSFS_TEST)
+#else
+ puts( "Init - fchown, with the opened file descriptor -- OK" );
+ status = fchown( fd, 1, 0 );
+ rtems_test_assert( status == 0 );
+#endif
+
+ puts(" Init - close and remove /newfile -- OK" );
+ status = close( fd );
+ status |= unlink( "/newfile" );
+ rtems_test_assert( status == 0 );
+
+ puts( "End of fchown tests" );
+ puts( "*** END OF TEST Posix file op tests - 01 ***" );
+}
diff -u /dev/null rtems/testsuites/fstests/fsfile01/fsfile01.doc:1.1
--- /dev/null Mon Aug 1 10:11:41 2011
+++ rtems/testsuites/fstests/fsfile01/fsfile01.doc Mon Aug 1 09:29:49 2011
@@ -0,0 +1,37 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2009.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsfile01
+
+directives:
+
+
++ open
++ mkfifo
++ mkdir
++ mknod
++ rename
++ write
++ read
++ lseek
++ stat
++ unlink
++ rmdir
++ fopen
++ fprinf
+
+
+concepts:
+
++ Exercise most of file operation.
+
diff -u /dev/null rtems/testsuites/fstests/fsfile01/test.c:1.1
--- /dev/null Mon Aug 1 10:11:41 2011
+++ rtems/testsuites/fstests/fsfile01/test.c Mon Aug 1 09:29:49 2011
@@ -0,0 +1,642 @@
+/*
+ * Simple test program to exercise some of the basic functionality of
+ * POSIX Files and Directories Support.
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <ctype.h>
+#include <reent.h>
+
+#include <rtems.h>
+#include <rtems/libio.h>
+
+#include "fstest.h"
+
+void test_case_reopen_append(void);
+
+char test_write_buffer[ 1024 ];
+
+/*
+ * File test support routines.
+ */
+
+void test_cat(
+ char *file,
+ int offset_arg,
+ int length
+);
+
+void test_write(
+ char *file,
+ off_t offset,
+ char *buffer
+);
+
+void test_extend(
+ char *file,
+ off_t new_len
+);
+
+
+/*
+ * dump_statbuf
+ */
+
+void dump_statbuf( struct stat *buf )
+{
+ int major1;
+ int minor1;
+ int major2;
+ int minor2;
+
+ rtems_filesystem_split_dev_t( buf->st_dev, major1, minor1 );
+ rtems_filesystem_split_dev_t( buf->st_rdev, major2, minor2 );
+
+ printf( "....st_dev (0x%x:0x%x)\n", major1, minor1 );
+ printf( "....st_ino %" PRIxino_t " may vary by small amount\n", buf->st_ino );
+ printf( "....mode = %08o\n", (unsigned int) buf->st_mode );
+ printf( "....nlink = %d\n", buf->st_nlink );
+
+ printf( "....uid = %d\n", buf->st_uid );
+ printf( "....gid = %d\n", buf->st_gid );
+
+ printf( "....atime = %s", ctime(&buf->st_atime) );
+ printf( "....mtime = %s", ctime(&buf->st_mtime) );
+ printf( "....ctime = %s", ctime(&buf->st_ctime) );
+
+ printf( "....st_blksize %" PRIxblksize_t "\n", buf->st_blksize );
+ printf( "....st_blocks %" PRIxblkcnt_t "\n", buf->st_blocks );
+}
+
+void stat_a_file(
+ const char *file
+)
+{
+ int status;
+ struct stat statbuf;
+
+ rtems_test_assert( file );
+
+ printf( "stat( %s ) returned ", file );
+ fflush( stdout );
+
+ status = stat( file, &statbuf );
+
+ if ( status == -1 ) {
+ printf( ": %s\n", strerror( errno ) );
+ } else {
+ puts("");
+ dump_statbuf( &statbuf );
+ }
+
+}
+
+/*
+ * Main entry point of the test
+ */
+
+void test(void)
+{
+ int status;
+ size_t max_size;
+ int fd;
+ int i;
+ struct stat buf;
+ char buffer[128];
+ FILE *file;
+ time_t atime1;
+ time_t mtime1;
+ time_t ctime1;
+ time_t atime2;
+ time_t mtime2;
+ time_t ctime2;
+ rtems_status_code rtems_status;
+ rtems_time_of_day time;
+
+ printf( "\n\n*** FILE TEST 1 ***\n" );
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ rtems_status = rtems_clock_set( &time );
+ max_size = 512*512;
+
+ /*
+ * Exercise mkdir() and some path evaluation.
+ */
+
+ puts( "mkdir /dev" );
+ status = mkdir( "/dev", S_IRWXU );
+ rtems_test_assert( !status );
+
+
+ /*
+ * Exercise mkdir() and some path evaluation.
+ */
+ puts( "" );
+ puts( "mkdir /dev/tty" );
+ status = mkdir( "/dev/tty", S_IRWXU );
+ rtems_test_assert( !status );
+
+ puts( "" );
+ puts( "mkdir /usr" );
+ status = mkdir( "/usr", S_IRWXU );
+ rtems_test_assert( !status );
+ puts( "mkdir /etc" );
+ status = mkdir( "/etc", S_IRWXU );
+ rtems_test_assert( !status );
+
+ puts( "mkdir /tmp" );
+ status = mkdir( "/tmp", S_IRWXU );
+ rtems_test_assert( !status );
+
+ /* this tests the ".." path in path name evaluation */
+ puts( "mkdir /tmp/.." );
+ status = mkdir( "/tmp/..", S_IRWXU );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EEXIST );
+#if !defined(MRFS_TEST)
+ /* now check out trailing separators */
+ puts( "mkdir /tmp/" );
+ status = mkdir( "/tmp/", S_IRWXU );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EEXIST );
+#endif
+
+ /* try to make a directory under a non-existent subdirectory */
+ puts( "mkdir /j/j1" );
+ status = mkdir( "/j/j1", S_IRWXU );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOENT );
+
+ /* this tests the ability to make a directory in the current one */
+ puts( "mkdir tmp" );
+ status = mkdir( "tmp", S_IRWXU );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EEXIST );
+
+ /* test rtems_filesystem_evaluate_path by sending NULL path */
+ status = chdir( NULL );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ /*
+ * Now switch gears and exercise rmdir().
+ */
+
+ puts( "" );
+ puts( "rmdir /usr" );
+ status = rmdir( "/usr" );
+ rtems_test_assert( !status );
+
+ puts( "rmdir /dev" );
+ status = rmdir( "/dev" );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTEMPTY);
+
+ puts( "rmdir /fred" );
+ status = rmdir ("/fred");
+ rtems_test_assert (status == -1);
+ rtems_test_assert( errno == ENOENT );
+
+ puts( "rmdir /tmp/bha" );
+ status = rmdir( "/tmp/bha" );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOENT );
+
+ puts( "unlink /dev/tty" );
+ status = unlink( "/dev/tty" );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EISDIR );
+
+ puts ("mknod /etc/passwd");
+ status = mknod( "/etc/passwd", (S_IFREG | S_IRWXU), 0LL );
+ rtems_test_assert( !status );
+
+ puts( "mkdir /tmp/my_dir");
+ status = mkdir( "/tmp/my_dir", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ puts("mkfifo /c/my_dir" );
+ status = mkfifo( "/c/my_dir", S_IRWXU );
+ rtems_test_assert( status == -1 );
+
+ /*
+ * Try to make a directory under a file -- ERROR
+ */
+ puts( "mkdir /etc/passwd/j" );
+ status = mkdir( "/etc/passwd/j", S_IRWXU );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTDIR );
+
+ /*
+ * Simple open failure case on non-existent file
+ */
+
+ puts( "open /tmp/joel - should fail with ENOENT" );
+ fd = open( "/tmp/joel", O_RDONLY );
+ rtems_test_assert( fd == -1 );
+ rtems_test_assert( errno == ENOENT );
+
+ /*
+ * Simple open case where the file is created.
+ */
+
+ puts( "open /tmp/j" );
+ fd = open( "/tmp/j", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert( fd != -1 );
+ printf( "open returned file descriptor %d\n", fd );
+
+ puts( "close /tmp/j" );
+ status = close( fd );
+ rtems_test_assert( !status );
+
+ puts( "close /tmp/j again" );
+ status = close( fd );
+ rtems_test_assert( status == -1 );
+
+ puts( "unlink /tmp/j" );
+ status = unlink( "/tmp/j" );
+ rtems_test_assert( !status );
+
+ puts( "unlink /tmp" );
+ status = unlink( "/tmp" );
+ rtems_test_assert( status );
+
+
+
+ /*
+ * Simple open failure. Trying to create an existing file.
+ */
+
+ puts("create and close /tmp/tom");
+ fd = open( "/tmp/tom", O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert( fd != -1 );
+ status = close( fd );
+ rtems_test_assert( status == 0 );
+
+ puts("Attempt to recreate /tmp/tom");
+ fd = open( "/tmp/tom", O_CREAT | O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert( fd == -1 );
+ rtems_test_assert( errno == EEXIST );
+
+ puts("create /tmp/john");
+ fd = open( "/tmp/john", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert( fd != -1 );
+
+ puts("tcdrain /tmp/john" );
+ status = tcdrain( fd );
+ rtems_test_assert( status == 0 );
+
+
+ status= close(fd);
+ rtems_test_assert( status == 0 );
+
+ /*
+ * Open a file in read-only mode and try to truncate
+ */
+
+ puts( "Attempt to create a file, open in read-only mode and truncate it" );
+ fd = open( "/tmp/bha", O_CREAT | O_RDONLY | O_TRUNC, S_IRUSR );
+#if !defined(__rtems__)
+ rtems_test_assert( fd == -1 );
+ rtems_test_assert( errno == EINVAL );
+#endif
+
+ puts( "Exercise the reentrant version _link_r -- Expect ENOENT" );
+ status = _link_r( NULL, "/tmp/notexist", "/tmp/cannotexist" );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOENT );
+
+ puts( "Unlink /tmp/bha using the reentrant version -- OK" );
+ status = _unlink_r( NULL, "/tmp/bha" );
+ rtems_test_assert( status == 0 );
+
+ /*
+ * Simple test case for mknod
+ */
+
+ puts( "mknod with bad type - expect EINVAL" );
+ status = mknod( "/tmp/bha", 0, 0LL );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EINVAL );
+
+ /*
+ * Read from filedes opened for write
+ */
+
+ puts( "open /tmp/bha in write only mode -- OK" );
+ fd = open( "/tmp/bha", O_CREAT | O_WRONLY, S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert( fd != -1 );
+
+ puts( "attempt fcntl on opened file -- OK" );
+ status = fcntl( fd, F_SETFD, 0 );
+ rtems_test_assert( status == 0 );
+
+ puts( "attempt to read from /tmp/bha - expect EINVAL" );
+ status = read( fd, buffer, 10 );
+ rtems_test_assert( status == -1 );
+#if !defined (__rtems__)
+ rtems_test_assert( errno == EINVAL );
+#endif
+
+ puts( "closing and unlinking /tmp/bha" );
+ status = close( fd );
+ status |= unlink( "/tmp/bha" );
+ rtems_test_assert( status == 0 );
+
+ puts( "open /tmp/bha in read only mode -- OK" );
+ fd = open( "/tmp/bha", O_CREAT | O_RDONLY, S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert( fd != -1 );
+
+ puts( "attempt to read from /tmp/bha - expect EINVAL" );
+ status = write( fd, buffer, 10 );
+ rtems_test_assert( status == -1 );
+#if !defined(__rtems__)
+ rtems_test_assert( errno == EINVAL );
+#endif
+
+ puts( "closing and unlinking /tmp/bha" );
+ status = close( fd );
+ status |= unlink( "/tmp/bha" );
+ rtems_test_assert( status == 0 );
+
+ /*
+ * Read/write from an unopened filedes
+ */
+ puts( "attempt to read from an unopened filedes - expect EBADF" );
+ status = read( 5, buffer, 10 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBADF );
+
+ puts( "attempt to write to an unopened filedes - expect EBADF" );
+ status = write( 5, buffer, 10 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBADF );
+
+ /*
+ * Test simple write to a file at offset 0
+ */
+
+ puts( "mknod /tmp/joel" );
+ status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL );
+ test_write( "/tmp/joel", 0, "the first write!!!\n" );
+ test_cat( "/tmp/joel", 0, 0 );
+
+ /* 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);
+#if defined(MDOSFS_TEST)
+ /* 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);
+#endif
+ 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);
+
+ /*
+ * Test simple write to a file at a non-0 offset in the first block
+ */
+
+ status = unlink( "/tmp/joel" );
+ rtems_test_assert( !status );
+
+ status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL );
+ rtems_test_assert( !status );
+
+ test_write( "/tmp/joel", 10, "the first write!!!\n" );
+ test_cat( "/tmp/joel", 0, 0 );
+ stat_a_file( "/tmp/joel" );
+
+ /*
+ * Test simple write to a file at a non-0 offset in the second block. Then
+ * try to read from various offsets and lengths.
+ */
+
+ puts("unlink /tmp/joel");
+ status = unlink( "/tmp/joel" );
+ rtems_test_assert( !status );
+
+ /* Test a failure path */
+
+ puts( "unlink /tmp/joel" );
+ status = unlink( "/tmp/joel" );
+ rtems_test_assert( status == -1 );
+
+ puts( "mknod /tmp/joel");
+ status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL );
+ rtems_test_assert( !status );
+
+ test_write( "/tmp/joel", 514, "the first write!!!\n" );
+ test_write( "/tmp/joel", 1, test_write_buffer );
+ test_write( "/tmp/joel", 63, test_write_buffer );
+ test_cat( "/tmp/joel", 0, 1 );
+ test_cat( "/tmp/joel", 1, 1 );
+ test_cat( "/tmp/joel", 490, 1 );
+ test_cat( "/tmp/joel", 512, 1 );
+ test_cat( "/tmp/joel", 513, 1 );
+ test_cat( "/tmp/joel", 514, 1 );
+ test_cat( "/tmp/joel", 520, 1 );
+ test_cat( "/tmp/joel", 1, 1024 );
+
+ /*
+ * Read from a much longer file so we can descend into doubly and
+ * triply indirect blocks.
+ */
+
+ if ( max_size < (size_t) 300 * 1024 ) {
+ test_extend( "/tmp/joel", max_size - 1 );
+ test_cat( "/tmp/joel", max_size / 2, 1024 );
+ } else {
+ printf( "Skipping maximum file size test since max_size is %zu bytes\n", max_size );
+ puts("That is likely to be bigger than the available RAM on many targets." );
+ }
+
+ stat_a_file( "/tmp/joel" );
+
+ /*
+ * Now try to use a FILE * descriptor
+ *
+ * /tmp/j should not exist at this point.
+ */
+
+ puts( "stat of /tmp/j" );
+ errno = 0;
+ status = stat( "/tmp/j", &buf );
+ printf( "stat(/tmp/j) returned %d (errno=%d)\n", status, errno );
+ dump_statbuf( &buf );
+
+ puts( "fopen of /tmp/j" );
+ file = fopen( "/tmp/j", "w+" );
+ rtems_test_assert( file );
+
+ puts( "fprintf to /tmp/j" );
+ for (i=1 ; i<=5 ; i++) {
+ status = fprintf( file, "This is call %d to fprintf\n", i );
+ rtems_test_assert( status );
+ printf( "(%d) %d characters written to the file\n", i, status );
+ }
+
+ fflush( file );
+
+ status = stat( "/tmp/j", &buf );
+ rtems_test_assert( !status );
+ dump_statbuf( &buf );
+ atime2 = buf.st_atime;
+ mtime2 = buf.st_mtime;
+ ctime2 = buf.st_ctime;
+
+
+ sleep(3);
+ rewind( file );
+ while ( fgets(buffer, 128, file) )
+ printf( "%s", buffer );
+
+ /*
+ * Verify only atime changed for a read.
+ */
+ status = stat( "/tmp/j", &buf );
+ rtems_test_assert( !status );
+ dump_statbuf( &buf );
+ atime1 = buf.st_atime;
+ mtime1 = buf.st_mtime;
+ ctime1 = buf.st_ctime;
+#if !defined(MDOSFS_TEST)
+ rtems_test_assert( atime1 != atime2);
+ rtems_test_assert( mtime1 == mtime2);
+ rtems_test_assert( ctime1 == ctime2);
+#endif
+
+
+ unlink( "/tmp/joel" );
+
+ /*
+ * Now truncate a file
+ */
+
+ sleep(3);
+ puts( "truncate /tmp/j to length of 40" );
+ status = truncate( "/tmp/j", 40 );
+ rtems_test_assert( !status );
+ /*
+ * Verify truncate changed only atime.
+ */
+ status = stat( "/tmp/j", &buf );
+ rtems_test_assert( !status );
+ dump_statbuf( &buf );
+ atime2 = buf.st_atime;
+ mtime2 = buf.st_mtime;
+ ctime2 = buf.st_ctime;
+#if !defined(MDOSFS_TEST) &&!defined(MRFS_TEST)
+ rtems_test_assert( atime1 != atime2);
+ rtems_test_assert( mtime1 == mtime2);
+ rtems_test_assert( ctime1 == ctime2);
+#endif
+
+ puts( "truncate /tmp/j to length of 0" );
+ status = truncate( "/tmp/j", 0 );
+ rtems_test_assert( !status );
+
+ puts( "truncate /tmp to length of 0 should fail with EISDIR\n");
+ status = truncate( "/tmp", 0 );
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EISDIR );
+
+
+ status = truncate( "/tmp/fred", 10 );
+ rtems_test_assert( status == -1);
+
+ status=fclose(file);
+ rtems_test_assert( status == 0);
+
+
+
+
+ test_case_reopen_append();
+
+ printf( "*** END OF FILE TEST 1 ***\n" );
+}
+
+/*
+ * Open/Create a File and write to it
+ *
+ * Test case submitted by Andrew Bythell <abythell at nortelnetworks.com>.
+ *
+ */
+
+void test_file (char *filename, char *mode);
+
+void test_case_reopen_append(void)
+{
+ printf ("Writing First File\n");
+ test_file ("/one.txt", "a");
+ test_file ("/one.txt", "a");
+
+ /* but not the second time - this will insert junk.
+ the number of ^@'s seems to equal the number of
+ actual characters in the file */
+
+ printf ("Writing Second File\n");
+ test_file ("/two.txt", "a");
+ test_file ("/two.txt", "a");
+
+ test_cat( "/one.txt", 0, 1024 );
+ test_cat( "/two.txt", 0, 1024 );
+}
+
+void test_file (char *filename, char *mode)
+{
+ FILE *fp;
+ fp = fopen (filename, mode);
+ if (!fp)
+ perror ("fopen");
+ fprintf (fp, "this is a test line\n");
+ if (fclose (fp))
+ perror ("fclose");
+}
diff -u /dev/null rtems/testsuites/fstests/fsfile01/test_cat.c:1.1
--- /dev/null Mon Aug 1 10:11:41 2011
+++ rtems/testsuites/fstests/fsfile01/test_cat.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,93 @@
+/*
+ * A test support function which performs a crude version of
+ * "cat" so you can look at specific parts of a file.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "fstest.h"
+
+/*
+ * test_cat routine
+ */
+
+unsigned char test_cat_buffer[ 1024 ];
+
+void test_cat(
+ char *file,
+ int offset_arg,
+ int length
+)
+{
+ int fd;
+ int status;
+ int is_printable = 0;
+ int my_length;
+ int i;
+ unsigned char c;
+ int count = 0;
+ off_t offset = (off_t)offset_arg;
+
+ my_length = (length) ? length : sizeof( test_cat_buffer );
+ rtems_test_assert( my_length <= sizeof( test_cat_buffer ) );
+
+ fd = open( file, O_RDONLY );
+ if ( fd == -1 ) {
+ printf( "test_cat: open( %s ) failed : %s\n", file, strerror( errno ) );
+ rtems_test_exit( 0 );
+ }
+
+ for ( ;; ) {
+ status = lseek( fd, offset, SEEK_SET );
+ rtems_test_assert( status != -1 );
+
+ status = read( fd, test_cat_buffer, sizeof(test_cat_buffer) );
+ if ( status <= 0 ) {
+ if (!is_printable)
+ printf( "(%d)", count );
+ puts( "" );
+ break;
+ }
+
+ for ( i=0 ; i<status ; i++ ) {
+ c = test_cat_buffer[i];
+ if (isprint(c) || isspace(c)) {
+ if (!is_printable) {
+ printf( "(%d)", count );
+ count = 0;
+ is_printable = 1;
+ }
+ putchar(c);
+ } else {
+ is_printable = 0;
+ count++;
+ }
+ }
+ offset += status;
+ }
+
+ status = close( fd );
+ rtems_test_assert( !status );
+}
diff -u /dev/null rtems/testsuites/fstests/fsfile01/test_extend.c:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsfile01/test_extend.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,70 @@
+/*
+ * A test support function which extends the file to the specified
+ * length. This handles the implied open(), lseek(), write(), and close()
+ * operations.
+ *
+ * The defined behavior is a seek() followed by a write() extends the file
+ * and zero fills the new length part.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "fstest.h"
+/*
+ * test_extend routine
+ */
+
+void test_extend(
+ char *file,
+ off_t offset
+)
+{
+ int fd;
+ int status;
+ char c = 0;
+
+ fd = open( file, O_WRONLY );
+ if ( fd == -1 ) {
+ printf( "test_extend: open( %s ) failed : %s\n", file, strerror( errno ) );
+ rtems_test_exit( 0 );
+ }
+
+ status = lseek( fd, offset - 1, SEEK_SET );
+ rtems_test_assert( status != -1 );
+
+ status = write( fd, &c, 1 );
+ if ( status == -1 ) {
+ printf( "test_extend: write( %s ) failed : %s\n", file, strerror( errno ) );
+ rtems_test_exit( 0 );
+ }
+
+ if ( status != 1 ) {
+ printf( "test_extend: write( %s ) only wrote %d of %d bytes\n",
+ file, status, 1 );
+ rtems_test_exit( 0 );
+ }
+
+ status = close( fd );
+ rtems_test_assert( !status );
+}
diff -u /dev/null rtems/testsuites/fstests/fsfile01/test_write.c:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsfile01/test_write.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,69 @@
+/*
+ * A test support function which performs a write() and
+ * handles implied open(), lseek(), write(), and close() operations.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+
+#include "fstest.h"
+/*
+ * test_write routine
+ */
+
+void test_write(
+ char *file,
+ off_t offset,
+ char *buffer
+)
+{
+ int fd;
+ int status;
+ int length;
+
+
+ length = strlen( buffer );
+
+ fd = open( file, O_WRONLY );
+ if ( fd == -1 ) {
+ printf( "test_write: open( %s ) failed : %s\n", file, strerror( errno ) );
+ rtems_test_exit( 0 );
+ }
+
+ status = lseek( fd, offset, SEEK_SET );
+ rtems_test_assert( status != -1 );
+
+ status = write( fd, buffer, length );
+ if ( status == -1 ) {
+ printf( "test_write: write( %s ) failed : %s\n", file, strerror( errno ) );
+ rtems_test_exit( 0 );
+ }
+
+ if ( status != length ) {
+ printf( "test_write: write( %s ) only wrote %d of %d bytes\n",
+ file, status, length );
+ rtems_test_exit( 0 );
+ }
+
+ status = close( fd );
+ rtems_test_assert( !status );
+}
diff -u /dev/null rtems/testsuites/fstests/fsfile02/fsfile02.doc:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsfile02/fsfile02.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,38 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsfile02
+
+directives:
+
+ mkdir
+ open
+ close
+ ftruncate
+ _fcntl_r
+ fdatasync
+ fstat
+ fsync
+ ioctl
+ _lseek_r
+ readv
+ writev
+ write
+
+concepts:
+
++ Verify failure when a previously opened, but now closed file
+descriptor is used.
++ Verify failure when an out of range file descriptor (above the
+number configured) is used.
+
diff -u /dev/null rtems/testsuites/fstests/fsfile02/init.c:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsfile02/init.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,132 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <sys/uio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <ctype.h>
+
+
+#include "fstest.h"
+
+void do_with_fd(
+ int fd,
+ const char *description
+)
+{
+ struct stat stat_buff;
+ struct iovec vec[4];
+ off_t res;
+ int status;
+
+ printf("ftruncate %s\n", description);
+ status = ftruncate(fd, 40);
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+ printf("_fcntl_r %s\n", description);
+ status = _fcntl_r( NULL, fd, F_SETFD, 1 );
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+
+ printf("fdatasync %s\n", description);
+ status = fdatasync( fd );
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+ printf("fstat %s\n", description);
+ status = fstat( fd, &stat_buff );
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+ printf("fsync %s\n", description);
+ status = fsync( fd );
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+ printf("ioctl %s\n", description);
+ status = ioctl( fd, 0 );
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+ printf("_lseek_r %s\n", description);
+ res = _lseek_r (NULL, fd, 0, SEEK_SET);
+ rtems_test_assert( res == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+
+ printf("readv %s\n", description);
+ status = readv(fd, vec, 4);
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+ printf("writev %s\n", description);
+ status = writev(fd, vec, 4);
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+
+ printf("write %s\n", description);
+ status = write(fd, "1234", 4);
+ rtems_test_assert( status == -1 );
+ printf( "%d: %s\n", errno, strerror( errno ) );
+ rtems_test_assert( errno == EBADF );
+}
+
+void test()
+{
+ int status;
+ int fd;
+
+ puts( "\n\n*** PSXFILE02 TEST ***" );
+
+ /*
+ * Simple open case where the file is created.
+ */
+ puts( "mkdir /tmp" );
+ status = mkdir( "/tmp", S_IRWXU );
+ rtems_test_assert( !status );
+
+ puts( "open /tmp/j" );
+ fd = open( "/tmp/j", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert( fd != -1 );
+ printf( "open returned file descriptor %d\n", fd );
+
+ puts( "close /tmp/j" );
+ status = close( fd );
+ rtems_test_assert( !status );
+
+ do_with_fd( fd, "an unopened file" );
+ puts("");
+ do_with_fd( 1000, "a too large file descriptor" );
+
+ puts( "*** END OF PSXFILE02 TEST ***" );
+
+}
+
diff -u /dev/null rtems/testsuites/fstests/fsfstest/fs-test.c:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsfstest/fs-test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,972 @@
+/*
+ * $Id$
+ *
+ * RTEMS Project (http://www.rtems.org/)
+ *
+ * Copyright 2007 Chris Johns (chrisj at rtems.org)
+ */
+
+/**
+ * Basic File System test. This is to just check a file system
+ * down work as expected.
+ *
+ * Please add more tests
+ */
+
+#include <errno.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <rtems.h>
+
+#include "fstest.h"
+
+
+
+/**
+ * The block size of files when creating.
+ */
+#define FILE_BLOCK_SIZE (256)
+
+/**
+ * The types for the file-system test.
+ */
+typedef enum fst_type
+{
+ fst_file,
+ fst_dir
+} fst_type;
+
+/**
+ * Jump to the top on error.
+ */
+static jmp_buf top;
+
+/**
+ * Stat a path returning the stat buffer.
+ *
+ * @param path Path to get the stat buffer of.
+ * @param buf The stat buffer.
+ */
+static void
+checked_stat (const char* path, struct stat* buf)
+{
+ if (stat (path, buf) < 0)
+ {
+ printf ("error: stat of '%s' failed: %s (%d)\n",
+ path, strerror (errno), errno);
+ longjmp (top, 1);
+ }
+}
+
+/**
+ * Return if the path points to a directory.
+ *
+ * @param path Path to check if a directory.
+ */
+static void
+check_dir (const char* path)
+{
+ struct stat ds;
+ checked_stat (path, &ds);
+ if (!S_ISDIR(ds.st_mode))
+ {
+ printf ("error: path '%s' is not a directory\n", path);
+ longjmp (top, 1);
+ }
+}
+
+/**
+ * Return if the change to the path is successful.
+ *
+ * @param path Path to change directory to.
+ */
+static void
+change_dir (const char* path)
+{
+ check_dir (path);
+ if (chdir (path) < 0)
+ {
+ printf ("error: change directory to '%s' failed: %s (%d)\n",
+ path, strerror (errno), errno);
+ longjmp (top, 1);
+ }
+}
+
+/**
+ * Return if the directory is created. The path is checked
+ * to insure the full path exists and if it does not all parts
+ * are made.
+ *
+ * @param dirpath Path to the directory to create.
+ */
+static bool
+create_dir (const char* dirpath, bool jump_on_error)
+{
+ /*
+ * The local copy can be written to.
+ */
+ char* path;
+ char* next;
+
+ /*
+ * If the directory path is absolute take that as the full path
+ * to create. If the path is relative get the current working
+ * directory and pre-pend it to th directoy path.
+ */
+
+ if (*dirpath == '/')
+ {
+ path = strdup (dirpath);
+ if (!path)
+ {
+ printf ("error: could not duplicate path in create_dir\n");
+ longjmp (top, 1);
+ }
+ }
+ else
+ {
+ /*
+ * Find a buffer large enough for the current working directory.
+ */
+ size_t size = 256;
+ path = NULL;
+ while (path == NULL)
+ {
+ char* cwd = malloc (size);
+ if (!cwd)
+ {
+ printf ("error: could not allocate memory in create_dir\n");
+ longjmp (top, 1);
+ }
+
+ if (getcwd (cwd, size) == cwd)
+ {
+ path = malloc (strlen (cwd) + strlen (dirpath) + 2);
+
+ if (!path)
+ {
+ free (cwd);
+ printf ("error: could not duplicate path in create_dir\n");
+ longjmp (top, 1);
+ }
+
+ strcpy (path, cwd);
+ strcat (path, "/");
+ strcpy (path, dirpath);
+
+ free (cwd);
+ break;
+ }
+
+ free (cwd);
+ size += 256;
+ }
+ }
+
+ next = path;
+
+ /*
+ * Break the path up into its parts and check to see if
+ * each part exists. It a part does not exist create it.
+ * If the part is not a directory report as an error.
+ */
+
+ while (next)
+ {
+ char separator = '/';
+ struct stat ds;
+
+ /*
+ * Remove the separator and replace with a nul. If
+ * no separator is found this is the end of the path.
+ */
+
+ next = strchr (next, '/');
+
+ if (next)
+ {
+ separator = *next;
+ *next = '\0';
+ }
+
+ if (stat (path, &ds) == 0)
+ {
+ if (!S_ISDIR(ds.st_mode))
+ {
+ printf ("error: path exists and is not a directory: %s\n", path);
+ free (path);
+ longjmp (top, 1);
+ }
+ }
+ else if (errno != ENOENT)
+ {
+ printf ("error: path stat failure: %s: %s (%d)\n",
+ path, strerror (errno), errno);
+ free (path);
+ longjmp (top, 1);
+ }
+ else
+ {
+ if (mkdir (path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0)
+ {
+ free (path);
+ if (jump_on_error)
+ {
+ printf ("error: make directory '%s' failed: %s (%d)\n",
+ path, strerror (errno), errno);
+ longjmp (top, 1);
+ }
+ return false;
+ }
+ }
+
+ if (next)
+ {
+ *next = separator;
+ next++;
+ }
+ }
+
+ free (path);
+
+ return true;
+}
+
+/**
+ * Return if the file is created. The path is checked
+ * to insure the full path exists and if it does not all parts
+ * are made. The file is fill with repeating numbers.
+ *
+ * @param filepath Path to the file to create.
+ */
+static bool
+create_file (const char* filepath, size_t size, bool jump_on_error)
+{
+ unsigned char* block;
+ unsigned char pattern = 0;
+ int fd;
+
+ /*
+ * Does the file path contain directories ?
+ */
+ if (strchr (filepath, '/') != NULL)
+ {
+ /*
+ * Get a copy of the path and search backwards for the
+ * directory separator.
+ */
+
+ char* dirpath = strdup (filepath);
+ char* end = dirpath + strlen (dirpath);
+
+ while (*end != '/')
+ end--;
+
+ *end = '\0';
+
+ create_dir (dirpath, true);
+
+ free (dirpath);
+ }
+
+ fd = open (filepath,
+ O_CREAT | O_TRUNC | O_WRONLY,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+ if (fd < 0)
+ {
+ if (jump_on_error)
+ {
+ printf ("error: open failed: %s: %s (%d)\n", filepath,
+ strerror (errno), errno);
+ longjmp (top, 1);
+ }
+ return false;
+ }
+
+ block = malloc (FILE_BLOCK_SIZE);
+
+ if (!block)
+ {
+ printf ("error: no memory in create_file\n");
+ close (fd);
+ return false;
+ //longjmp (top, 1);
+ }
+
+ while (size)
+ {
+ size_t bsize = size < FILE_BLOCK_SIZE ? size : FILE_BLOCK_SIZE;
+
+ memset (block, pattern++, FILE_BLOCK_SIZE);
+
+ if (write (fd, block, bsize) < 0)
+ {
+ printf ("error: file write failed: %s: %s (%d)\n",
+ filepath, strerror (errno), errno);
+ free (block);
+ close (fd);
+ //longjmp (top, 1);
+ return false;
+ }
+
+ size -= bsize;
+ }
+
+ free (block);
+
+ if (close (fd) < 0)
+ {
+ printf ("error: file close failed: %s: %s (%d)\n",
+ filepath, strerror (errno), errno);
+ longjmp (top, 1);
+ }
+
+ return true;
+}
+
+/**
+ * Remove directory.
+ *
+ * @param path The path to the directory to remove.
+ */
+void
+remove_dir (const char* path)
+{
+ if (rmdir (path) < 0)
+ {
+ printf ("error: removing directory: %s: %s (%d)\n",
+ path, strerror (errno), errno);
+ longjmp (top, 1);
+ }
+}
+
+/**
+ * Remove file.
+ *
+ * @param path The path to the file to remove.
+ */
+void
+remove_file (const char* path)
+{
+ if (unlink (path) < 0)
+ {
+ printf ("error: removing file: %s: %s (%d)\n",
+ path, strerror (errno), errno);
+ longjmp (top, 1);
+ }
+}
+
+/**
+ * Check the limit of a directory by creating directories or files
+ * up to the limit.
+ *
+ * @param base
+ * @param type
+ * @param limit
+ */
+void
+check_dir_limit (const char* base, fst_type type, int limit)
+{
+ int count = 0;
+ int c;
+
+ create_dir (base, true);
+ change_dir (base);
+
+ while (count < limit)
+ {
+ char path[16];
+
+ snprintf (path, sizeof (path), "tst%04d", count);
+
+ if (type == fst_file)
+ create_file (path, 64, true);
+ else
+ create_dir (path, true);
+
+ count++;
+ }
+
+ for (c = 0; c < count; c++)
+ {
+ char path[16];
+
+ snprintf (path, sizeof (path), "tst%04d", c);
+
+ if (type == fst_file)
+ remove_file (path);
+ else
+ remove_dir (path);
+ }
+}
+
+/**
+ * Find the limit of a directory by creating directories or files
+ * until an error is detected.
+ *
+ * @param base
+ * @param type
+ * @param limit
+ */
+int
+find_dir_limit (const char* base, fst_type type, int limit)
+{
+ int count = 0;
+ int c;
+
+ create_dir (base, true);
+ change_dir (base);
+
+ while (count < limit)
+ {
+ char path[16];
+
+ snprintf (path, sizeof (path), "tst%04d", count);
+
+ if (type == fst_file)
+ {
+ if (!create_file (path, 64, false))
+ break;
+ }
+ else
+ {
+ if (!create_dir (path, false))
+ break;
+ }
+
+ count++;
+ }
+
+ for (c = 0; c < count; c++)
+ {
+ char path[16];
+
+ snprintf (path, sizeof (path), "tst%04d", c);
+
+ if (type == fst_file)
+ remove_file (path);
+ else
+ remove_dir (path);
+ }
+
+ return count;
+}
+
+/**
+ * Set the file size then stat to make sure the size is what we asked for.
+ */
+bool set_size_then_check (int fd, int pos, const char* what)
+{
+ struct stat sb;
+
+ if (ftruncate (fd, pos) < 0)
+ {
+ printf ("error: ftruncate %s failed: pos: %d: %s (%d)\n",
+ what, pos, strerror (errno), errno);
+ return false;
+ }
+
+ if (fstat (fd, &sb) < 0)
+ {
+ printf ("error: stat %s failed: %s (%d)\n", what, strerror (errno), errno);
+ return false;
+ }
+
+ if (sb.st_size != pos)
+ {
+ printf ("error: ftruncate %s invalid: file size not %d; is %jd\n",
+ what, pos, (intmax_t)sb.st_size);
+ return false;
+ }
+
+ return true;
+}
+
+bool
+read_words_and_verify (const char* what, int fd, size_t count, off_t offset, uint16_t base)
+{
+ uint8_t buffer[sizeof (uint16_t)];
+ uint16_t value;
+ int i;
+
+ if (lseek (fd, offset, SEEK_SET) < 0)
+ {
+ printf ("error: lseeking for %s failed: %s (%d)\n",
+ what, strerror (errno), errno);
+ return false;
+ }
+
+ for (i = 0; i < (count / 2); i++)
+ {
+ int rc = read (fd, buffer, sizeof (uint16_t));
+ if (rc != sizeof (uint16_t))
+ {
+ printf ("error: read pattern for %s failed: read at %u: %d: %s (%d)\n",
+ what, (unsigned int) (i + offset), rc, strerror (errno), errno);
+ return false;
+ }
+
+ value = (((uint16_t) buffer[0]) << 8) | buffer[1];
+ if (value != (i + base))
+ {
+ printf ("error: read pattern match for %s failed: : read: %02x%02x, wanted: %04x\n",
+ what, buffer[0], buffer[1], i);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Create an empty file then stat it. It should be 0. Then lseek to a location
+ * and stat again. It should still be 0. Read from the file and it should be
+ * EOF. Write to the file then stat and check the file. Seek to the start of
+ * the file and read the data up to the first seek location. It should be 0.
+ * Seek to the original position and then extend the file using
+ * ftruncate. Check the stat is the correct file. Read the block of data
+ * originally written has been read back. The ftruncate call should not move
+ * the file pointer. Perform a range or ftruncate with different values to make
+ * sure the file systems handle block alignment issues.
+ *
+ * @param base
+ */
+#if 0
+#define LSEEK_BUF_SIZE (512)
+#define LSEEK_POS_1 (1024)
+#else
+#define LSEEK_BUF_SIZE (32)
+#define LSEEK_POS_1 (64)
+#endif
+bool
+check_lseek_ftruncate_read_write (const char* base)
+{
+ const char* name = "tstlseekftruncate";
+ uint8_t buffer[LSEEK_BUF_SIZE];
+ uint32_t block_size;
+ struct stat sb;
+ int pos;
+ int count;
+ int fd;
+ bool result = true;
+ int rc;
+ int i;
+
+ create_dir (base, true);
+ change_dir (base);
+
+ fd = open (name,
+ O_CREAT | O_TRUNC | O_RDWR,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+ if (fd < 0)
+ {
+ printf ("error: open failed: %s: %s (%d)\n",
+ name, strerror (errno), errno);
+ return false;
+ }
+
+ if (fstat (fd, &sb) < 0)
+ {
+ printf ("error: create stat failed: %s: %s (%d)\n",
+ name, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ block_size = sb.st_blksize;
+
+ if (sb.st_size != 0)
+ {
+ printf ("error: create size invalid: file size not 0; is %Lu\n", sb.st_size);
+ result = false;
+ goto err;
+ }
+
+ if (read (fd, buffer, LSEEK_BUF_SIZE) < 0)
+ {
+ printf ("error: read of empty file failed: %s (%d)\n",
+ strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (lseek (fd, LSEEK_POS_1, SEEK_SET) < 0)
+ {
+ printf ("error: first lseek failed: pos: %d: %s (%d)\n",
+ LSEEK_POS_1, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (fstat (fd, &sb) < 0)
+ {
+ printf ("error: stat failed: %s (%d)\n", strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ off_t size=sb.st_size;
+ printf("size is %d value is %jd \n",sizeof(size),(intmax_t)size);
+
+#if !defined(MDOSFS_TEST) && !defined(MIMFS_TEST) && !defined(IMFS_TEST)
+ if (size !=0 )
+ {
+ printf ("error: lseek 1 size invalid: file size not 0; but is %jd \n", sb.st_size);
+ result = false;
+ goto err;
+ }
+#endif
+
+ rc = read (fd, buffer, LSEEK_BUF_SIZE);
+ if (rc != 0)
+ {
+ printf ("error: read of empty file after seek failed: read: %d: %s (%d)\n",
+ rc, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ for (i = 0; i < LSEEK_BUF_SIZE; i++)
+ buffer[i] = i & 0xff;
+
+ rc = write (fd, buffer, LSEEK_BUF_SIZE);
+ if (rc != LSEEK_BUF_SIZE)
+ {
+ printf ("error: write empty file after seek has failed: write: %d: %s (%d)\n",
+ rc, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (fstat (fd, &sb) < 0)
+ {
+ printf ("error: stat after write failed: %s (%d)\n", strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (sb.st_size != (LSEEK_POS_1 + LSEEK_BUF_SIZE))
+ {
+ printf ("error: post write size wrong: file size not %d; is %Lu\n",
+ LSEEK_POS_1 + LSEEK_BUF_SIZE, sb.st_size);
+ result = false;
+ goto err;
+ }
+
+ if (lseek (fd, 0, SEEK_SET) < 0)
+ {
+ printf ("error: lseek to pos 0 failed: %s (%d)\n", strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+ count = LSEEK_POS_1;
+ while (count)
+ {
+ int length = LSEEK_BUF_SIZE;
+
+ if (count < length)
+ length = count;
+
+ rc = read (fd, buffer, length);
+ if (rc != length)
+ {
+ printf ("error: read lseek space failed: read: %d: %s (%d)\n",
+ rc, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+#if !defined(MDOSFS_TEST)
+ for (i = 0; i < length; i++)
+ {
+ if (buffer[i] != 0)
+ {
+ printf ("error: read lseek space failed: not zero at %d -> %02x \n",
+ i, buffer[i]);
+ result = false;
+ goto err;
+ }
+ }
+#endif
+
+ count -= length;
+ }
+ count = LSEEK_BUF_SIZE;
+ while (count)
+ {
+ int length = LSEEK_BUF_SIZE;
+
+ if (count < length)
+ length = count;
+
+ rc = read (fd, buffer, length);
+ if (rc != length)
+ {
+ printf ("error: read write space failed: read: %d: %s (%d)\n",
+ rc, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ for (i = 0; i < length; i++)
+ {
+ if (buffer[i] != ((uint8_t) (i & 0xff)))
+ {
+ printf ("error: read write space failed: not zero at %d -> %02x \n",
+ i, buffer[i]);
+ result = false;
+ goto err;
+ }
+ }
+
+ count -= length;
+ }
+
+ /*
+ * Play with the file system's block boundaries.
+ */
+
+#if !defined(MDOSFS_TEST)
+ pos = block_size * 8;
+ if (!set_size_then_check (fd, pos, "8 x blksize"))
+ {
+ result = false;
+ goto err;
+ }
+
+ if (!set_size_then_check (fd, pos - 1, "(8 x blksize) - 1"))
+ {
+ result = false;
+ goto err;
+ }
+
+ if (!set_size_then_check (fd, pos + 1, "(8 x blksize) + 1"))
+ {
+ result = false;
+ goto err;
+ }
+
+ srand ((unsigned int) time (NULL));
+
+ for (i = 0; i < 100; i++)
+ {
+ pos = LSEEK_POS_1 + (rand () % (block_size * 8));
+
+ if (!set_size_then_check (fd, pos + 1, "random pos"))
+ {
+ result = false;
+ goto err;
+ }
+ }
+#endif
+ if (ftruncate (fd, 0) < 0)
+ {
+ printf ("error: ftruncate to 0 failed: pos: 0: %s (%d)\n",
+ strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (lseek (fd, 0, SEEK_SET) < 0)
+ {
+ printf ("error: lseek to pos 0 failed: %s (%d)\n", strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ for (i = 0; i < (LSEEK_BUF_SIZE / sizeof (uint16_t)); i++)
+ {
+ buffer[(i * 2) + 0] = (uint8_t) (i >> 8);
+ buffer[(i * 2) + 1] = (uint8_t) i;
+ }
+
+ rc = write (fd, buffer, LSEEK_BUF_SIZE);
+ if (rc != LSEEK_BUF_SIZE)
+ {
+ printf ("error: write pattern block has failed: write: %d: %s (%d)\n",
+ rc, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (!read_words_and_verify ("block write", fd, LSEEK_BUF_SIZE, 0, 0))
+ {
+ result = false;
+ goto err;
+ }
+
+ if (ftruncate (fd, 0) < 0)
+ {
+ printf ("error: ftruncate to 0 failed: pos: 0: %s (%d)\n",
+ strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (lseek (fd, 0, SEEK_SET) < 0)
+ {
+ printf ("error: lseek to pos 0 failed: %s (%d)\n", strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ for (i = 0; i < (LSEEK_BUF_SIZE / sizeof (uint16_t)); i++)
+ {
+ buffer[0] = (uint8_t) ((i >> 8) | (1 << 6));
+ buffer[1] = (uint8_t) i;
+
+ rc = write (fd, buffer, sizeof (uint16_t));
+ if (rc != sizeof (uint16_t))
+ {
+ printf ("error: write pattern words has failed: write: %d: %s (%d)\n",
+ rc, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+ }
+
+ if (!read_words_and_verify ("block word", fd, LSEEK_BUF_SIZE, 0, 1 << (6 + 8)))
+ {
+ result = false;
+ goto err;
+ }
+
+ close (fd);
+
+ fd = open (name, O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+ if (fd < 0)
+ {
+ printf ("error: 2nd open failed: %s: %s (%d)\n",
+ name, strerror (errno), errno);
+ return false;
+ }
+
+ if (fstat (fd, &sb) < 0)
+ {
+ printf ("error: reopen stat failed: %s: %s (%d)\n",
+ name, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (sb.st_size != LSEEK_BUF_SIZE)
+ {
+ printf ("error: reopen size invalid: file size not %d; is %Lu\n",
+ LSEEK_BUF_SIZE, sb.st_size);
+ result = false;
+ goto err;
+ }
+
+ if (lseek (fd, 0, SEEK_END) < 0)
+ {
+ printf ("error: lseek to end failed: %s (%d)\n", strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ for (i = 0; i < (LSEEK_BUF_SIZE / sizeof (uint16_t)); i++)
+ {
+ buffer[0] = ((uint8_t) (i >> 8)) | (1 << 7);
+ buffer[1] = (uint8_t) i;
+
+ rc = write (fd, buffer, sizeof (uint16_t));
+ if (rc != sizeof (uint16_t))
+ {
+ printf ("error: write pattern words has failed: write: %d: %s (%d)\n",
+ rc, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+ }
+
+ if (!read_words_and_verify ("block word end seek", fd,
+ LSEEK_BUF_SIZE, LSEEK_BUF_SIZE, 1 << (7 + 8)))
+ {
+ result = false;
+ goto err;
+ }
+
+ if (fstat (fd, &sb) < 0)
+ {
+ printf ("error: reopen stat failed: %s: %s (%d)\n",
+ name, strerror (errno), errno);
+ result = false;
+ goto err;
+ }
+
+ if (sb.st_size != (LSEEK_BUF_SIZE * 2))
+ {
+ printf ("error: reopen size invalid: file size not %d; is %Lu\n",
+ LSEEK_BUF_SIZE * 2, sb.st_size);
+ result = false;
+ goto err;
+ }
+
+err:
+ close (fd);
+ remove_file (name);
+ return result;
+}
+
+/**
+ * Test the file system.
+ */
+void
+filesystem_test (const char* base)
+{
+ int limit;
+
+ printf ("File System test: %s\n", base);
+
+/*
+ * Catch any error and return.
+ */
+ if (setjmp (top))
+ rtems_test_exit(0);
+
+
+ /*
+ * Find out how many files will fit in the root directory.
+ */
+ printf ("Find root directory limits: files\n");
+ limit = find_dir_limit (base, fst_file, 10000);
+ printf ("Root directory limits: %d\n", limit);
+
+ /*
+ * Make sure we can fill a subdirectory with more.
+ */
+ printf ("Checking directory limits: files\n");
+ check_dir_limit (base, fst_file, limit-1);
+
+ /*
+ * Find out how many dirs will fit in the root directory.
+ */
+ printf ("Find root directory limits: dirs\n");
+ limit = find_dir_limit (base, fst_dir, 1000);
+ printf ("Root directory limits: %d\n", limit);
+ /*
+ * Repeat with directories.
+ */
+ printf ("Checking directory limits: dir\n");
+ check_dir_limit (base, fst_dir, limit-1);
+
+ /*
+ * Check lseek and ftruncate work.
+ */
+ printf ("Checking lseek, ftruncate, read, and write\n");
+ if (!check_lseek_ftruncate_read_write (base))
+ rtems_test_exit(0);
+
+ printf ("File System test: passed\n");
+}
+void test(void)
+{
+ filesystem_test("/mnt");
+}
diff -u /dev/null rtems/testsuites/fstests/fsfstest/fsfstest.doc:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsfstest/fsfstest.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,25 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2009.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fschx
+
+directives:
+
++ lseek
++ read
++ write
+
+concepts:
+
++ Exercise read/write operation. Check if lseek works as expect.
+
diff -u /dev/null rtems/testsuites/fstests/fsimfs01/fsimfs01.doc:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsimfs01/fsimfs01.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,31 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsimfs01
+
+directives:
+
+ + open
+ + close
+ + read
+ + write
+ + lseek
+ + ftruncate
+ + unlink
+
+concepts:
+
++ Create, write, and read a file of maximum size.
+
++ Use ftruncate to shorten the file from the maximum size to 0.
+
diff -u /dev/null rtems/testsuites/fstests/fsimfs01/init.c:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsimfs01/init.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,255 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include "fstest.h"
+#define bool int
+#define true 1
+#define false 0
+
+int TestFd;
+uint8_t Buffer[256];
+ssize_t TotalWritten;
+
+#define FILE_NAME "biggie"
+
+void open_it(bool readOnly, bool create)
+{
+ int flag = 0;
+
+ if ( readOnly )
+ flag |= O_RDONLY;
+ else {
+ if ( create )
+ flag |= O_CREAT;
+ flag |= O_RDWR;
+ }
+
+ /* open the file */
+ puts( "open(" FILE_NAME ") - OK " );
+ TestFd = open( FILE_NAME, flag, 0777 );
+ rtems_test_assert( TestFd != -1 );
+}
+
+void write_helper(void)
+{
+ ssize_t written;
+
+ TotalWritten = 0;
+ puts( "write(" FILE_NAME ") - OK " );
+ do {
+ written = write( TestFd, Buffer, sizeof(Buffer) );
+ if ( written == -1 ) {
+ if ( errno == ENOSPC ) {
+ printf( "Total written = %zd\n", TotalWritten );
+ return;
+ }
+ fprintf(
+ stderr,
+ "Unable to create largest IMFS file (error=%s)\n",
+ strerror(errno)
+ );
+ rtems_test_exit(0);
+ }
+ TotalWritten += written;
+ } while (1);
+
+}
+
+void read_helper(void)
+{
+ uint8_t ch;
+ ssize_t sc;
+ int i=0;
+
+ puts( "read(" FILE_NAME ") - OK " );
+ do {
+ sc = read( TestFd, &ch, sizeof(ch) );
+ if ( sc == 1 ) {
+ if ( ch != (i%256) ) {
+ fprintf(
+ stderr,
+ "MISMATCH 0x%02x != 0x%02x at offset %d\n",
+ ch,
+ i % 256,
+ i
+ );
+ rtems_test_exit(0);
+ }
+ i++;
+ continue;
+ }
+ /* Unsure if ENOSPC is the write error to be returned */
+ if ( errno == ENOSPC && i == TotalWritten ) {
+ puts( "File correctly read until ENOSPC returned\n" );
+ return;
+ }
+ fprintf(
+ stderr,
+ "ERROR - at offset %d - returned %zd and error=%s\n",
+ i,
+ sc,
+ strerror( errno )
+ );
+ rtems_test_exit(0);
+ } while (1);
+}
+
+void truncate_helper(void)
+{
+ off_t position;
+ off_t new;
+ off_t sc;
+ int rc;
+
+ position = lseek( TestFd, 0, SEEK_END );
+ printf( "Seek to end .. returned %d\n", (int) position );
+ rtems_test_assert( position == TotalWritten );
+
+ puts( "lseek/ftruncate loop.." );
+ new = position;
+ do {
+ sc = lseek( TestFd, new, SEEK_SET );
+ rtems_test_assert( sc == new );
+
+ rc = ftruncate( TestFd, new );
+ if ( rc != 0 ) {
+ fprintf(
+ stderr,
+ "ERROR - at offset %d - returned %d and error=%s\n",
+ (int) new,
+ rc,
+ strerror( errno )
+ );
+ }
+ rtems_test_assert( rc == 0 );
+ --new;
+ } while (new > 0);
+}
+
+void extend_helper(void)
+{
+ off_t position;
+ off_t new;
+ off_t sc;
+ int rc;
+
+ position = lseek( TestFd, 0, SEEK_END );
+ printf( "Seek to end .. returned %d\n", (int) position );
+
+ /*
+ * test case to ftruncate a file to a length > its size
+ */
+
+ rc = ftruncate( TestFd, 2 );
+ rtems_test_assert( rc == 0 );
+
+ puts( "lseek/ftruncate loop.." );
+ new = position;
+ do {
+ sc = lseek( TestFd, new, SEEK_SET );
+ if( sc == -1 ) {
+ if( errno == ENOSPC ) {
+ break;
+ }
+ else {
+ rtems_test_assert( 0 );
+ }
+ }
+
+ rc = ftruncate( TestFd, new );
+ if ( rc != 0 ) {
+ if( errno != ENOSPC ) {
+ fprintf(
+ stderr,
+ "ERROR - at offset %d - returned %d and error=%s\n",
+ (int) new,
+ rc,
+ strerror( errno )
+ );
+ break;
+ }
+ else {
+ break;
+ }
+ }
+ rtems_test_assert( rc == 0 );
+ ++new;
+ } while ( 1 );
+}
+
+void close_it(void)
+{
+ int rc;
+
+ puts( "close(" FILE_NAME ") - OK " );
+ rc = close( TestFd );
+ rtems_test_assert( rc == 0 );
+}
+
+void unlink_it(void)
+{
+ int rc;
+
+ puts( "unlink(" FILE_NAME ") - OK" );
+ rc = unlink( FILE_NAME );
+ rtems_test_assert( rc == 0 );
+}
+
+void test(void){
+ int i;
+ void *alloc_ptr = (void *)0;
+ int position = 0;
+ int status = 0;
+
+ puts( "\n\n*** TEST IMFS 01 ***" );
+
+ for (i=0 ; i<sizeof(Buffer) ; i++ )
+ Buffer[i] = (uint8_t) i;
+
+ open_it(false, true);
+ write_helper();
+ close_it();
+
+ puts( "" );
+
+ open_it(true, false);
+ read_helper();
+ close_it();
+
+ open_it(false, false);
+ truncate_helper();
+
+ extend_helper();
+ position = lseek( TestFd , 0, SEEK_END );
+ status = lseek( TestFd, position+2, SEEK_SET );
+ i=write(TestFd,"t",1);
+ rtems_test_assert(i==-1);
+ perror("write error");
+#if !defined(MDOSFS_TEST) && !defined(IMFS_TEST) && !defined(MIFS_TEST)
+ rtems_test_assert( errno == ENOSPC );
+#endif
+
+ close_it();
+ unlink_it();
+
+ puts( "*** END OF TEST IMFS 01 ***" );
+
+}
+
diff -u /dev/null rtems/testsuites/fstests/fsimfs02/fsimfs02.doc:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsimfs02/fsimfs02.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,29 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsimfs02
+
+directives:
+
+ + mkdir
+ + link
+ + mknod
+ + open
+ + symlink
+ + lstat
+ + chmod
+ + chown
+
+concepts:
+
++ A above calls exercise the IMFS routines, mostly error paths.
diff -u /dev/null rtems/testsuites/fstests/fsimfs02/init.c:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fsimfs02/init.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,163 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "fstest.h"
+
+#if !HAVE_DECL_SETEUID
+extern int seteuid(uid_t euid);
+#endif
+
+void link_test(void)
+{
+ int status = 0;
+ void *alloc_ptr = (void *)0;
+ char linkname_n[20] = {0};
+ char linkname_p[20] = {0};
+ int i;
+ struct stat stat_buf;
+
+ puts( "\n\n*** TEST IMFS 02 ***" );
+
+ puts( "Creating directory /dir00" );
+ status = mkdir( "/dir00", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ puts( "Creating directory /dir00/dir01" );
+ status = mkdir( "/dir00/dir01", S_IRWXU );
+ perror("mkdir error");
+ rtems_test_assert( status == 0 );
+
+ puts( "Changing directory to /dir00" );
+ status = chdir( "/dir00" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Creating link dir01-link0 for dir01" );
+ status = link( "dir01", "dir01-link0" );
+ rtems_test_assert( status == 0 );
+
+ for( i = 1 ; ; ++i ) {
+ sprintf( linkname_p, "dir01-link%d", i-1 );
+ sprintf( linkname_n, "dir01-link%d", i );
+ printf( "\nCreating link %s for %s\n", linkname_n, linkname_p );
+ status = link( linkname_p, linkname_n );
+ if( status != 0 ) {
+ puts("Link creation failed" );
+ break;
+ }
+ }
+ for( ;i>0 ; i-- ) {
+ sprintf( linkname_p, "dir01-link%d", i-1 );
+ status = unlink( linkname_p );
+ if( status != 0 ) {
+ puts("unlink error");
+ }
+
+ }
+
+ puts( "Creating a regular node /node, RDONLY" );
+ status = mknod( "/node", S_IFREG | S_IRUSR, 0LL );
+ rtems_test_assert( status == 0 );
+
+ puts( "Creating link /node-link for /node" );
+ status = link( "/node" , "/node-link" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Opening /node-link in WRONLY mode -- expect EACCES" );
+ status = open( "/node-link", O_WRONLY );
+
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EACCES );
+
+
+ puts( "Creating a symlink /node-slink for /node" );
+ status = symlink( "/node" , "/node-slink" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Opening /node-slink in WRONLY mode -- expect EACCES" );
+ status = open( "/node-slink", O_WRONLY );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EACCES );
+
+
+
+ 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 );
+
+#if defined(RTEMS_POSIX_API)
+ 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 );
+#else
+ puts( "Attempt chmod on /node -- EPERM only when POSIX enabled" );
+ puts( "Attempt chown on /node -- EPERM only when POSIX enabled" );
+#endif
+
+
+ puts( "Changing euid back to 0 [root]" );
+ status = seteuid( 0 );
+ rtems_test_assert( status == 0 );
+#if !defined(__rtems__)
+ puts( "Creating a fifo -- OK" );
+ status = mkfifo( "/fifo", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+
+ puts( "chown /fifo to 10 -- OK" );
+ status = chown( "/fifo", 10, 10 );
+ rtems_test_assert( status == 0 );
+
+ puts( "Changing euid to 10" );
+ status = seteuid( 10 );
+ rtems_test_assert( status == 0 );
+
+ puts( "chmod /fifo -- OK" );
+ status = chmod( "/fifo", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ printf( "chown /fifo to %o -- OK", 0 );
+ status = chown( "/fifo", 0, 0 );
+ rtems_test_assert( status == 0 );
+#endif
+
+ puts( "*** END OF TEST IMFS 02 ***" );
+}
+void test(void )
+{
+#if defined(MDOSFS_TEST) || defined(MRFS_TEST)
+#else
+ link_test();
+#endif
+
+
+
+}
+
+/* end of file */
diff -u /dev/null rtems/testsuites/fstests/fslink/fslink.doc:1.1
--- /dev/null Mon Aug 1 10:11:42 2011
+++ rtems/testsuites/fstests/fslink/fslink.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2009.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fslink
+
+directives:
+
++ link
++ chmod
++ chown
+
+
+concepts:
+
++ Exercise successful link operation
+
diff -u /dev/null rtems/testsuites/fstests/fslink/test.c:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fslink/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,237 @@
+
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id Exp $
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <stdint.h>
+#include <math.h>
+
+#include "fstest.h"
+
+mode_t mode = 0644;
+/*
+ * Test if the successful call works as expect
+ */
+void link_test01(void )
+{
+ char *name0="t0";
+ char *name1="t1";
+ char *name2="t2";
+ char *name3="t3";
+
+ int status;
+ int fd;
+
+ struct stat statbuf;
+ mode_t tmp_mode;
+
+ time_t ctime1,dctime1,dmtime1;
+ time_t ctime2,dctime2,dmtime2;
+
+ puts("link creates hardlinks");
+
+ status=mkdir(name3,0755);
+ rtems_test_assert(status==0);
+
+ status=chdir(name3);
+ rtems_test_assert(status==0);
+ fd=creat(name0,mode);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0644);
+ rtems_test_assert(statbuf.st_nlink==1);
+
+ printf("the arg is %04o and the is %04o \n",tmp_mode,mode);
+ puts("test if the stat is the same");
+ status=link(name0,name1);
+ rtems_test_assert(status==0);
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0644);
+ rtems_test_assert(statbuf.st_nlink==2);
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0644);
+ rtems_test_assert(statbuf.st_nlink==2);
+
+ status=link(name1,name2);
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0644);
+ rtems_test_assert(statbuf.st_nlink==3);
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0644);
+ rtems_test_assert(statbuf.st_nlink==3);
+
+
+ status=stat(name2,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ rtems_test_assert(statbuf.st_nlink==3);
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0644);
+/*
+ * call chmod and chown and test.
+ */
+
+ puts("chmod and chown");
+
+ chmod(name1,0201);
+ chown(name1,65534,65533);
+
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ rtems_test_assert(statbuf.st_nlink==3);
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0201);
+ rtems_test_assert(statbuf.st_uid=65534);
+ rtems_test_assert(statbuf.st_gid=65533);
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0201);
+ rtems_test_assert(statbuf.st_nlink==3);
+ rtems_test_assert(statbuf.st_uid=65534);
+ rtems_test_assert(statbuf.st_gid=65533);
+
+ status=stat(name2,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0201);
+ rtems_test_assert(statbuf.st_nlink==3);
+ rtems_test_assert(statbuf.st_nlink==3);
+ rtems_test_assert(statbuf.st_uid=65534);
+ rtems_test_assert(statbuf.st_gid=65533);
+/*
+ *
+ * unlink then test if the nlink changes
+ */
+
+ puts("unlink then stat the file ");
+
+ status=unlink(name0);
+ rtems_test_assert(status==0);
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==-1);
+ rtems_test_assert(errno=ENOENT);
+
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0201);
+ rtems_test_assert(statbuf.st_nlink==2);
+
+
+ status=stat(name2,&statbuf);
+ rtems_test_assert(status==0);
+
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ rtems_test_assert(tmp_mode==0201);
+ rtems_test_assert(statbuf.st_nlink==2);
+
+
+ status=unlink(name1);
+ rtems_test_assert(status==0);
+
+ status=unlink(name2);
+ rtems_test_assert(status==0);
+
+
+ /*
+ * successful link() updates ctime
+ * and the ctime and mtime of the
+ * directory.
+ */
+ fd=creat(name0,0644);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ status=stat(name0,&statbuf);
+ ctime1=statbuf.st_ctime;
+ status=stat(".",&statbuf);
+ rtems_test_assert(status==0);
+ dctime1=statbuf.st_ctime;
+ dmtime1=statbuf.st_mtime;
+
+ puts("sleep a few seconds");
+ sleep(TIME_PRECISION );
+
+ status=link(name0,name1);
+ rtems_test_assert(status==0);
+ status=stat(name0,&statbuf);
+ ctime2=statbuf.st_ctime;
+ status=stat(".",&statbuf);
+ dctime2=statbuf.st_ctime;
+ dmtime2=statbuf.st_mtime;
+
+ puts("test if the time changes");
+ rtems_test_assert(!time_equal(ctime1,ctime2));
+#if !defined(IMFS_TEST) && !defined(MIMFS_TEST)
+ rtems_test_assert(!time_equal(dctime1,dctime2));
+#endif
+#if !defined(IMFS_TEST) && !defined(MIMFS_TEST)
+ rtems_test_assert(!time_equal(dmtime1,dmtime2));
+#endif
+
+}
+void test(void)
+{
+ puts( "\n\n*** LINK TEST ***" );
+#if defined(MDOSFS_TEST)
+#else
+ link_test01();
+#endif
+ puts( "*** END OF LINK TEST ***" );
+}
+
diff -u /dev/null rtems/testsuites/fstests/fsmkdir/fsmkdir.doc:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsmkdir/fsmkdir.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,23 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsmkdir
+
+directives:
+
++ mkdir
+
+concepts:
+
++ Call mkdir using vaild path name.
+
diff -u /dev/null rtems/testsuites/fstests/fsmkdir/test.c:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsmkdir/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,84 @@
+
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <sys/stat.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+
+
+#include "fstest.h"
+
+char * path[]={
+ "/test1/",
+ "tets2",
+ "///test3",
+ "test4////",
+ "../../test5",
+ "/test1/../test6",
+ "./test7/",
+ ".././test8",
+ "test8/./../test9",
+ "///test9/../test10",
+0
+};
+
+char * strange_name[]={
+ "!#$%&()-@^_`{}~'",
+ "0_1_A",
+ "aaa bbb",
+ "ccc....ddd",
+ " fff",
+ 0
+};
+
+void make_multiple_directories(
+ char **files
+)
+{
+ int i;
+ int status;
+
+ i = 0;
+ while ( files[i] ) {
+ printf( "Making directory %s\n", files[i] );
+ status = mkdir( files[i], S_IRWXU );
+ rtems_test_assert( !status );
+ i++;
+ }
+ puts( "" );
+}
+
+
+/*
+ * mkdir and some path name evaluation
+ */
+
+void mkdir_test01()
+{
+#if !defined (MDOSFS_TEST) && !defined(MRFS_TEST)
+ make_multiple_directories(path);
+#endif
+ make_multiple_directories(strange_name);
+}
+
+void test()
+{
+ mkdir_test01();
+}
diff -u /dev/null rtems/testsuites/fstests/fsopen/fsopen.doc:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsopen/fsopen.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,25 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsopen
+
+directives:
+
+ open
+ dup
+ close
+
+concepts:
+ Exercise the open directive with different arguments.
+
+
diff -u /dev/null rtems/testsuites/fstests/fsopen/test.c:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsopen/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,465 @@
+
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id Exp $
+ */
+
+#include <sys/stat.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+
+
+#include "fstest.h"
+
+#define TEST_FILE "test"
+
+/*
+ * Open a file with different arguments.
+ *
+ */
+
+void open_test01(void)
+
+{
+ int status;
+ int fd;
+ int fd2;
+ char long_name[NAME_MAX+2]={'\0'} ;
+ mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+
+ char* test_string ="Hello World";
+ size_t len=strlen(test_string);
+ char *buffer;
+
+ int n;
+ int i;
+ struct stat stat;
+ off_t offset ;
+
+
+
+ for (i=0;i<sizeof (long_name)-1;i++){
+ long_name[i]='T';
+ }
+
+ /*
+ * Simple open case to create a file.
+ */
+ puts("Open a file with O_RDWR |O_CREAT ");
+ fd= open (TEST_FILE, O_RDWR | O_CREAT ,S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert(fd!=-1);
+
+ status=close(fd);
+ rtems_test_assert(status==0);
+ puts("Open a file with O_RDONLY|O_CREAT ");
+ fd= open ("TTT", O_RDONLY | O_CREAT,mode );
+ rtems_test_assert(fd!=-1);
+
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+
+ puts("Open a file with O_RDWR");
+ fd= open ("TTT", O_RDWR|O_CREAT);
+ rtems_test_assert(fd>0);
+
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ status=mkdir("tmp",S_IRWXU|S_IRWXG|S_IRWXO);
+ rtems_test_assert(status==0);
+
+
+ puts("Open an existing file with O_CREAT |O_EXCL Should return EEXIST");
+ fd= open(TEST_FILE,O_CREAT|O_EXCL);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==EEXIST);
+
+ fd= open("TTT",O_CREAT|O_EXCL);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==EEXIST);
+
+#if !defined(MDOSFS_TEST) && !defined(MRFS_TEST)
+ puts("open a long name file NNAMETOOLONG");
+ fd=open(long_name,O_CREAT|O_RDWR,S_IRWXU);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==ENAMETOOLONG);
+#endif
+#if !defined(__rtems__)
+ puts("open a dir with O_WRONLY should fail with EISDIR");
+ fd= open ("tmp", O_WRONLY );
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==EISDIR);
+#endif
+#if !defined(__rtems__)
+ puts("open a none existing file should fail with ENOENT");
+ fd=open("",O_RDWR|O_CREAT);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==ENOENT);
+#endif
+
+ puts("Open a none existing file Should fail with ENOENT");
+ fd=open("tmp/a",O_RDWR);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==ENOENT);
+
+ fd=open("abc/abc",O_RDWR);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==ENOENT);
+
+#if !defined(MRFS_TEST) && !defined(MDOSFS_TEST)
+ puts("path prefix is not a directory should fail with ENOTDIR");
+ fd=open (TEST_FILE"/test",O_RDWR);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==ENOTDIR);
+#endif
+
+
+ puts("Close a bad fd Should fail with EBADF");
+ status=close(fd);
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno==EBADF);
+
+ fd=creat(TEST_FILE,mode);
+ rtems_test_assert(fd!=-1);
+
+#if !defined(MDOSFS_TEST) && !defined(MRFS_TEST)
+ puts("Dup a fd");
+ fd2=dup(fd);
+ rtems_test_assert(fd2!=-1);
+ rtems_test_assert(fd2!=fd);
+
+#if 0
+ status=close(fd2);
+ rtems_test_assert(status==0);
+ fd2=dup2(fd,6);
+
+ rtems_test_assert(fd2!=-1);
+ rtems_test_assert(fd2==6);
+#endif
+ puts("Test the if they write to the same file");
+ n=write(fd2,test_string,len);
+ rtems_test_assert( n != -1 );
+
+ status=close(fd2);
+ rtems_test_assert(status==0);
+
+ buffer = (char *)malloc(len+1);
+ rtems_test_assert( buffer );
+
+ fd2= open(TEST_FILE,O_RDONLY);
+ n=read(fd2,buffer,len);
+
+ status= strncmp(test_string, buffer, len );
+ printf("%s\n",buffer);
+ rtems_test_assert(status==0);
+
+
+ status=close(fd2);
+ rtems_test_assert(status==0);
+
+#endif
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ puts("Open a file with O_APPEND and watch the position");
+ fd=open(TEST_FILE,O_APPEND|O_WRONLY);
+ rtems_test_assert(fd>0);
+
+ status=fstat(fd,&stat);
+ rtems_test_assert(status==0);
+#if !defined(MDOSFS_TEST) && !defined(MRFS_TEST)
+ rtems_test_assert(stat.st_size==len);
+#endif
+
+#if !defined(MDOSFS_TEST) && !defined(MRFS_TEST)
+ n=write(fd,"a",1);
+ rtems_test_assert(n==1);
+ offset=lseek( fd, 0, SEEK_CUR ) ;
+ printf("the current offset is %jd\n",(intmax_t)offset);
+ rtems_test_assert(offset==len+1);
+ offset=lseek( fd, 0, SEEK_END ) ;
+ printf("the end offset is %jd\n",(intmax_t)offset);
+ rtems_test_assert(offset==len+1);
+#endif
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ puts("Open with O_RDWR|O_TRUNC and the st_size should equal zero");
+ fd=open(TEST_FILE,O_RDWR|O_TRUNC);
+ rtems_test_assert(fd>0);
+
+ status=fstat(fd,&stat);
+ rtems_test_assert(status==0);
+ rtems_test_assert(stat.st_size==0);
+
+ status=close(fd);
+ rtems_test_assert(status==0);
+}
+/*
+ * Test the umask, ctime in the file.
+ * Test the ctime and mtime in the dir.
+ */
+void open_test02()
+{
+
+
+ mode_t before;
+ struct stat statbuf;
+ int status = 0;
+ int fd;
+ time_t ctime1,dctime1,dmtime1;
+ time_t ctime2,dctime2,dmtime2;
+ char *path_name="dir";
+ char *name0 ="test0";
+ char *name1 ="test1";
+
+ status=mkdir(path_name,0755);
+ rtems_test_assert(status==0);
+
+ status=chdir(path_name);
+ rtems_test_assert(status==0);
+
+ status=stat(".",&statbuf);
+ rtems_test_assert(status==0);
+ dctime1=statbuf.st_ctime;
+ dmtime1=statbuf.st_mtime;
+
+ mode_t tmp_mode,t_mode,mode=S_IRWXU|S_IRWXG|S_IRWXO ;
+ puts("create a file with S_IRWXU|S_IRWXG|S_IRWXO ");
+
+ fd= open(name0,O_RDWR | O_CREAT ,mode);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ printf("the arg is %04o and the actual mode is %04o \n",mode,tmp_mode);
+
+ ctime1=statbuf.st_ctime;
+
+ puts("set umask and open a file");
+ before=umask(033);
+ printf("the previous cmask is 0%o\n",before);
+ printf("the current cmask is 0%o\n",033);
+
+ t_mode=mode&~before;
+
+#if !defined(MRFS_TEST) && !defined(MDOSFS_TEST)
+ rtems_test_assert(t_mode==tmp_mode);
+#endif
+
+
+ puts("sleep a few senconds");
+ sleep(TIME_PRECISION);
+
+ puts("create a file with S_IRWXU|S_IRWXG|S_IRWXO ");
+ fd= open(name1,O_RDWR | O_CREAT ,mode);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ printf("the arg is %04o and the actual mode is %04o \n",mode,tmp_mode);
+ t_mode=mode&~033;
+
+#if !defined(MRFS_TEST)&& !defined(MDOSFS_TEST)
+ rtems_test_assert(t_mode==tmp_mode);
+#endif
+
+
+ ctime2=statbuf.st_ctime;
+
+ status=stat(".",&statbuf);
+ rtems_test_assert(status==0);
+ dctime2=statbuf.st_ctime;
+ dmtime2=statbuf.st_mtime;
+
+ rtems_test_assert(!time_equal(ctime1,ctime2));
+#if !defined(__rtems__)
+ rtems_test_assert(!time_equal(dctime1,dctime2));
+ rtems_test_assert(!time_equal(dmtime1,dmtime2));
+#endif
+
+ status==chdir("..");
+ rtems_test_assert(status==0);
+
+}
+/*
+ * Test chmod in created file.
+ * Limted privilege test.
+ *
+ */
+void open_test03(void)
+{
+
+ struct stat statbuf;
+ int status = 0;
+ int fd;
+ char *name0 ="test0";
+ char *name1 ="test1";
+ char *path="test_dir";
+ char *buf="hello hello ";
+ int len=strlen(buf);
+ int n;
+ char c;
+
+
+ mode_t tmp_mode;
+
+
+ puts("Set the umask as 0000");
+
+ printf("the process uid is %d, gid is %d\n",getuid(),getgid());
+
+ umask(0000);
+ status=mkdir(path,S_IRWXU|S_IRWXG|S_IRWXO );
+
+ status=chdir(path);
+
+ rtems_test_assert(status==0);
+
+ status=seteuid(1000);
+ rtems_test_assert(status==0);
+
+ printf("the process uid is %d, gid is %d\n",getuid(),getgid());
+ puts("Open file0 with O_RDWR |O_CREAT ");
+ fd= open (name0, O_RDWR | O_CREAT ,S_IRWXU|S_IRWXG|S_IRWXO );
+ rtems_test_assert(fd!=-1);
+ n=write(fd,buf,len);
+ rtems_test_assert(n==len);
+ status=close(fd);
+ rtems_test_assert(status==0);
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ printf("the actual mode is 0%o \n",tmp_mode);
+
+ puts("Open file1 with O_RDWR |O_CREAT ");
+ fd= open (name1, O_RDWR | O_CREAT ,0577 );
+ rtems_test_assert(fd!=-1);
+ n=write(fd,buf,len);
+ rtems_test_assert(n==len);
+ status=close(fd);
+ rtems_test_assert(status==0);
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+ printf("the actual mode is 0%o \n",tmp_mode);
+
+ puts("try to open file0 O_RDONLY");
+ fd= open (name0, O_RDONLY);
+ rtems_test_assert(fd!=-1);
+ n=read(fd,&c,1);
+ rtems_test_assert(n==1);
+ rtems_test_assert(c==buf[0]);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ puts("try to open file0 O_WRONLY");
+ fd=open(name0,O_WRONLY);
+ rtems_test_assert(fd!=-1);
+ n=write(fd,&c,1);
+ rtems_test_assert(n==1);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ puts("chmod 0300 file0");
+ status=chmod(name0,0300);
+ rtems_test_assert(status==0);
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+
+ printf("the file actual mode is 0%o \n",tmp_mode);
+ printf("the file uid is %d, gid is %d\n",statbuf.st_uid,statbuf.st_gid);
+
+ puts("try to open file0 O_RDONLY");
+ fd= open (name0, O_RDONLY);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==EACCES);
+
+ puts("try to open file0 O_WRONLY");
+ fd=open(name0,O_WRONLY);
+ rtems_test_assert(fd!=-1);
+ n=write(fd,&c,1);
+ rtems_test_assert(n==1);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+
+ printf("the actual mode is 0%o \n",tmp_mode);
+ printf("the file uid is %u, gid is %u\n",statbuf.st_uid,statbuf.st_gid);
+
+ /*
+ * This fails in Linux
+ */
+ status=seteuid(1001);
+ rtems_test_assert(status==0);
+
+ puts("Change euid to 1001");
+
+
+ puts("try to open file0 O_RDONLY");
+ fd= open (name0, O_RDONLY);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==EACCES);
+ puts("try to open file0 O_WRONLY");
+ fd=open(name0,O_WRONLY);
+ rtems_test_assert(fd==-1);
+ rtems_test_assert(errno==EACCES);
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ tmp_mode=(statbuf.st_mode)&ALLPERMS;
+
+ status=seteuid(0);
+ rtems_test_assert(status==0);
+}
+
+
+void test(void )
+{
+ puts( "\n\n*** OPEN TEST ***" );
+ open_test01();
+ /*
+ * DOSFS doesn't run test02 and test03
+ * RFS does't run test03
+ */
+#if defined(MDOSFS_TEST)
+#else
+ open_test02();
+#endif
+
+#if defined(MDOSFS_TEST) || defined(MRFS_TEST)
+#else
+ open_test03();
+#endif
+ puts( "*** END OF OPEN TEST ***" );
+}
diff -u /dev/null rtems/testsuites/fstests/fsrdwrv/fsrdwrv.doc:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsrdwrv/fsrdwrv.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,25 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsrdwrv
+
+directives:
+
+ readv
+ writev
+
+concepts:
+ Exercise the basic function and error test.
+
+
+
diff -u /dev/null rtems/testsuites/fstests/fsrdwrv/test.c:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsrdwrv/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,414 @@
+/*
+ * This test exercises the following routines:
+ *
+ * + readv
+ * + writev
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <utime.h>
+#include <string.h>
+#include <inttypes.h>
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/uio.h>
+
+#include "fstest.h"
+
+#if defined(__rtems__)
+ #include <rtems.h>
+ #include <rtems/libio.h>
+ #include <pmacros.h>
+#else
+ #define TRUE 1
+ #define FALSE 0
+ #include <stdlib.h>
+ #define rtems_test_exit(_s) exit(_s)
+#endif
+
+#define TESTFILE "testfile1.tst"
+
+
+
+/* This buffer size is assumed in the iovec initialization below */
+#define MAX_BUFFER 1000
+unsigned char PatternBuffer[MAX_BUFFER];
+unsigned char ReadBuffer[MAX_BUFFER];
+
+/*
+ * fillPatternBuffer function
+ *
+ * Fill the test buffer.
+ *
+ * Returns: TRUE if buffer filled
+ * FALSE if buffer failed to fill
+ *
+ */
+
+int fillPatternBuffer(void)
+{
+ int retval = TRUE;
+ int i;
+
+ for (i=0 ; i<200 ; i++ ) PatternBuffer[i] = 'a';
+ for ( ; i<400 ; i++ ) PatternBuffer[i] = 'b';
+ for ( ; i<600 ; i++ ) PatternBuffer[i] = 'c';
+ for ( ; i<800 ; i++ ) PatternBuffer[i] = 'd';
+ for ( ; i<1000 ; i++ ) PatternBuffer[i] = 'e';
+ return retval;
+}
+
+/*
+ * doFunctionalTest function
+ *
+ * Write a file with writev and then read it back with readv.
+ *
+ * Returns: TRUE if all operations worked as expected
+ * FALSE if an operation did not work as expected.
+ *
+ */
+
+int doFunctionalTest(void) {
+ FILE *fp;
+ int fd;
+ struct iovec rdvec[4];
+ struct iovec wrvec[4];
+ int rc;
+
+
+ /*
+ * Setup the iovec
+ */
+ wrvec[0].iov_base = &PatternBuffer[0];
+ wrvec[0].iov_len = 100;
+ wrvec[1].iov_base = &PatternBuffer[100];
+ wrvec[1].iov_len = 200;
+ wrvec[2].iov_base = &PatternBuffer[300];
+ wrvec[2].iov_len = 300;
+ wrvec[3].iov_base = &PatternBuffer[600];
+ wrvec[3].iov_len = 400;
+
+ rdvec[0].iov_base = &ReadBuffer[0];
+ rdvec[0].iov_len = 400;
+ rdvec[1].iov_base = &ReadBuffer[400];
+ rdvec[1].iov_len = 300;
+ rdvec[2].iov_base = &ReadBuffer[700];
+ rdvec[2].iov_len = 200;
+ rdvec[3].iov_base = &ReadBuffer[900];
+ rdvec[3].iov_len = 100;
+
+ /*
+ * Write the File
+ */
+ fp = fopen(TESTFILE, "wt");
+ if ( fp == NULL ) {
+ printf( "fopen for write: %d=%s\n", errno, strerror(errno));
+ return FALSE;
+ }
+ fd = fileno(fp);
+
+ rc = writev(fd, wrvec, 4);
+ if ( rc <= 0 ) {
+ printf( "writev: %d=%s\n", errno, strerror(errno) );
+ return FALSE;
+ }
+
+ fclose(fp);
+
+ puts("File written using writev .. OK");
+
+ /*
+ * Now read it back and check it
+ */
+
+ fp = fopen(TESTFILE, "rt");
+ if ( fp == NULL ) {
+ printf( "fopen for write: %d=%s\n", errno, strerror(errno));
+ return FALSE;
+ }
+ fd = fileno(fp);
+
+ rc = readv(fd, rdvec, 4);
+ if ( rc <= 0 ) {
+ printf( "rd: %d=%s\n", errno, strerror(errno) );
+ return FALSE;
+ }
+
+ if ( memcmp( PatternBuffer, ReadBuffer, MAX_BUFFER ) ) {
+ puts("readv .. Buffers do not match");
+ return FALSE;
+ }
+
+ puts("File read using readv .. OK");
+ rc= fclose(fp);
+ rtems_test_assert(rc==0);
+
+
+ return TRUE;
+}
+
+/*
+ * doErrorTest function
+ *
+ * Hit all the error cases in readv/writev.
+ *
+ * Returns: TRUE if all operations worked as expected
+ * FALSE if an operation did not work as expected.
+ *
+ */
+
+int doErrorTest(void)
+{
+ FILE *fp;
+ int fd;
+ struct iovec vec[4];
+ int rc;
+
+ /*
+ * Open and close the file to get a bad file descriptor
+ */
+ fp = fopen(TESTFILE, "wt");
+ if ( fp == NULL ) {
+ printf( "fopen for error 1: %d=%s\n", errno, strerror(errno));
+ return FALSE;
+ }
+ fd = fileno(fp);
+ fclose(fp);
+
+ /* writev -- bad file descriptor */
+ puts("writev bad file descriptor -- EBADF");
+ rc = writev(fd, vec, 4);
+ if ( (rc != -1) || (errno != EBADF) ) {
+ printf( "writev error 1: %d=%s\n", errno, strerror(errno) );
+ return FALSE;
+ }
+
+ /* readv -- bad file descriptor */
+ puts("readv bad file descriptor -- EBADF");
+ rc = read(fd, vec, 4);
+ if ( (rc != -1) || (errno != EBADF) ) {
+ printf( "readv error 1: %d=%s\n", errno, strerror(errno) );
+ return FALSE;
+ }
+
+ /*
+ * Open the file for the rest of the tests
+ */
+ fp = fopen(TESTFILE, "w+");
+ if ( fp == NULL ) {
+ printf( "fopen for error 2: %d=%s\n", errno, strerror(errno));
+ return FALSE;
+ }
+ fd = fileno(fp);
+
+ /* writev -- bad iovec pointer */
+ puts("writev bad iovec pointer -- EINVAL");
+ rc = writev(fd, NULL, 4);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "writev error 2: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* readv -- bad iovec pointer */
+ puts("readv bad iovec pointer -- EINVAL");
+ rc = readv(fd, NULL, 4);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "readv error 2: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* writev -- bad iovcnt 0 */
+ puts("readv bad iovcnt of 0 -- EINVAL");
+ rc = writev(fd, vec, 0);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "writev error 3: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* readv -- bad iovcnt 0 */
+ puts("readv bad iovcnt of 0 -- EINVAL");
+ rc = readv(fd, vec, 0);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "readv error 3: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* writev -- bad iovcnt negative */
+ puts("writev bad iovcnt negative -- EINVAL");
+ rc = writev(fd, vec, -2);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "writev error 4: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* readv -- bad iovcnt negative */
+ puts("readv bad iovcnt negative -- EINVAL");
+ rc = readv(fd, vec, -100);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "readv error 4: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* writev -- bad iov[i].iov_base */
+ vec[0].iov_base = vec;
+ vec[0].iov_len = 100;
+ vec[1].iov_base = NULL;
+ vec[1].iov_len = 100;
+ puts("writev bad iov[i].iov_base -- EINVAL");
+ rc = writev(fd, vec, 2);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "writev error 5: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* readv -- bad iov[i].iov_base */
+ vec[0].iov_base = vec;
+ vec[0].iov_len = 100;
+ vec[1].iov_base = NULL;
+ vec[1].iov_len = 100;
+ puts("readv bad iov[i].iov_base -- EINVAL");
+ rc = readv(fd, vec, 2);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "readv error 5: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* writev -- bad iov[i].iov_len < 0 */
+ vec[0].iov_base = vec;
+ vec[0].iov_len = 100;
+ vec[1].iov_base = vec;
+ vec[1].iov_len = -10;
+ puts("writev bad iov[i].iov_len < 0 -- EINVAL");
+ rc = writev(fd, vec, 2);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "writev error 6: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* readv -- bad iov[i].iov_len = 0 */
+ vec[0].iov_base = vec;
+ vec[0].iov_len = 100;
+ vec[1].iov_base = vec;
+ vec[1].iov_len = -1024;
+ puts("readv bad iov[i].iov_len = 0 -- EINVAL");
+ rc = readv(fd, vec, 2);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "readv error 6: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* writev -- iov_len total overflows */
+ vec[0].iov_base = vec;
+ vec[0].iov_len = SIZE_MAX;
+ vec[1].iov_base = vec;
+ vec[1].iov_len = SIZE_MAX;
+ vec[2].iov_base = vec;
+ vec[2].iov_len = SIZE_MAX;
+ puts("writev iov_len total overflows -- EINVAL");
+ rc = writev(fd, vec, 3);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "writev error 7: rc=%d %d=%s\n", rc, errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* readv -- iov_len total overflows */
+ vec[0].iov_base = vec;
+ vec[0].iov_len = SIZE_MAX;
+ vec[1].iov_base = vec;
+ vec[1].iov_len = SIZE_MAX;
+ puts("readv iov_len total overflows -- EINVAL");
+ rc = readv(fd, vec, 2);
+ if ( (rc != -1) || (errno != EINVAL) ) {
+ printf( "read error 7: rc=%d %d=%s\n", rc, errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* writev -- all zero length buffers */
+ vec[0].iov_base = vec;
+ vec[0].iov_len = 0;
+ vec[1].iov_base = vec;
+ vec[1].iov_len = 0;
+ puts("writev iov_len works with no effect -- OK");
+ rc = writev(fd, vec, 2);
+ if ( (rc != 0) ) {
+ printf( "writev error 8: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ /* readv -- all zero length buffers */
+ vec[0].iov_base = vec;
+ vec[0].iov_len = 0;
+ vec[1].iov_base = vec;
+ vec[1].iov_len = 0;
+ puts("readv iov_len works with no effect -- OK");
+ rc = readv(fd, vec, 2);
+ if ( (rc != 0) ) {
+ printf( "readv error 8: %d=%s\n", errno, strerror(errno) );
+ fclose(fp);
+ return FALSE;
+ }
+
+ fclose(fp);
+ close(fd);
+ return TRUE;
+}
+
+
+/* ---------------------------------------------------------------
+ * Main function
+ *
+ * main entry point to the test
+ *
+ * ---------------------------------------------------------------
+ */
+void test(void )
+{
+ puts( "*** POSIX TEST READV/WRITEV ***" );
+
+ if ( fillPatternBuffer() != TRUE ) {
+ puts("Error filling pattern buffer" );
+ rtems_test_exit(0);
+ }
+
+ if (doErrorTest() != TRUE) {
+ puts("Error during error test!!!!");
+ rtems_test_exit(0);
+ }
+ if (doFunctionalTest() != TRUE) {
+ puts("Error during functional test!!!!");
+ rtems_test_exit(0);
+ }
+
+ unlink(TESTFILE);
+ puts( "*** END OF TEST PSXRDWRV ***" );
+}
diff -u /dev/null rtems/testsuites/fstests/fsreaddir/fsreaddir.doc:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsreaddir/fsreaddir.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,26 @@
+
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2009.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsreaddir
+
+ + closedir() -
+ + readdir() -
+ + scandir() -
+ + opendir() -
+ + rewinddir() -
+ + telldir() - BSD not in POSIX
+ + seekdir() - BSD not in POSIX
+
+concepts:
+ + This is a native test to explore how the readdir() family works.
diff -u /dev/null rtems/testsuites/fstests/fsreaddir/test.c:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsreaddir/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,473 @@
+/*
+ * This is a native test to explore how the readdir() family works.
+ * Newlib supports the following readdir() family members:
+ *
+ * closedir() -
+ * readdir() -
+ * scandir() -
+ * opendir() -
+ * rewinddir() -
+ * telldir() - BSD not in POSIX
+ * seekdir() - BSD not in POSIX
+ *
+ *
+ * seekdir() takes an offset which is a byte offset. The Linux
+ * implementation of this appears to seek to the ((off/DIRENT_SIZE) + 1)
+ * record where DIRENT_SIZE seems to be 12 bytes.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdint.h>
+#include <dirent.h>
+
+#include "fstest.h"
+
+DIR *directory;
+DIR *directory2;
+DIR *directory3;
+DIR *directory_not;
+
+/*
+ int scandir ( const char *dirname,
+ struct dirent *** namelist,
+ int (*select) __P((struct dirent *)),
+ int (*dcomp) __P((const struct dirent **, const struct dirent **))
+ );
+ */
+
+#if defined(__rtems__)
+#define d_type d_reclen
+#endif
+
+void printdir( DIR *directory )
+{
+ struct dirent *d;
+
+ printf( "%-20s %8s %8s %8s %4s\n",
+ "name", " inode", " offset", "reclen", " type" );
+ d = readdir(directory);
+
+ while (d) {
+ printf( "%-20s %8d %8d %6d 0x%04x\n",
+ d->d_name, (int)d->d_ino, (int)d->d_off, d->d_reclen, d->d_type );
+ d = readdir(directory);
+
+ }
+}
+
+void complete_printdir( char *path )
+{
+ DIR *the_dir;
+ int status;
+
+ the_dir = opendir( path );
+ rtems_test_assert( the_dir );
+ printdir( the_dir );
+ status = closedir( the_dir );
+ rtems_test_assert( !status );
+}
+
+char *many_files[] = {
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "aa",
+ "ab",
+ "ac",
+ "ad",
+ "ae",
+ "af",
+ "ag",
+ "ah",
+ "ai",
+ "aj",
+ "ak",
+ "al",
+ "am",
+ "an",
+ "ao",
+ "ap",
+ "aq",
+ "ar"
+};
+
+char *dnames[] = {
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "c/y",
+ "c/z",
+ "c/x",
+ "c/y/a3333",
+ "c/y/j123",
+ "END"
+};
+
+int select1 (const struct dirent *entry )
+{
+ printf("SCANDIR SELECT1 accepts nodename: %s\n", entry->d_name );
+ return 1;
+}
+
+int select2 (const struct dirent *entry )
+{
+ if( strcmp( entry->d_name, "y") == 0 ) {
+ printf("SCANDIR SELECT accepted nodename: %s\n", entry->d_name );
+ return 1;
+ }
+ printf("SCANDIR SELECT rejected nodename: %s\n", entry->d_name );
+ return 0;
+}
+
+int compare_ascending(const struct dirent **a, const struct dirent **b )
+{
+ int i;
+
+ i = strcmp (
+ (char *)((struct dirent *)(*a)->d_name),
+ (char *)((struct dirent *)(*b)->d_name)
+ );
+ return i;
+}
+
+
+int compare_descending( const struct dirent **a, const struct dirent **b )
+{
+ int i;
+
+ i = strcmp (
+ (char *)((const struct dirent *)(*b)->d_name),
+ (char *)((const struct dirent *)(*a)->d_name)
+ );
+
+ return i;
+}
+
+int test_main(void)
+{
+ int fd;
+ int i;
+ int status;
+ off_t off;
+ struct dirent *d_not;
+ struct dirent **namelist;
+ struct stat s;
+
+
+ printf( "\n\n*** READDIR TEST ***\n" );
+
+ printf( "\nchdir to the root directory\n" );
+ status = chdir( "/" );
+ printf( "chdir() status : %d\n\n", status );
+
+ printf( "\nCreating a series of directories under /\n" );
+ i=0;
+ while ( strcmp(dnames[i], "END") != 0 )
+ {
+ status = mkdir( dnames[i], 0x1c0 );
+ printf("Creating directory: %s %d %d ", dnames[i], status, errno );
+ if ( errno == 0 )
+ printf(" Success\n");
+ else
+ printf(" Failure\n");
+
+ i++;
+ }
+
+ /*
+ * Create files under many and open the directory.
+ */
+
+ printf("Create a lot of files\n");
+ status = mkdir( "/many", 0x1c0 );
+ status = chdir( "/many" );
+ for (i = 0; i<44; i++) {
+ printf("Create %s\n", many_files[i]);
+ fd = open (many_files[i], O_CREAT, S_IRWXU);
+ close (fd);
+ }
+ printf("Open /many and print the directory\n");
+ directory_not = opendir( "/many" );
+ printdir ( directory_not );
+ d_not = readdir( directory_not );
+ rtems_test_assert( d_not == 0 );
+ status=closedir(directory_not);
+ rtems_test_assert(status==0);
+
+ printf("open /b/myfile\n");
+ fd = open ("/b/my_file", O_CREAT, S_IRWXU);
+ rtems_test_assert( fd != -1 );
+ close (fd);
+
+ printf("scandir a file status: ");
+ status = scandir(
+ "/b/my_file",
+ &namelist,
+ select1,
+ NULL
+ );
+ printf("%d\n", status);
+
+ printf("Open /b/new_file\n");
+ fd = open( "/b/new_file", O_CREAT, S_IRWXU );
+ rtems_test_assert( fd != -1 );
+
+ printf("fcntl F_SETFD should return 0\n");
+ status = fcntl( fd, F_SETFD, 1 );
+ rtems_test_assert( status == 0 );
+
+ printf("fcntl F_SETFD should return 1\n");
+ status = fcntl( fd, F_GETFD, 1 );
+ rtems_test_assert( status == 1 );
+
+#if 0
+ printf("fcntl F_DUPFD should return 0\n");
+ status = fcntl( fd, F_DUPFD, 0 );
+ rtems_test_assert ( status == 0 );
+#else
+ printf("fcntl F_DUPFD should return 0 -- skip until implemented\n");
+#endif
+
+ printf("fcntl F_GETFL returns current flags\n");
+ status = fcntl( fd, F_GETFL, 1 );
+ printf("fcntl F_GETFL returned 0x%x\n", status );
+ rtems_test_assert( status != -1 );
+
+ printf("fcntl F_SETFL to add O_APPEND and O_NONBLOCK\n");
+ status = fcntl( fd, F_SETFL, O_APPEND|O_NONBLOCK );
+ rtems_test_assert ( status != -1 );
+
+ printf("fcntl F_GETFL return current flags to see changes\n");
+ status = fcntl( fd, F_GETFL, 1 );
+ printf("fcntl F_GETFL returned 0x%x\n", status );
+ rtems_test_assert( status != -1 );
+
+ printf("fcntl F_GETLK should return -1\n");
+ status = fcntl( fd, F_GETLK, 1 );
+ rtems_test_assert ( status == -1 );
+
+ printf("fcntl F_SETLK should return -1\n");
+ status = fcntl( fd, F_SETLK, 1 );
+ rtems_test_assert ( status == -1 );
+
+ printf("fcntl F_SETLKW should return -1\n");
+ status = fcntl( fd, F_SETLKW, 1 );
+ rtems_test_assert ( status == -1 );
+
+ printf("fcntl F_SETOWN should return -1\n");
+ status = fcntl( fd, F_SETOWN, 1 );
+ rtems_test_assert ( status == -1 );
+
+ printf("fcntl F_GETOWN should return -1\n");
+ status = fcntl( fd, F_GETOWN, 1 );
+ rtems_test_assert ( status == -1 );
+
+ printf("fcntl invalid argument should return -1\n");
+ status = fcntl( fd, 0xb, 1 );
+ printf("Status %d\n",status);
+ rtems_test_assert( status == -1 );
+
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ printf("opendir and readdir /b/myfile\n");
+ directory_not = opendir ("/b/my_file");
+ d_not = readdir(directory_not);
+ status=closedir(directory_not);
+ rtems_test_assert (status == 0);
+
+ printf("opendir and readdir\n");
+ directory_not = opendir ("/a");
+ d_not = readdir (directory_not);
+ status=closedir(directory_not);
+ rtems_test_assert (status == 0);
+
+ printf("chdir to /b/myfile\n");
+ status = chdir ("/b/my_file");
+ rtems_test_assert (status == -1);
+
+ printf( "\nPerforming stat of directory /\n");
+ status = stat( "/", &s );
+ printf("status for stat : %d, size of directory: %jd \n\n", status,(intmax_t) s.st_size);
+
+ puts( "\nOpen and print directory /" );
+ directory = opendir("/");
+ rtems_test_assert( directory );
+ printdir(directory);
+
+ printf("\nmkdir /d/my_dir\n");
+ status = mkdir( "/d/my_dir", 0x1c0 );
+ printf("Open /d/my_dir\n");
+ directory_not = opendir( "/d/my_dir" );
+ rtems_test_assert( directory_not );
+
+
+ printf( "close /d/my_dir.\n" );
+ closedir( directory_not );
+
+ printf( "remove /d/my_dir.\n" );
+ status = rmdir( "/d/my_dir" );
+ rtems_test_assert( status == 0 );
+
+ printf( "\nOpening directory /c\n" );
+ directory2 = opendir("/c");
+
+ rtems_test_assert( directory2 );
+
+ printdir(directory2);
+ status = closedir( directory2 );
+
+ printf( "\nOpening directory /c/y\n" );
+ directory3 = opendir("/c/y");
+ rtems_test_assert( directory3 );
+ printdir(directory3);
+ status = closedir( directory3 );
+
+ printf( "\nLSEEK to the start of the open directory\n" );
+ lseek( directory->dd_fd, 0, SEEK_SET );
+ printdir(directory);
+
+ lseek( directory->dd_fd, 0, SEEK_CUR );
+
+ lseek( directory->dd_fd, 0, SEEK_END );
+
+ lseek( directory->dd_fd, 0, -99 );
+
+ printf( "\nRewinding directory\n" );
+ rewinddir( directory );
+ printdir(directory);
+
+#if 0
+ /* Newlib's implementation does not check for NULL */
+ printf( "Send rewinddir a NULL pointer\n");
+ rewinddir( NULL );
+#endif
+
+ printf( "\nSeek directory\n" );
+ printf( "telldir() should report only sizeof(struct dirent) increments \n" );
+ printf( "in position. Sizeof(struct dirent): %ld\n",
+ (unsigned long) sizeof(struct dirent) );
+ rewinddir( directory );
+ for( off=0 ; off<=200 ; off=off + sizeof(struct dirent) / 4 ) {
+ seekdir( directory, off );
+ printf(
+ "seeked to %2d -- currently at %2d\n",
+ (int)off,
+ (int)telldir(directory)
+ );
+ }
+
+ printf( "Send seekdir a NULL pointer\n");
+ seekdir( NULL, off );
+
+ printf( "\nClosing directory\n" );
+ status = closedir( directory );
+
+ printf( "\nSCANDIR TEST\n");
+ printf( "\nselection rule 1\n");
+ printf( "scanning for any entry under directory /c\n\n");
+ status = scandir(
+ "/c",
+ &namelist,
+ select1,
+ NULL
+ );
+ printf("\nscandir status: %d\n", status );
+ for ( i=0; i<status; i++)
+ {
+ printf("Selected Node Name: %s\n", namelist[i]->d_name );
+ }
+
+ printf( "\nselection rule 2\n");
+ printf( "scanning for any entry under directory /c whose name = y\n\n");
+ status = scandir(
+ "/c",
+ &namelist,
+ select2,
+ NULL
+ );
+ printf("\nscandir status: %d\n", status );
+ for ( i=0; i<status; i++)
+ {
+ printf("Selected Node Name: %s\n", namelist[i]->d_name );
+ }
+
+ printf( "\nSCANDIR with sorting\n" );
+ printf( "\nselection rule 1\n");
+ printf( "scanning for any entry under directory /c\n");
+ printf( "sort in ascending order\n\n");
+ status = scandir(
+ "/c",
+ &namelist,
+ select1,
+ compare_ascending
+ );
+ printf("\nscandir status: %d\n", status );
+ for ( i=0; i<status; i++)
+ {
+ printf("Selected and Sorted Node Name: %s\n", namelist[i]->d_name );
+ }
+
+
+ printf( "\nSCANDIR with sorting\n" );
+ printf( "\nselection rule 1\n");
+ printf( "scanning for any entry under directory /c\n");
+ printf( "sort in descending order\n\n");
+ status = scandir(
+ "/c",
+ &namelist,
+ select1,
+ compare_descending
+ );
+ printf("scandir status: %d\n", status );
+ for ( i=0; i<status; i++)
+ {
+ printf("Selected and Sorted Node Name: %s\n", namelist[i]->d_name );
+ }
+
+ printf( "\n\n*** END OF READDIR TEST ***\n" );
+}
+void test(void )
+{
+ test_main();
+}
diff -u /dev/null rtems/testsuites/fstests/fsrename/fsrename.doc:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsrename/fsrename.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,23 @@
+
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsrename
+
+directives:
+
+ + rename
+
+concepts:
+
+ + Test the basic function of the directive and some error test.
diff -u /dev/null rtems/testsuites/fstests/fsrename/test.c:1.1
--- /dev/null Mon Aug 1 10:11:43 2011
+++ rtems/testsuites/fstests/fsrename/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,150 @@
+
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+
+#include "fstest.h"
+/*
+ * test the function of the rename
+ */
+void rename_test01()
+{
+ char* name0="test0";
+ char* name1="test1";
+ int fd;
+ struct stat statbuf;
+ int status;
+
+ fd=creat(name0,0644);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+
+ puts("rename a file to a new one");
+ status=rename(name0,name1);
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOENT);
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status!=0);
+
+
+ status=unlink(name0);
+ rtems_test_assert(status!=0);
+ status=unlink(name1);
+ rtems_test_assert(status==0);
+
+ status=mkdir(name0,755);
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISDIR(statbuf.st_mode));
+ puts("rename a dir to a new one");
+ status=rename(name0,name1);
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOENT);
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISDIR(statbuf.st_mode));
+
+
+
+}
+
+
+/*
+ *error test
+ */
+void rename_test02()
+{
+ char* path_name0="dir0";
+ char* path_name1="dir0/dir1";
+ char* path_name2="dir2";
+ char* name0="name0";
+ char* name1="name1";
+ int fd;
+ int status;
+ struct stat statbuf;
+
+ status=mkdir (path_name0,0755);
+ rtems_test_assert(status==0);
+
+ status=mkdir (path_name1,0755);
+ rtems_test_assert(status==0);
+
+ /*
+ *the new directory pathname contains a path
+ * prefix that names the old directory
+ * Should fail with EINVAL
+ */
+ status=rename(path_name0,path_name1);
+ rtems_test_assert(status!=0);
+#if !defined(__rtems__)
+ rtems_test_assert(errno==EINVAL);
+#endif
+
+ fd=creat(name0,0777);
+ status=close(fd);
+
+ fd=creat(name1,0777);
+ status=close(fd);
+
+ puts("rename a file to an existing file");
+ status=rename(name0,name1);
+#if !defined(__rtems__)
+ rtems_test_assert(status==0);
+#endif
+ status=mkdir (path_name2,0755);
+ rtems_test_assert(status==0);
+
+
+ puts("rename a dir to a non-empty dir Should fail with ENOTEMPTY");
+ status=rename(path_name2,path_name0);
+ rtems_test_assert(status!=0);
+#if !defined(__rtems__)
+ rtems_test_assert(errno==ENOTEMPTY);
+#endif
+
+ puts("rename a file to a dir Should fail with EISDIR");
+ status=rename(name1,path_name0);
+ rtems_test_assert(status!=0);
+#if !defined(__rtems__)
+ rtems_test_assert(errno==EISDIR);
+#endif
+
+ puts("rename non-existing file Should fail with ENOENT");
+ status=rename(name0,name1);
+ rtems_test_assert(status!=0);
+#if !defined(__rtems__)
+ rtems_test_assert(errno==ENOENT);
+#endif
+}
+
+void test()
+{
+ rename_test01();
+ rename_test02();
+
+}
diff -u /dev/null rtems/testsuites/fstests/fsrmdir/test.c:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fsrmdir/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,133 @@
+#include <dirent.h>
+#include <sys/stat.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "fstest.h"
+
+/*
+ * test function of the rmdir
+ */
+void rmdir_test01(void )
+{
+ puts("start");
+ char* path="test_path";
+ char* path01="test_path/t";
+ int status;
+
+ struct stat statbuf;
+
+ status=mkdir(path,0777);
+ rtems_test_assert(status==0);
+
+ status=mkdir(path01,0777);
+ rtems_test_assert(status==0);
+
+ status=stat(path01,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISDIR(statbuf.st_mode));
+
+ status=stat(path,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISDIR(statbuf.st_mode));
+
+
+ status=rmdir(path01);
+
+ status=stat(path01,&statbuf);
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOENT);
+
+ status=rmdir(path);
+
+ status=stat(path01,&statbuf);
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOENT);
+
+}
+/*
+ *test error
+ */
+
+void rmdir_test02(void )
+{
+ char* path="test_path";
+ char* path01="test_path/t";
+ int status;
+ puts("rmdir \"\"");
+#if !defined (IMFS_TEST) && !defined(MIMFS_TEST)
+ status=rmdir("");
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOENT);
+#endif
+
+ puts("rmdir NULL");
+#if !defined (IMFS_TEST) && !defined(MIMFS_TEST)
+ status=rmdir(0);
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOENT);
+#endif
+ status=rmdir(path);
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOENT);
+
+ status=mkdir(path,0777);
+ rtems_test_assert(status==0);
+
+ status=mkdir(path01,0777);
+ rtems_test_assert(status==0);
+
+ puts("remove a none empty dir");
+ status=rmdir(path);
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOTEMPTY);
+
+ puts("rmdir .");
+ status=rmdir(".");
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOTEMPTY);
+
+
+ puts("rmdir ..");
+ status=rmdir("..");
+ rtems_test_assert(status!=0);
+ rtems_test_assert(errno=ENOTEMPTY);
+
+}
+
+
+void rmdir_test03 (void )
+{
+ int pfd;
+ DIR *directory;
+ int status;
+
+ puts("rmdir before closedir");
+
+ status=mkdir("test",0777);
+ rtems_test_assert(status==0);
+ pfd = open("test/ttt", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ directory=opendir( "test");
+ rtems_test_assert(directory!=NULL);
+ close(pfd);
+ status=unlink("test/ttt");
+ rtems_test_assert(status==0);
+
+ status=rmdir( "test" );
+#if !defined(MDOSFS_TEST)
+ rtems_test_assert(status==0);
+#endif
+
+ status=closedir(directory);
+ rtems_test_assert(status==0);
+}
+void test(void )
+{
+ puts( "\n\n*** RMDIR TEST ***" );
+ rmdir_test01();
+ rmdir_test02();
+ rmdir_test03();
+ puts( "*** END OF TRUNCATE TEST ***" );
+}
diff -u /dev/null rtems/testsuites/fstests/fsrwfile/fsrwfile.doc:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fsrwfile/fsrwfile.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,23 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fsrwfile
+
+directives:
+
++ read
++ write
+
+concepts:
+
++ Simlpe read and write test.
diff -u /dev/null rtems/testsuites/fstests/fsrwfile/init.c:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fsrwfile/init.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,83 @@
+/*
+ *
+ * $Id$
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <unistd.h>
+
+#include "fstest.h"
+
+char *bufr = "Happy days are here again. Happy days are here again.1Happy "
+"days are here again.2Happy days are here again.3Happy days are here again."
+"4Happy days are here again.5Happy days are here again.6Happy days are here "
+"again.7Happy days are here again.";
+
+void test(void)
+{
+ int fd;
+ int i;
+ int n;
+ int rc;
+ int total_written;
+ int total_read;
+ char *bufr2;
+ size_t len = strlen(bufr);
+
+ puts( "\n\n*** SIMPLE READ/WRITE TEST ***" );
+
+
+ printf( "sizeof(buffer) = %d\n", len);
+ total_written = 0;
+
+ /*
+ * Create the file
+ */
+ puts( "Creating " "tester" );
+ fd = creat("tester", S_IRWXU | S_IRWXG | S_IRWXO);
+ rtems_test_assert( fd != -1 );
+
+ /*
+ * Write the file
+ */
+ printf( "Writing %d bytes to file\n", len * 10 );
+ for (i=0; i<10; i++) {
+ n = write(fd, bufr, len);
+ rtems_test_assert( n != -1 );
+ total_written += n;
+ }
+ printf("Successfully wrote %d\n", total_written);
+ rc = close(fd);
+ rtems_test_assert( rc == 0 );
+
+ /*
+ * Now read contents back and verify
+ */
+ total_read = 0;
+ bufr2 = (char *)malloc(len+1);
+ rtems_test_assert( bufr2 );
+
+ fd = open( "tester", O_RDONLY);
+ rtems_test_assert( fd != -1 );
+
+ while ((n=read(fd,bufr2,len)) > 0) {
+ total_read += n;
+ if ( strncmp( bufr, bufr2, len ) ) {
+ printf( "mismatch\\n" );
+ }
+ }
+ if ( total_written != total_read ) {
+ printf( "Not enough data read back\\n" );
+ }
+ printf("Successfully read: %d\n", total_read);
+ free(bufr2);
+ rc = close(fd);
+ rtems_test_assert( rc == 0 );
+
+ puts( "*** END OF SIMPLE READ/WRITE TEST ***" );
+}
diff -u /dev/null rtems/testsuites/fstests/fsstat/fsstat.doc:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fsstat/fsstat.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,34 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+test set name: fsstat
+
+directives:
+
++ stat
++ fstat
++ mkdir
++ link
++ symlink
++ lstat
++ lchown
++ statvfs
+
+
+concepts:
+ + This test exercises stat() via fstat() and generates as many of the
+ path evaluation cases as possible.
+
+ + This test also exercises lstat() and lchown() when symlinks are
+ involved.
+
+ + This test also include statvfs test.
diff -u /dev/null rtems/testsuites/fstests/fsstat/test.c:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fsstat/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,994 @@
+/*
+ * This test exercises stat() via fstat() and generates as many of the
+ * path evaluation cases as possible.
+ *
+ * This test also exercises lstat() and lchown() when symlinks are
+ * involved.
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <rtems.h>
+#include <rtems/libio.h>
+#include <rtems/imfs.h>
+
+
+#include "fstest.h"
+
+#define MAXSYMLINK 5 /* There needs to be a better way of getting this. */
+#define TIMEOUT_VALUE ( 5 * rtems_clock_get_ticks_per_second() )
+
+int _lstat_r(struct _reent *, const char *, struct stat *);
+
+/*
+ * List of files which should exist.
+ */
+
+char *Files[] = {
+#if !defined(MRFS_TEST) && !defined(MDOSFS_TEST)
+ "/////my_mount_point/dir1/\\//file1\\\\//",
+#else
+ "/my_mount_point/dir1/file1",
+#endif
+ "/my_mount_point/dir1/file2",
+ "/my_mount_point/dir1/file3",
+ "/my_mount_point/dir1/file4",
+ "/my_mount_point/dir1/dir1/file1",
+#if !defined(MRFS_TEST)
+ "../../..//my_mount_point/dir1/./././dir1/ file1",
+#else
+ "/my_mount_point/dir1/dir1/ file1",
+#endif
+ "main.c",
+ 0
+};
+
+/*
+ * List of directories which should exist.
+ */
+
+char *Directories[] = {
+ "/my_mount_point/dir1",
+ "/my_mount_point/dir2",
+ "/my_mount_point/dir3",
+ "/my_mount_point/dir4",
+ "/my_mount_point/dir1/dir1",
+ "/./././my_mount_point/dir1/ dir1",
+ "/./././my_mount_point/links",
+#if !defined(MRFS_TEST)
+ "///my_mount_point/dir1/dir1/../../dir1/../symlinks/////",
+#else
+ "/symlinks",
+#endif
+ 0
+};
+
+char *Links_to_Dirs[]= {
+#if !defined(MRFS_TEST)
+ "dir1/dir1/../../links/dir1",
+#else
+ "links/dir1",
+#endif
+ "links/dir2",
+ "links/dir3",
+ "links/dir4",
+ "links/dir1_dir1",
+ "links/dir1_ dir1",
+ "links/../links/../links/links",
+ 0
+};
+
+char *Links_to_Files[]= {
+ "links/dir1_file1",
+ "links/dir1_file2",
+ "links/dir1_file3",
+ "links/dir1_file4",
+ "links/dir1_dir1_f1",
+ "links/dir1_dir1 f1",
+ 0
+};
+
+char *Links_to_dirlinks[]= {
+ "links/links/links/links_dir1",
+ "links//links_dir2",
+ "links//links_dir3",
+ "links//links_dir4",
+ "links//links_dir1_d1",
+ "links//links_dir1 d1",
+ "links//links_links",
+ 0
+};
+
+char *Links_to_filelinks[]= {
+ "links///links_d1_file1",
+ "links///links_d1_file2",
+ "links///links_d1_file3",
+ "links///links_d1_file4",
+ "links///links_d1_d1_f1",
+ "links///links_r1_d1 f1",
+ 0
+};
+
+char *SymLinks[]= {
+ "/my_mount_point/symlinks/a_file_symlink",
+ "/my_mount_point/symlinks/a_dir_symlink",
+ "/my_mount_point/symlinks/a_link_symlink",
+ "../symlinks/no_file",
+ "/my_mount_point/symlinks/a_dir_symlink/a_file_symlink",
+ 0
+};
+
+/*
+ * List of absolute paths to stat.
+ */
+
+char *Good_absolute_paths[] = {
+ "/my_mount_point/dev",
+ "////my_mount_point/dir1/\\//file1\\\\//",
+ "/my_mount_point/dir1/\\\\/file2",
+ "/my_mount_point/dir1/file3/////\\\\\\",
+ "/my_mount_point/dir1/file4",
+ "/my_mount_point/dir1/dir1/file1",
+ "/my_mount_point/dir1/dir1/ file1",
+ "/my_mount_point/dir1",
+ "/my_mount_point/dir2//////\\",
+ "/my_mount_point/dir3",
+ "/my_mount_point/dir4",
+ "/my_mount_point/dir1/dir1",
+ "/my_mount_point/dir1/ dir1///\\\\",
+ "/my_mount_point/\\/\\/\\/\\/\\/\\/links\\/\\/\\/\\/\\/\\",
+ 0
+};
+
+
+char *Bad_paths[] = {
+ "/my_mount_point/links/ENAMETOOLONG__________________________",
+ "/my_mount_point/dir1/file4/NOTADIR",
+ "/my_mount_point/dir1/dir1/EACCES__",
+ 0
+};
+
+/*
+ * List of relative paths to stat.
+ */
+
+char *Good_relative_paths[] = {
+ "dev",
+ "dir1/\\//file1\\\\//",
+ "dir1/\\\\/file2",
+ "dir1/file3/////\\\\\\",
+ "dir1/file4",
+ "dir1/dir1/file1",
+ "dir1/dir1/ file1",
+ "dir1",
+ "dir2//////\\",
+ "dir3",
+ "dir4",
+ "dir1/dir1",
+ "dir1/ dir1///\\\\",
+ "main.c",
+ 0
+};
+
+/*
+ * Do a stat/lstat on a single file and report the status.
+ */
+
+void stat_a_file_helper(
+ const char *file,
+ int follow_link
+)
+{
+ int status;
+ struct stat statbuf;
+ int major1;
+ int minor1;
+ int major2;
+ int minor2;
+
+
+ rtems_test_assert( file );
+
+ if ( follow_link ) {
+ printf( "stat( %s ) returned ", file );
+ fflush( stdout );
+ status = stat( file, &statbuf );
+ } else {
+ printf( "lstat( %s ) returned ", file );
+ fflush( stdout );
+ status = lstat( file, &statbuf );
+ }
+
+ if ( status == -1 ) {
+ printf( ": %s\n", strerror( errno ) );
+ } else {
+
+ rtems_filesystem_split_dev_t( statbuf.st_dev, major1, minor1 );
+ rtems_filesystem_split_dev_t( statbuf.st_rdev, major2, minor2 );
+
+
+ printf("\n...st_dev (0x%x:0x%x)\n", major1, minor1 );
+ printf( "...st_ino %" PRIxino_t "\n", statbuf.st_ino );
+ printf( "...st_mode %o\n", (unsigned int) statbuf.st_mode );
+ printf( "...st_nlink %x\n", statbuf.st_nlink );
+ printf( "...st_uid %d\n", statbuf.st_uid );
+ printf( "...st_gid %d\n", statbuf.st_gid );
+ printf( "...st_rdev (0x%x:0x%x)\n", major2, minor2 );
+ printf( "...st_size %" PRIdoff_t "\n", statbuf.st_size );
+ printf( "...st_atime %s", ctime( &statbuf.st_atime ) );
+ printf( "...st_mtime %s", ctime( &statbuf.st_mtime ) );
+ printf( "...st_ctime %s", ctime( &statbuf.st_ctime ) );
+ printf( "...st_blksize %" PRIxblksize_t "\n", statbuf.st_blksize );
+ printf( "...st_blocks %" PRIxblkcnt_t "\n", statbuf.st_blocks );
+ }
+}
+
+/*
+ * Do a stat on a single file and report the status.
+*/
+void stat_a_file(
+ const char *file
+)
+{
+ stat_a_file_helper( file, true );
+}
+
+/*
+ * Do a lstat on a single file and report the status.
+ */
+void lstat_a_file(
+ const char *file
+)
+{
+ stat_a_file_helper( file, false );
+}
+
+/*
+ * stat() multiple files at a time
+ */
+
+void stat_multiple_files(
+ char **files
+)
+{
+ int i;
+
+ i = 0;
+ while ( files[i] ) {
+ stat_a_file( files[i] );
+ i++;
+ }
+}
+
+/*
+ * chown()/lchown() multiple files at a time
+ */
+void chown_multiple_files_helper(
+ char **files,
+ int follow_link
+)
+{
+ int i;
+ uid_t st_uid;
+ gid_t st_gid;
+
+ st_uid = geteuid();
+ st_gid = getegid();
+
+ i = 0;
+ while ( files[i] ) {
+ printf("Change group of %s\n", files[i]);
+ if ( follow_link ) {
+ chown( files[i], st_uid, (st_gid+1) );
+ stat_a_file( files[i] );
+ } else {
+ lchown( files[i], st_uid, (st_gid+1) );
+ lstat_a_file( files[i] );
+ }
+
+ printf("Change owner of %s\n", files[i]);
+ if ( follow_link ) {
+ chown( files[i], (st_uid+1), st_gid );
+ stat_a_file( files[i] );
+ } else {
+ lchown( files[i], (st_uid+1), st_gid );
+ lstat_a_file( files[i] );
+ }
+ i++;
+ }
+
+}
+
+/*
+ * chown() multiple files at a time
+ */
+void chown_multiple_files(
+ char **files
+)
+{
+ chown_multiple_files_helper( files, true );
+}
+
+/*
+ * lchown() multiple files at a time
+ */
+void lchown_multiple_files(
+ char **files
+)
+{
+ chown_multiple_files_helper( files, false );
+}
+
+/*
+ * mknod() multiple files at a time
+ */
+
+void make_multiple_files(
+ char **files
+)
+{
+ int i;
+ int status;
+
+ i = 0;
+ while ( files[i] ) {
+ printf( "Making file %s\n", files[i] );
+ status = mknod( files[i], ( S_IFREG | S_IROTH|S_IWOTH ), 0LL );
+ rtems_test_assert( !status );
+ i++;
+ }
+ puts( "" );
+}
+
+void make_multiple_bad_files(
+ char **files
+)
+{
+ int i;
+ int status;
+
+ i = 0;
+ while ( files[i] ) {
+ printf( "Making file %s ", files[i] );
+ status = mknod( files[i], ( S_IFREG | S_IROTH|S_IWOTH ), 0LL );
+ rtems_test_assert( status );
+ printf( ": %s\n", strerror( errno ) );
+ i++;
+ }
+ puts( "" );
+}
+
+void make_multiple_links(
+ char **existing,
+ char **new
+)
+{
+ int i;
+ int status;
+
+ i = 0;
+ while ( new[i] && existing[i] ) {
+ printf( "Making file %s\n", new[i] );
+ status = link( existing[i], new[i] );
+ //perror("error");
+ rtems_test_assert( !status );
+ i++;
+ }
+ puts( "" );
+
+ status = link( "fred", "bob" );
+ rtems_test_assert( status == -1 );
+
+ status = link( existing[1], "doug/bob" );
+ rtems_test_assert( status == -1 );
+}
+
+
+void make_too_many_links(void)
+{
+ int i;
+ int status;
+ char name [20];
+
+ status = mkdir("/dummy", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ for (i=1; i<= LINK_MAX; i++) {
+
+ sprintf(name,"/LinkName%d",i);
+ printf( "Making file %s\n", name );
+ status = link("/dummy" , name );
+ if( i < LINK_MAX )
+ rtems_test_assert( !status );
+ else
+ rtems_test_assert( status == -1 );
+
+ }
+}
+
+
+void make_a_symlink(
+ char *existing,
+ char *new
+)
+{
+ int status;
+ char buf[100];
+ int len;
+
+ memset( buf, 0, 100 );
+
+ printf( "Making file %s\n", new );
+ status = symlink( existing, new );
+ rtems_test_assert( !status );
+
+ printf( "Verify with readlink\n");
+ status = readlink( new, buf, 100 );
+ len = strlen( existing );
+ rtems_test_assert ( status == len );
+
+ status = readlink( new, buf, 3 );
+ len = strlen( existing );
+ if (len < 3 )
+ rtems_test_assert( status == len );
+ else
+ rtems_test_assert( status == 3 );
+
+ status = strcmp( existing, buf );
+ rtems_test_assert( !status );
+}
+
+void make_multiple_symlinks(void)
+{
+ int status, i;
+
+ make_a_symlink( Files[0], SymLinks[0] );
+ make_a_symlink( Directories[0], SymLinks[1] );
+ make_a_symlink( Links_to_dirlinks[0], SymLinks[2] );
+ make_a_symlink( "No_File", SymLinks[3] );
+ make_a_symlink( SymLinks[1], SymLinks[4] );
+ make_a_symlink( "//my_mount_point/links","/my_mount_point/symlinks/links" );
+
+ for (i = 0; i < 5; i++) {
+ stat_a_file( SymLinks[i] );
+ lstat_a_file( SymLinks[i] );
+ }
+
+ status = symlink( "//links", "bob/frank" );
+ rtems_test_assert (status == -1);
+
+}
+/*
+void make_too_many_symlinks()
+{
+ int i, status;
+ char name1[8];
+
+ for (i=1; i <= MAXSYMLINK; i++) {
+ sprintf( name1, "SymLink%d", i );
+ status = symlink( "/dummy", name1 );
+ if( i < MAXSYMLINK )
+ rtems_test_assert( !status );
+ else
+ rtems_test_assert( status == -1 );
+ }
+}
+*/
+void make_many_symlinks(
+ char *real_file,
+ int link_count
+)
+{
+ int i;
+ char name1[5];
+ char name2[5];
+ char *link_file;
+
+ link_file = real_file;
+ for (i=1; i < link_count; i++) {
+ sprintf( name1, "%d", i );
+ make_a_symlink( link_file, name1 );
+ strcpy( name2, name1 );
+ link_file = name2;
+ }
+
+ for (i=1; i < link_count; i++) {
+ sprintf( name1, "%d", i );
+ stat_a_file( name1 );
+ lstat_a_file( name1 );
+ }
+
+}
+
+/*
+ * mkdir() multiple directories at a time
+ */
+
+void make_multiple_directories(
+ char **files
+)
+{
+ int i;
+ int status;
+
+ i = 0;
+ while ( files[i] ) {
+ printf( "Making directory %s\n", files[i] );
+ status = mkdir( files[i], S_IRWXU );
+ rtems_test_assert( !status );
+ i++;
+ }
+ puts( "" );
+}
+
+/*
+ * Cause faults.
+ */
+
+
+void Cause_faults(void)
+{
+ int fd;
+ int status;
+ char longer_name[100];
+
+ /*
+ * Verify chmod with an invalid type.
+ */
+
+#if 0
+ printf("\n\nPass an invalid mode to chmod should fail with EPERM \n" );
+ status = chmod( Files[0], S_IFREG );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EPERM );
+#endif
+
+ /*
+ * Change file to executable then try to chdir to it.
+ */
+
+ status = chmod( Files[0], S_IXUSR );
+ rtems_test_assert( status != -1 );
+
+ printf("chdir to a file should fail with ENOTDIR\n");
+ status = chdir( Files[0] );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTDIR );
+
+ /*
+ * Change mode to read/write on a directory.
+ * Verify directory works properly.
+ */
+
+ printf("Verify RWX permission on %s via access\n", Directories[0]);
+ status = access( Directories[0], ( R_OK | W_OK | X_OK ) );
+ rtems_test_assert( status == 0 );
+
+ printf( "chmod of %s to Read/Write\n", Directories[0] );
+ status = chmod( Directories[0], (S_IXGRP | S_IXOTH) );
+ rtems_test_assert( status == 0 );
+
+ printf( "chmod fred should fail with ENOENT\n" );
+ status = chmod( "fred", (S_IXGRP | S_IXOTH) );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOENT );
+
+ strcpy(longer_name, Directories[0] );
+ strcat(longer_name, "/BADNAME" );
+ printf( "Create under %s should fail with EACCES\n", Directories[0] );
+ status = mkdir( longer_name , S_IRWXU );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EACCES );
+
+ printf("chdir to %s should fail with EACCES\n", Directories[4] );
+ status = chdir( Directories[4] );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EACCES );
+
+ /*
+ * Check stat with a NULL buffer.
+ */
+
+ printf("Stat with a NULL buffer should fail with EFAULT\n");
+ status = stat( Directories[0], NULL );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ /*
+ * Set current to a directory with no owner permissions.
+ * Verify it works properly.
+ */
+
+ printf( "\n\nchmod of %s to Read/Write\n", Directories[0] );
+ status = chmod( Directories[0], (S_IXGRP | S_IXOTH) );
+ rtems_test_assert( status == 0 );
+
+ printf("mkdir %s should fail with EACCESS\n", longer_name );
+ status = mkdir( longer_name , S_IRWXU );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EACCES );
+
+ printf("\n%s Should exist ( access )\n",Directories[0] );
+ status = access( Directories[0], F_OK );
+ rtems_test_assert( status == 0 );
+ printf("\n%s Should have read permission( access )\n",Directories[0] );
+ status = access( Directories[0], R_OK );
+ rtems_test_assert( status != 0 );
+ printf("\n%s Should have write permission( access )\n",Directories[0] );
+ status = access( Directories[0], W_OK );
+ rtems_test_assert( status != 0 );
+ printf("\n%s Should not have execute permission( access )\n",Directories[0] );
+ status = access( Directories[0], X_OK );
+ rtems_test_assert( status != 0 );
+
+ printf("\nRestore %s to RWX\n",Directories[0] );
+ status = chmod( Directories[0], S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ printf("chdir to /my_mount_point \n");
+ status = chdir( "/my_mount_point" );
+ rtems_test_assert( status == 0 );
+
+ /*
+ * Remove one of the directories.
+ * Verify links to the removed directory still work.
+ */
+
+ printf( "Remove %s\n", Directories[5] );
+ status = rmdir( Directories[5] );
+ rtems_test_assert( status == 0 );
+
+ stat_a_file( Directories[5] );
+ status = access( Directories[5], F_OK );
+ rtems_test_assert( status != 0 );
+
+ stat_a_file( Links_to_Dirs[5] );
+ status = readlink( Links_to_Dirs[5], longer_name, 3 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EINVAL );
+
+ stat_a_file( Links_to_dirlinks[5] );
+ printf("Chdir to %s\n", Links_to_Dirs[5] );
+ status = chdir( Links_to_Dirs[5] );
+ rtems_test_assert( status == 0 );
+
+ /*
+ * Verify we cannot move up from a node with no parent node.
+ */
+
+ printf("Chdir to .. should fail with ENOENT\n" );
+ status = chdir( ".." );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOENT );
+
+ /*
+ * Create a subdirectory under the dangling node.
+ */
+
+ printf("mkdir ../t should fail with ENOENT\n" );
+ status = mkdir( "../t" , S_IRWXU );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOENT );
+
+ printf("mkdir t\n");
+ status = mkdir( "t" , S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ printf("chdir to /my_mount_point\n");
+ status = chdir( "/my_mount_point" );
+ rtems_test_assert( status == 0 );
+
+ /*
+ * Check rmdir, rmnod, and unlink
+ */
+
+ printf("rmdir %s should fail with ENOTDIR\n", Links_to_Dirs[5] );
+ status = rmdir( Links_to_Dirs[5] );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTDIR );
+
+ printf("unlink %s\n", Links_to_Dirs[5] );
+ status = unlink( Links_to_Dirs[5] );
+ rtems_test_assert( status == 0 );
+
+ printf("unlink %s should fail with ENOTEMPTY\n", Links_to_dirlinks[5] );
+ status = unlink( Links_to_dirlinks[5] );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTEMPTY );
+
+ strcpy( longer_name, Links_to_dirlinks[5] );
+ strcat( longer_name, "/t");
+ printf("rmdir %s\n", longer_name );
+ status = rmdir( longer_name );
+ rtems_test_assert( status == 0 );
+
+ printf("unlink %s\n", Links_to_Dirs[5]);
+ status = unlink( Links_to_dirlinks[5] );
+ rtems_test_assert( status == 0 );
+
+ status = chdir( Directories[0] );
+ status = mkdir ( "my_mount_point", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ printf("Attempting to mount IMFS file system at /dir1/my_mount_point \n");
+ status = mount(
+ "null",
+ "/my_mount_point/dir1/my_mount_point",
+ "imfs",
+ RTEMS_FILESYSTEM_READ_WRITE,
+ NULL );
+ rtems_test_assert( status == 0 );
+
+ printf("rmdir /dir1/my_mount_point should fail with EBUSY\n");
+ status = rmdir ("/my_mount_point/dir1/my_mount_point" );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EBUSY );
+
+ printf( "Unmount /my_mount_point/dir1/my_mount_point\n");
+ status = unmount( "/my_mount_point/dir1/my_mount_point" );
+ rtems_test_assert( status == 0 );
+
+ /*
+ * Verify write permission is checked.
+ */
+
+ printf("chmod of %s to group and other execute\n", Files[0] );
+ status = chmod (Files[0], (S_IXGRP | S_IXOTH) );
+ rtems_test_assert( status == 0 );
+
+ printf("Open %s for write should fail with EACCES\n", Files[0] );
+ fd = open (Files[0], O_WRONLY);
+ rtems_test_assert( fd == -1 );
+ rtems_test_assert( errno == EACCES );
+
+ printf("chmod of %s to User Execute and Read\n", Directories[3] );
+ status = chmod (Directories[3], (S_IXUSR | S_IRUSR) );
+ rtems_test_assert( status == 0 );
+ strcpy(longer_name, Directories[3] );
+ strcat(longer_name, "/NewFile" );
+ printf("Mkdir of %s should fail with EACCES\n",longer_name );
+ status = mkdir( longer_name, S_IRWXU );
+ rtems_test_assert( status != 0 );
+ rtems_test_assert( errno == EACCES );
+
+ printf("Making too many hard links.\n" );
+ make_too_many_links( );
+
+ printf( "pass fstat a null pointer should fail with EFAULT\n");
+ status = fstat( fd, NULL );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT);
+
+ /*
+ * The current directory MUST be restored at the end of this test.
+ */
+
+ printf("chdir to /my_mount_point \n");
+ status = chdir( "/my_mount_point" );
+ rtems_test_assert( status == 0 );
+
+}
+
+void Show_Time(void)
+{
+ rtems_status_code sc;
+ rtems_time_of_day time;
+
+ sc = rtems_clock_get_tod( &time );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ printf("--->Current Time: ");
+ print_time( " - rtems_clock_get_tod - ", &time, "\n" );
+}
+
+void test_statvfs( void )
+{
+
+ int status = 0;
+ struct statvfs stat;
+
+ puts( "statvfs, with invalid path - expect ENOTSUP" );
+ status = statvfs( "" , &stat );
+#if defined(MRFS_TEST)
+ rtems_test_assert(status==0);
+ printf("block size : %lu\n",stat.f_bsize);
+ printf("block number %jd\n",(intmax_t)stat.f_blocks);
+#else
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTSUP );
+#endif
+
+ puts( "create /tmp -- OK" );
+ status = mkdir( "/tmp", 0777 );
+ rtems_test_assert( status == 0 );
+
+ puts( "statvfs, with valid path - expect ENOTSUP" );
+ status = statvfs( "/tmp", &stat );
+#if defined(MRFS_TEST)
+ rtems_test_assert(status==0);
+ printf("block size : %lu\n",stat.f_bsize);
+ printf("block number %jd\n",(intmax_t)stat.f_blocks);
+#else
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTSUP );
+#endif
+
+ puts( "statvfs tested!" );
+}
+void make_multiple_file_test()
+{
+
+ make_multiple_directories( Directories );
+ make_multiple_files( Files );
+
+}
+void link_file()
+{
+ int sc;
+
+ make_multiple_links( Directories, Links_to_Dirs );
+ make_multiple_links( Files, Links_to_Files );
+
+ sc = rtems_task_wake_after( TIMEOUT_VALUE );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ make_multiple_links( Links_to_Dirs, Links_to_dirlinks );
+ sc = rtems_task_wake_after( TIMEOUT_VALUE );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ make_multiple_links( Links_to_Files, Links_to_filelinks );
+
+ sc = rtems_task_wake_after( TIMEOUT_VALUE );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+}
+/*
+ * main entry point to the test
+ */
+
+void stat_test(void)
+{
+ rtems_status_code sc;
+ rtems_time_of_day time;
+ int status;
+
+ puts( "\n\n*** STAT TEST 01 ***" );
+
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ sc = rtems_clock_set( &time );
+ Show_Time();
+
+ status = mkdir("/my_mount_point", S_IRWXU );
+ rtems_test_assert( status == 0 );
+ status = chdir( "/my_mount_point" );
+ rtems_test_assert( status == 0 );
+ status = mkdir("dev", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+
+ /*
+ * Create the files and directories for the test.
+ */
+
+ make_multiple_file_test();
+ link_file();
+
+ /*
+ * Now go through all the absolute path.
+ */
+
+ puts( "Doing the stat() on all the good absolute paths" );
+ stat_multiple_files( Good_absolute_paths );
+
+ /*
+ * run through the relative paths.
+ */
+
+ puts( "\nDoing the stat() on all the good relative paths" );
+ stat_multiple_files( Good_relative_paths );
+
+ /*
+ * Change directory and releative paths are now bad.
+ */
+
+ puts("\nchdir to dev");
+ chdir("dev");
+ puts("\nstat relative paths that are now bad");
+ stat_multiple_files( Good_relative_paths );
+
+ /*
+ * Change directory to the link directory and follow links.
+ */
+
+ puts("\nchdir to ../links");
+ chdir("../links");
+ puts("Doing the stat() on good links\n");
+ stat_multiple_files( Links_to_Dirs );
+ stat_multiple_files( Links_to_Files );
+ stat_multiple_files( Links_to_dirlinks );
+ stat_multiple_files( Links_to_filelinks );
+
+ /*
+ * Chmod on dir1/dir1. This allows the error path to be hit.
+ */
+
+ printf( "chmod of %s to Read/Write\n", Directories[4] );
+ chmod( Directories[4], (S_IROTH|S_IWOTH) );
+ puts( "\nDoing the stat() on all the bad paths" );
+
+ stat_multiple_files( Bad_paths );
+ make_multiple_bad_files( Bad_paths );
+
+ printf( "Return %s to RWX\n", Directories[4] );
+ chmod( Directories[4], S_IRWXU );
+
+
+ /*
+ * Check out symbolic links.
+ */
+
+ make_multiple_symlinks();
+ make_many_symlinks( "/symlinks", 10 );
+
+ sc = rtems_task_wake_after( TIMEOUT_VALUE );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+
+ Cause_faults();
+
+ sc = rtems_task_wake_after( TIMEOUT_VALUE );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+
+ chown_multiple_files( Files );
+
+ sc = rtems_task_wake_after( TIMEOUT_VALUE );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+
+ chown_multiple_files( Links_to_Dirs );
+
+ sc = rtems_task_wake_after( TIMEOUT_VALUE );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+
+ lchown_multiple_files( SymLinks );
+
+
+ puts( "Exercise the reentrant version - _stat_r - expect EFAULT" );
+ status = _stat_r( NULL, NULL, NULL );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ puts( "Exercise the reentrant version - _lstat_r - expect EFAULT" );
+ status = _lstat_r( NULL, NULL, NULL );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ puts( "Try readlink with a bad buffer - expect EFAULT" );
+ status = readlink( "/tmp", NULL, 0 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ puts( "\n\n*** END OF STAT TEST 01 ***" );
+}
+void test()
+{
+
+ /*
+ *RFS and DOSFS don't run stat_test
+ */
+#if defined(MRFS_TEST) || defined(MDOSFS_TEST)
+#else
+ stat_test();
+#endif
+
+ test_statvfs();
+
+}
diff -u /dev/null rtems/testsuites/fstests/fssymlink/fssymlink.doc:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fssymlink/fssymlink.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,22 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fssymlink
+
+directives:
+
++ symlink
+
+concepts:
+
++ Call symlink then lstat it. Some symlink loop error.
diff -u /dev/null rtems/testsuites/fstests/fssymlink/test.c:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fssymlink/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,138 @@
+
+#include <sys/stat.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+
+#include "fstest.h"
+
+/*
+ * Test the function of symlink
+ */
+void symlink_test01()
+{
+ int fd;
+ char* name0="file";
+ char* name1="symlink";
+ int status;
+ struct stat statbuf;
+ int len=strlen(name0);
+
+ printf("Create a file named %s\n",name0);
+ fd=creat(name0,0777);
+ status=close(fd);
+ rtems_test_assert(status==0);
+
+ printf("Create a symlink named %s to %s\n",name1,name0);
+ status=symlink(name0,name1);
+ rtems_test_assert(status==0);
+
+ status=stat(name0,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISREG(statbuf.st_mode));
+ rtems_test_assert(0==statbuf.st_size);
+
+
+ status=lstat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISLNK(statbuf.st_mode));
+#if !defined(IMFS_TEST) && !defined(MIMFS_TEST)
+ rtems_test_assert(len==statbuf.st_size);
+#endif
+
+
+ puts("Unlink the file");
+
+ status=unlink(name0);
+ rtems_test_assert(status==0);
+
+
+ status=lstat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISLNK(statbuf.st_mode));
+
+ status=unlink(name1);
+ rtems_test_assert(status==0);
+
+ printf("Create a dir named %s\n",name0);
+ status=mkdir (name0,0777);
+
+ printf("Create a symlink named %s to %s\n",name1,name0);
+ status=symlink(name0,name1);
+ rtems_test_assert(status==0);
+
+
+
+ status=lstat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISLNK(statbuf.st_mode));
+#if !defined(IMFS_TEST) && !defined(MIMFS_TEST)
+ rtems_test_assert(len==statbuf.st_size);
+#endif
+
+ puts("rmdir the dir");
+ status=rmdir(name0);
+ rtems_test_assert(status==0);
+
+
+ status=lstat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ rtems_test_assert(S_ISLNK(statbuf.st_mode));
+
+ status=unlink(name1);
+ rtems_test_assert(status==0);
+
+}
+/*
+ * symlink loop test
+ */
+void symlink_test02()
+{
+
+ char* name0="symlink0";
+ char* name1="symlink1";
+ int status;
+
+
+ puts("symlink loop test");
+ status=symlink(name0,name1);
+ rtems_test_assert(status==0);
+ status=symlink(name1,name0);
+ rtems_test_assert(status==0);
+
+
+ puts("create a file Should fail with ELOOP");
+ status=creat(name0,0777);
+ rtems_test_assert(status!=0);
+#if !defined(MRFS_TEST)
+ rtems_test_assert(errno==ELOOP);
+#endif
+ puts("truncate a file Should with ELOOP");
+ status=truncate(name0,0777);
+ rtems_test_assert(status!=0);
+#if !defined(MRFS_TEST)
+ rtems_test_assert(errno==ELOOP);
+#endif
+}
+
+void test()
+{
+
+ puts( "\n\n*** SYMLINK TEST ***" );
+#if defined(MDOSFS_TEST)
+#else
+ symlink_test01();
+ symlink_test02();
+#endif
+
+ puts( "*** END OF SYMLINK TEST ***" );
+
+}
+
diff -u /dev/null rtems/testsuites/fstests/fstruncate/fstruncate.doc:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fstruncate/fstruncate.doc Mon Aug 1 09:29:50 2011
@@ -0,0 +1,25 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2009.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: fstruncate
+
+directives:
+
++ truncate
+
+
+concepts:
+
++ Exercise successful truncate operation and a bad argument test.
+
+
diff -u /dev/null rtems/testsuites/fstests/fstruncate/test.c:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/fstruncate/test.c Mon Aug 1 09:29:50 2011
@@ -0,0 +1,149 @@
+#include <sys/stat.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+
+
+#include "fstest.h"
+/*
+ * Truncate descreas /increase file size
+ */
+void truncate_test01()
+{
+
+ int status;
+ int max_size;
+ int fd1;
+ int fd2;
+ char* name1="name1";
+ char* name2="name2";
+ char* path="test";
+
+ char* buff;
+ off_t length=123;
+
+ int n;
+
+ struct stat statbuf;
+
+ status=mkdir(path,755);
+ rtems_test_assert(status==0);
+
+ status=chdir(path);
+ rtems_test_assert(status==0);
+
+ puts("Create a empty file");
+ fd1=creat(name1,0644);
+ status=close(fd1);
+ rtems_test_assert(status==0);
+
+ printf("truncate it to %jd\n ",(intmax_t)length);
+ status=truncate(name1,length);
+ rtems_test_assert(status==0);
+
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ puts("verify it ");
+#if !defined(MDOSFS_TEST)
+ rtems_test_assert(length==statbuf.st_size);
+
+ buff=(char*)malloc(length);
+ fd1=open(name1,O_RDWR);
+
+ n=read(fd1,buff,length);
+ rtems_test_assert(n==length);
+ for (n=n-1;n>=0;n--)
+ {
+ rtems_test_assert(buff[n]==0);
+
+ }
+#endif
+
+ status=truncate(name1,678);
+ rtems_test_assert(status==0);
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+#if !defined(MDOSFS_TEST)
+ rtems_test_assert(678==statbuf.st_size);
+#endif
+
+
+
+ status=unlink(name1);
+ rtems_test_assert(status==0);
+
+ status=chdir("..");
+ rtems_test_assert(status==0);
+
+ status=rmdir(path);
+ rtems_test_assert(status==0);
+}
+
+/*
+ * error test
+ */
+void truncate_test02()
+{
+
+
+ int status;
+ int max_size;
+ int fd1;
+ int fd2;
+ char* name1="name1";
+ char* name2="name2";
+ char* path="error";
+ off_t bad=-10;
+
+ struct stat statbuf;
+
+ status=mkdir(path,755);
+ rtems_test_assert(status==0);
+
+ status=chdir(path);
+ rtems_test_assert(status==0);
+
+ fd1=creat(name1,0644);
+ status=close(fd1);
+ rtems_test_assert(status==0);
+
+ status==truncate(name1,123);
+ rtems_test_assert(status==0);
+
+
+ /*
+ *This should fail, but in Linux it return 0 and errno is
+ * set to EINVAL
+ */
+ puts("Truncate the file to a bad value");
+
+#if !defined(__rtems__)
+ status==truncate(name1,bad);
+ rtems_test_assert(status==0);
+ rtems_test_assert(errno==EINVAL);
+#endif
+/* * Truncate a file to a negative value, the st_size is 0 in Liunx */
+ status=stat(name1,&statbuf);
+ rtems_test_assert(status==0);
+ printf("st_size is %jd\n",(intmax_t)statbuf.st_size);
+
+
+
+
+}
+
+
+void test()
+{
+ puts( "\n\n*** TRUNCATE TEST ***" );
+ truncate_test01();
+ truncate_test02();
+ puts( "*** END OF TRUNCATE TEST ***" );
+}
diff -u /dev/null rtems/testsuites/fstests/imfs_fsfchx/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/imfs_fsfchx/.cvsignore Mon Aug 1 09:29:50 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsfchx/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:44 2011
+++ rtems/testsuites/fstests/imfs_fsfchx/Makefile.am Mon Aug 1 09:29:50 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsfchx
+imfs_fsfchx_SOURCES = ../fsfchx/init.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsfchx.scn
+#dist_rtems_tests_DATA += imfs_fsfchx.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsfchx_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsfchx_OBJECTS) $(imfs_fsfchx_LDADD)
+LINK_LIBS = $(imfs_fsfchx_LDLIBS)
+
+imfs_fsfchx$(EXEEXT): $(imfs_fsfchx_OBJECTS) $(imfs_fsfchx_DEPENDENCIES)
+ @rm -f imfs_fsfchx$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsfile01/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsfile01/.cvsignore Mon Aug 1 09:29:50 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsfile01/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsfile01/Makefile.am Mon Aug 1 09:29:50 2011
@@ -0,0 +1,36 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsfile01
+imfs_fsfile01_SOURCES = ../fsfile01/test_cat.c ../fsfile01/test.c\
+ ../fsfile01/test_write.c ../fsfile01/test_extend.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsfile01.scn
+#dist_rtems_tests_DATA += imfs_fsfile01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsfile01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsfile01_OBJECTS) $(imfs_fsfile01_LDADD)
+LINK_LIBS = $(imfs_fsfile01_LDLIBS)
+
+imfs_fsfile01$(EXEEXT): $(imfs_fsfile01_OBJECTS) $(imfs_fsfile01_DEPENDENCIES)
+ @rm -f imfs_fsfile01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsfile02/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsfile02/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsfile02/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsfile02/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsfile02
+imfs_fsfile02_SOURCES = ../fsfile02/init.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsfile02.scn
+#dist_rtems_tests_DATA += imfs_fsfile02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsfile02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsfile02_OBJECTS) $(imfs_fsfile02_LDADD)
+LINK_LIBS = $(imfs_fsfile02_LDLIBS)
+
+imfs_fsfile02$(EXEEXT): $(imfs_fsfile02_OBJECTS) $(imfs_fsfile02_DEPENDENCIES)
+ @rm -f imfs_fsfile02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsfstest/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsfstest/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsfstest/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsfstest/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsfstest
+imfs_fsfstest_SOURCES = ../fsfstest/fs-test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsfstest.scn
+#dist_rtems_tests_DATA += imfs_fsfstest.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsfstest_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsfstest_OBJECTS) $(imfs_fsfstest_LDADD)
+LINK_LIBS = $(imfs_fsfstest_LDLIBS)
+
+imfs_fsfstest$(EXEEXT): $(imfs_fsfstest_OBJECTS) $(imfs_fsfstest_DEPENDENCIES)
+ @rm -f imfs_fsfstest$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsimfs01/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsimfs01/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsimfs01/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsimfs01/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsimfs01
+imfs_fsimfs01_SOURCES = ../fsimfs01/init.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsimfs01.scn
+#dist_rtems_tests_DATA += imfs_fsimfs01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsimfs01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsimfs01_OBJECTS) $(imfs_fsimfs01_LDADD)
+LINK_LIBS = $(imfs_fsimfs01_LDLIBS)
+
+imfs_fsimfs01$(EXEEXT): $(imfs_fsimfs01_OBJECTS) $(imfs_fsimfs01_DEPENDENCIES)
+ @rm -f imfs_fsimfs01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsimfs02/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsimfs02/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsimfs02/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fsimfs02/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsimfs02
+imfs_fsimfs02_SOURCES = ../fsimfs02/init.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsimfs02.scn
+#dist_rtems_tests_DATA += imfs_fsimfs02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsimfs02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsimfs02_OBJECTS) $(imfs_fsimfs02_LDADD)
+LINK_LIBS = $(imfs_fsimfs02_LDLIBS)
+
+imfs_fsimfs02$(EXEEXT): $(imfs_fsimfs02_OBJECTS) $(imfs_fsimfs02_DEPENDENCIES)
+ @rm -f imfs_fsimfs02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fslink/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:45 2011
+++ rtems/testsuites/fstests/imfs_fslink/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fslink/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fslink/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fslink
+imfs_fslink_SOURCES = ../fslink/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fslink.scn
+#dist_rtems_tests_DATA += imfs_fslink.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fslink_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fslink_OBJECTS) $(imfs_fslink_LDADD)
+LINK_LIBS = $(imfs_fslink_LDLIBS)
+
+imfs_fslink$(EXEEXT): $(imfs_fslink_OBJECTS) $(imfs_fslink_DEPENDENCIES)
+ @rm -f imfs_fslink$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsmkdir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsmkdir/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsmkdir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsmkdir/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsmkdir
+imfs_fsmkdir_SOURCES = ../fsmkdir/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsmkdir.scn
+#dist_rtems_tests_DATA += imfs_fsmkdir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsmkdir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsmkdir_OBJECTS) $(imfs_fsmkdir_LDADD)
+LINK_LIBS = $(imfs_fsmkdir_LDLIBS)
+
+imfs_fsmkdir$(EXEEXT): $(imfs_fsmkdir_OBJECTS) $(imfs_fsmkdir_DEPENDENCIES)
+ @rm -f imfs_fsmkdir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsopen/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsopen/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsopen/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsopen/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsopen
+imfs_fsopen_SOURCES = ../fsopen/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsopen.scn
+#dist_rtems_tests_DATA += imfs_fsopen.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsopen_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsopen_OBJECTS) $(imfs_fsopen_LDADD)
+LINK_LIBS = $(imfs_fsopen_LDLIBS)
+
+imfs_fsopen$(EXEEXT): $(imfs_fsopen_OBJECTS) $(imfs_fsopen_DEPENDENCIES)
+ @rm -f imfs_fsopen$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsrdwrv/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsrdwrv/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsrdwrv/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsrdwrv/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsrdwrv
+imfs_fsrdwrv_SOURCES = ../fsrdwrv/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsrdwrv.scn
+#dist_rtems_tests_DATA += imfs_fsrdwrv.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsrdwrv_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsrdwrv_OBJECTS) $(imfs_fsrdwrv_LDADD)
+LINK_LIBS = $(imfs_fsrdwrv_LDLIBS)
+
+imfs_fsrdwrv$(EXEEXT): $(imfs_fsrdwrv_OBJECTS) $(imfs_fsrdwrv_DEPENDENCIES)
+ @rm -f imfs_fsrdwrv$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsreaddir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsreaddir/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsreaddir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsreaddir/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsreaddir
+imfs_fsreaddir_SOURCES = ../fsreaddir/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsreaddir.scn
+#dist_rtems_tests_DATA += imfs_fsreaddir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsreaddir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsreaddir_OBJECTS) $(imfs_fsreaddir_LDADD)
+LINK_LIBS = $(imfs_fsreaddir_LDLIBS)
+
+imfs_fsreaddir$(EXEEXT): $(imfs_fsreaddir_OBJECTS) $(imfs_fsreaddir_DEPENDENCIES)
+ @rm -f imfs_fsreaddir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsrename/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsrename/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsrename/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsrename/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsrename
+imfs_fsrename_SOURCES = ../fsrename/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsrename.scn
+#dist_rtems_tests_DATA += imfs_fsrename.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsrename_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsrename_OBJECTS) $(imfs_fsrename_LDADD)
+LINK_LIBS = $(imfs_fsrename_LDLIBS)
+
+imfs_fsrename$(EXEEXT): $(imfs_fsrename_OBJECTS) $(imfs_fsrename_DEPENDENCIES)
+ @rm -f imfs_fsrename$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsrmdir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:46 2011
+++ rtems/testsuites/fstests/imfs_fsrmdir/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsrmdir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fsrmdir/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsrmdir
+imfs_fsrmdir_SOURCES = ../fsrmdir/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsrmdir.scn
+#dist_rtems_tests_DATA += imfs_fsrmdir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsrmdir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsrmdir_OBJECTS) $(imfs_fsrmdir_LDADD)
+LINK_LIBS = $(imfs_fsrmdir_LDLIBS)
+
+imfs_fsrmdir$(EXEEXT): $(imfs_fsrmdir_OBJECTS) $(imfs_fsrmdir_DEPENDENCIES)
+ @rm -f imfs_fsrmdir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsrwfile/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fsrwfile/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsrwfile/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fsrwfile/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsrwfile
+imfs_fsrwfile_SOURCES = ../fsrwfile/init.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsrwfile.scn
+#dist_rtems_tests_DATA += imfs_fsrwfile.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsrwfile_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsrwfile_OBJECTS) $(imfs_fsrwfile_LDADD)
+LINK_LIBS = $(imfs_fsrwfile_LDLIBS)
+
+imfs_fsrwfile$(EXEEXT): $(imfs_fsrwfile_OBJECTS) $(imfs_fsrwfile_DEPENDENCIES)
+ @rm -f imfs_fsrwfile$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fsstat/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fsstat/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fsstat/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fsstat/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fsstat
+imfs_fsstat_SOURCES = ../fsstat/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fsstat.scn
+#dist_rtems_tests_DATA += imfs_fsstat.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fsstat_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsstat_OBJECTS) $(imfs_fsstat_LDADD)
+LINK_LIBS = $(imfs_fsstat_LDLIBS)
+
+imfs_fsstat$(EXEEXT): $(imfs_fsstat_OBJECTS) $(imfs_fsstat_DEPENDENCIES)
+ @rm -f imfs_fsstat$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fssymlink/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fssymlink/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fssymlink/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fssymlink/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fssymlink
+imfs_fssymlink_SOURCES = ../fssymlink/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fssymlink.scn
+#dist_rtems_tests_DATA += imfs_fssymlink.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fssymlink_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fssymlink_OBJECTS) $(imfs_fssymlink_LDADD)
+LINK_LIBS = $(imfs_fssymlink_LDLIBS)
+
+imfs_fssymlink$(EXEEXT): $(imfs_fssymlink_OBJECTS) $(imfs_fssymlink_DEPENDENCIES)
+ @rm -f imfs_fssymlink$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/imfs_fstruncate/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fstruncate/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/imfs_fstruncate/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:47 2011
+++ rtems/testsuites/fstests/imfs_fstruncate/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fstruncate
+imfs_fstruncate_SOURCES = ../fstruncate/test.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = imfs_fstruncate.scn
+#dist_rtems_tests_DATA += imfs_fstruncate.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fstruncate_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fstruncate_OBJECTS) $(imfs_fstruncate_LDADD)
+LINK_LIBS = $(imfs_fstruncate_LDLIBS)
+
+imfs_fstruncate$(EXEEXT): $(imfs_fstruncate_OBJECTS) $(imfs_fstruncate_DEPENDENCIES)
+ @rm -f imfs_fstruncate$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u rtems/testsuites/fstests/imfs_support/fs_config.h:1.1 rtems/testsuites/fstests/imfs_support/fs_config.h:1.2
--- rtems/testsuites/fstests/imfs_support/fs_config.h:1.1 Wed Apr 20 16:30:14 2011
+++ rtems/testsuites/fstests/imfs_support/fs_config.h Mon Aug 1 09:29:51 2011
@@ -1,10 +1,24 @@
/*
* $Id$
*/
+#ifndef __IMFS_SUPPORT_h
+#define __IMFS_SUPPORT_h
+
+#define IMFS_TEST
#define FILESYSTEM "IMFS"
-#define BASE_FOR_TEST ""
+#define BASE_FOR_TEST "/mnt/"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern void test_initialize_filesystem(void);
extern void test_shutdown_filesystem(void);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
diff -u rtems/testsuites/fstests/imfs_support/fs_support.c:1.1 rtems/testsuites/fstests/imfs_support/fs_support.c:1.2
--- rtems/testsuites/fstests/imfs_support/fs_support.c:1.1 Wed Apr 20 16:30:14 2011
+++ rtems/testsuites/fstests/imfs_support/fs_support.c Mon Aug 1 09:29:51 2011
@@ -2,10 +2,33 @@
* $Id$
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "pmacros.h"
+
+#include "fs_config.h"
+
void test_initialize_filesystem(void)
{
+ int rc=0;
+ rc=mkdir(BASE_FOR_TEST,0777);
+ rtems_test_assert(rc==0);
}
void test_shutdown_filesystem(void)
{
}
+/* configuration information */
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 40
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsfchx/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsfchx/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsfchx/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsfchx/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsfchx
+mdosfs_fsfchx_SOURCES = ../fsfchx/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsfchx.scn
+#dist_rtems_tests_DATA += mdosfs_fsfchx.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsfchx_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsfchx_OBJECTS) $(mdosfs_fsfchx_LDADD)
+LINK_LIBS = $(mdosfs_fsfchx_LDLIBS)
+
+mdosfs_fsfchx$(EXEEXT): $(mdosfs_fsfchx_OBJECTS) $(mdosfs_fsfchx_DEPENDENCIES)
+ @rm -f mdosfs_fsfchx$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsfile01/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsfile01/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsfile01/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsfile01/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,37 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsfile01
+mdosfs_fsfile01_SOURCES = ../fsfile01/test_cat.c ../fsfile01/test.c\
+ ../fsfile01/test_write.c ../fsfile01/test_extend.c\
+ ../support/ramdisk_support.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/ramdisk_support.h\
+ ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsfile01.scn
+#dist_rtems_tests_DATA += mdosfs_fsfile01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsfile01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsfile01_OBJECTS) $(mdosfs_fsfile01_LDADD)
+LINK_LIBS = $(mdosfs_fsfile01_LDLIBS)
+
+mdosfs_fsfile01$(EXEEXT): $(mdosfs_fsfile01_OBJECTS) $(mdosfs_fsfile01_DEPENDENCIES)
+ @rm -f mdosfs_fsfile01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsfile02/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsfile02/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsfile02/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsfile02/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsfile02
+mdosfs_fsfile02_SOURCES = ../fsfile02/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsfile02.scn
+#dist_rtems_tests_DATA += mdosfs_fsfile02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsfile02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsfile02_OBJECTS) $(mdosfs_fsfile02_LDADD)
+LINK_LIBS = $(mdosfs_fsfile02_LDLIBS)
+
+mdosfs_fsfile02$(EXEEXT): $(mdosfs_fsfile02_OBJECTS) $(mdosfs_fsfile02_DEPENDENCIES)
+ @rm -f mdosfs_fsfile02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsfstest/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsfstest/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsfstest/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsfstest/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsfstest
+mdosfs_fsfstest_SOURCES = ../fsfstest/fs-test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsfstest.scn
+#dist_rtems_tests_DATA += mdosfs_fsfstest.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsfstest_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsfstest_OBJECTS) $(mdosfs_fsfstest_LDADD)
+LINK_LIBS = $(mdosfs_fsfstest_LDLIBS)
+
+mdosfs_fsfstest$(EXEEXT): $(mdosfs_fsfstest_OBJECTS) $(mdosfs_fsfstest_DEPENDENCIES)
+ @rm -f mdosfs_fsfstest$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsimfs01/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsimfs01/.cvsignore Mon Aug 1 09:29:51 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsimfs01/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsimfs01/Makefile.am Mon Aug 1 09:29:51 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsimfs01
+mdosfs_fsimfs01_SOURCES = ../fsimfs01/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsimfs01.scn
+#dist_rtems_tests_DATA += mdosfs_fsimfs01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsimfs01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsimfs01_OBJECTS) $(mdosfs_fsimfs01_LDADD)
+LINK_LIBS = $(mdosfs_fsimfs01_LDLIBS)
+
+mdosfs_fsimfs01$(EXEEXT): $(mdosfs_fsimfs01_OBJECTS) $(mdosfs_fsimfs01_DEPENDENCIES)
+ @rm -f mdosfs_fsimfs01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsimfs02/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:48 2011
+++ rtems/testsuites/fstests/mdosfs_fsimfs02/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsimfs02/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsimfs02/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsimfs02
+mdosfs_fsimfs02_SOURCES = ../fsimfs02/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsimfs02.scn
+#dist_rtems_tests_DATA += mdosfs_fsimfs02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsimfs02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsimfs02_OBJECTS) $(mdosfs_fsimfs02_LDADD)
+LINK_LIBS = $(mdosfs_fsimfs02_LDLIBS)
+
+mdosfs_fsimfs02$(EXEEXT): $(mdosfs_fsimfs02_OBJECTS) $(mdosfs_fsimfs02_DEPENDENCIES)
+ @rm -f mdosfs_fsimfs02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fslink/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fslink/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fslink/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fslink/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fslink
+mdosfs_fslink_SOURCES = ../fslink/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fslink.scn
+#dist_rtems_tests_DATA += mdosfs_fslink.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fslink_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fslink_OBJECTS) $(mdosfs_fslink_LDADD)
+LINK_LIBS = $(mdosfs_fslink_LDLIBS)
+
+mdosfs_fslink$(EXEEXT): $(mdosfs_fslink_OBJECTS) $(mdosfs_fslink_DEPENDENCIES)
+ @rm -f mdosfs_fslink$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsmkdir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsmkdir/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsmkdir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsmkdir/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsmkdir
+mdosfs_fsmkdir_SOURCES = ../fsmkdir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsmkdir.scn
+#dist_rtems_tests_DATA += mdosfs_fsmkdir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsmkdir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsmkdir_OBJECTS) $(mdosfs_fsmkdir_LDADD)
+LINK_LIBS = $(mdosfs_fsmkdir_LDLIBS)
+
+mdosfs_fsmkdir$(EXEEXT): $(mdosfs_fsmkdir_OBJECTS) $(mdosfs_fsmkdir_DEPENDENCIES)
+ @rm -f mdosfs_fsmkdir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsopen/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsopen/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsopen/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsopen/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsopen
+mdosfs_fsopen_SOURCES = ../fsopen/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsopen.scn
+#dist_rtems_tests_DATA += mdosfs_fsopen.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsopen_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsopen_OBJECTS) $(mdosfs_fsopen_LDADD)
+LINK_LIBS = $(mdosfs_fsopen_LDLIBS)
+
+mdosfs_fsopen$(EXEEXT): $(mdosfs_fsopen_OBJECTS) $(mdosfs_fsopen_DEPENDENCIES)
+ @rm -f mdosfs_fsopen$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsrdwrv/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsrdwrv/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsrdwrv/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsrdwrv/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsrdwrv
+mdosfs_fsrdwrv_SOURCES = ../fsrdwrv/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsrdwrv.scn
+#dist_rtems_tests_DATA += mdosfs_fsrdwrv.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsrdwrv_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsrdwrv_OBJECTS) $(mdosfs_fsrdwrv_LDADD)
+LINK_LIBS = $(mdosfs_fsrdwrv_LDLIBS)
+
+mdosfs_fsrdwrv$(EXEEXT): $(mdosfs_fsrdwrv_OBJECTS) $(mdosfs_fsrdwrv_DEPENDENCIES)
+ @rm -f mdosfs_fsrdwrv$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsreaddir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsreaddir/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsreaddir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:49 2011
+++ rtems/testsuites/fstests/mdosfs_fsreaddir/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsreaddir
+mdosfs_fsreaddir_SOURCES = ../fsreaddir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsreaddir.scn
+#dist_rtems_tests_DATA += mdosfs_fsreaddir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsreaddir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsreaddir_OBJECTS) $(mdosfs_fsreaddir_LDADD)
+LINK_LIBS = $(mdosfs_fsreaddir_LDLIBS)
+
+mdosfs_fsreaddir$(EXEEXT): $(mdosfs_fsreaddir_OBJECTS) $(mdosfs_fsreaddir_DEPENDENCIES)
+ @rm -f mdosfs_fsreaddir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsrename/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fsrename/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsrename/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fsrename/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsrename
+mdosfs_fsrename_SOURCES = ../fsrename/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsrename.scn
+#dist_rtems_tests_DATA += mdosfs_fsrename.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsrename_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsrename_OBJECTS) $(mdosfs_fsrename_LDADD)
+LINK_LIBS = $(mdosfs_fsrename_LDLIBS)
+
+mdosfs_fsrename$(EXEEXT): $(mdosfs_fsrename_OBJECTS) $(mdosfs_fsrename_DEPENDENCIES)
+ @rm -f mdosfs_fsrename$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsrmdir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fsrmdir/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsrmdir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fsrmdir/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsrmdir
+mdosfs_fsrmdir_SOURCES = ../fsrmdir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsrmdir.scn
+#dist_rtems_tests_DATA += mdosfs_fsrmdir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsrmdir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsrmdir_OBJECTS) $(mdosfs_fsrmdir_LDADD)
+LINK_LIBS = $(mdosfs_fsrmdir_LDLIBS)
+
+mdosfs_fsrmdir$(EXEEXT): $(mdosfs_fsrmdir_OBJECTS) $(mdosfs_fsrmdir_DEPENDENCIES)
+ @rm -f mdosfs_fsrmdir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsrwfile/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fsrwfile/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsrwfile/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fsrwfile/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsrwfile
+mdosfs_fsrwfile_SOURCES = ../fsrwfile/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsrwfile.scn
+#dist_rtems_tests_DATA += mdosfs_fsrwfile.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsrwfile_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsrwfile_OBJECTS) $(mdosfs_fsrwfile_LDADD)
+LINK_LIBS = $(mdosfs_fsrwfile_LDLIBS)
+
+mdosfs_fsrwfile$(EXEEXT): $(mdosfs_fsrwfile_OBJECTS) $(mdosfs_fsrwfile_DEPENDENCIES)
+ @rm -f mdosfs_fsrwfile$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsstat/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fsstat/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fsstat/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fsstat/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fsstat
+mdosfs_fsstat_SOURCES = ../fsstat/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fsstat.scn
+#dist_rtems_tests_DATA += mdosfs_fsstat.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fsstat_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsstat_OBJECTS) $(mdosfs_fsstat_LDADD)
+LINK_LIBS = $(mdosfs_fsstat_LDLIBS)
+
+mdosfs_fsstat$(EXEEXT): $(mdosfs_fsstat_OBJECTS) $(mdosfs_fsstat_DEPENDENCIES)
+ @rm -f mdosfs_fsstat$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fssymlink/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fssymlink/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fssymlink/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fssymlink/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fssymlink
+mdosfs_fssymlink_SOURCES = ../fssymlink/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fssymlink.scn
+#dist_rtems_tests_DATA += mdosfs_fssymlink.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fssymlink_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fssymlink_OBJECTS) $(mdosfs_fssymlink_LDADD)
+LINK_LIBS = $(mdosfs_fssymlink_LDLIBS)
+
+mdosfs_fssymlink$(EXEEXT): $(mdosfs_fssymlink_OBJECTS) $(mdosfs_fssymlink_DEPENDENCIES)
+ @rm -f mdosfs_fssymlink$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fstruncate/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fstruncate/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mdosfs_fstruncate/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:50 2011
+++ rtems/testsuites/fstests/mdosfs_fstruncate/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mdosfs_fstruncate
+mdosfs_fstruncate_SOURCES = ../fstruncate/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mdosfs_support/fs_support.c ../mdosfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mdosfs_fstruncate.scn
+#dist_rtems_tests_DATA += mdosfs_fstruncate.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mdosfs_fstruncate_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fstruncate_OBJECTS) $(mdosfs_fstruncate_LDADD)
+LINK_LIBS = $(mdosfs_fstruncate_LDLIBS)
+
+mdosfs_fstruncate$(EXEEXT): $(mdosfs_fstruncate_OBJECTS) $(mdosfs_fstruncate_DEPENDENCIES)
+ @rm -f mdosfs_fstruncate$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mdosfs_support/fs_config.h:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mdosfs_support/fs_config.h Mon Aug 1 09:29:52 2011
@@ -0,0 +1,20 @@
+/*
+ * $Id$
+ */
+
+#ifndef __MIMFS_SUPPORT_h
+#define __MIMFS_SUPPORT_h
+
+#define MDOSFS_TEST
+
+#define FILESYSTEM "MOUNTED DOSFS"
+#define BASE_FOR_TEST "/mnt/"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
diff -u /dev/null rtems/testsuites/fstests/mdosfs_support/fs_support.c:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mdosfs_support/fs_support.c Mon Aug 1 09:29:52 2011
@@ -0,0 +1,92 @@
+/*
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "pmacros.h"
+
+#include "fs_config.h"
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <rtems/libio.h>
+#include <rtems/dosfs.h>
+#include "ramdisk_support.h"
+
+#define BLOCK_SIZE 512
+
+msdos_format_request_param_t rqdata = {
+ OEMName: "RTEMS",
+ VolLabel: "RTEMSDisk",
+ sectors_per_cluster: 0,
+ fat_num: 0,
+ files_per_root_dir: 0,
+ fattype: MSDOS_FMT_FATANY,
+ media: 0,
+ quick_format: FALSE,
+ cluster_align: 0,
+ info_level: 0
+};
+
+void test_initialize_filesystem(void)
+{
+ int rc=0;
+ rc=mkdir(BASE_FOR_TEST,0777);
+ rtems_test_assert(rc==0);
+
+ init_ramdisk();
+
+ rc=msdos_format(RAMDISK_PATH,&rqdata);
+ rtems_test_assert(rc==0);
+
+ rc=mount(RAMDISK_PATH,
+ BASE_FOR_TEST,
+ "dosfs",
+ RTEMS_FILESYSTEM_READ_WRITE,
+ NULL);
+ rtems_test_assert(rc==0);
+}
+
+
+void test_shutdown_filesystem(void)
+{
+ int rc=0;
+ rc=unmount(BASE_FOR_TEST) ;
+ rtems_test_assert(rc==0);
+ del_ramdisk();
+}
+
+/* configuration information */
+
+/* drivers */
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+/**
+ * Configure base RTEMS resources.
+ */
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_MEMORY_OVERHEAD 512
+#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited (10)
+#define CONFIGURE_MAXIMUM_SEMAPHORES rtems_resource_unlimited (10)
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES rtems_resource_unlimited (6)
+#define CONFIGURE_MAXIMUM_PARTITIONS rtems_resource_unlimited (4)
+#define CONFIGURE_MAXIMUM_TIMERS 10
+
+
+/**
+ * Configure file system and libblock.
+ */
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 100
+#define CONFIGURE_MAXIMUM_DRIVERS 100
+#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
+
+#define CONFIGURE_FILESYSTEM_DOSFS
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsfchx/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsfchx/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsfchx/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsfchx/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsfchx
+mimfs_fsfchx_SOURCES = ../fsfchx/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsfchx.scn
+#dist_rtems_tests_DATA += mimfs_fsfchx.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsfchx_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsfchx_OBJECTS) $(mimfs_fsfchx_LDADD)
+LINK_LIBS = $(mimfs_fsfchx_LDLIBS)
+
+mimfs_fsfchx$(EXEEXT): $(mimfs_fsfchx_OBJECTS) $(mimfs_fsfchx_DEPENDENCIES)
+ @rm -f mimfs_fsfchx$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsfile01/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsfile01/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsfile01/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsfile01/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,37 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsfile01
+mimfs_fsfile01_SOURCES = ../fsfile01/test_cat.c ../fsfile01/test.c\
+ ../fsfile01/test_write.c ../fsfile01/test_extend.c\
+ ../support/ramdisk_support.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/ramdisk_support.h\
+ ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsfile01.scn
+#dist_rtems_tests_DATA += mimfs_fsfile01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsfile01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsfile01_OBJECTS) $(mimfs_fsfile01_LDADD)
+LINK_LIBS = $(mimfs_fsfile01_LDLIBS)
+
+mimfs_fsfile01$(EXEEXT): $(mimfs_fsfile01_OBJECTS) $(mimfs_fsfile01_DEPENDENCIES)
+ @rm -f mimfs_fsfile01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsfile02/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsfile02/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsfile02/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsfile02/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsfile02
+mimfs_fsfile02_SOURCES = ../fsfile02/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsfile02.scn
+#dist_rtems_tests_DATA += mimfs_fsfile02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsfile02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsfile02_OBJECTS) $(mimfs_fsfile02_LDADD)
+LINK_LIBS = $(mimfs_fsfile02_LDLIBS)
+
+mimfs_fsfile02$(EXEEXT): $(mimfs_fsfile02_OBJECTS) $(mimfs_fsfile02_DEPENDENCIES)
+ @rm -f mimfs_fsfile02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsfstest/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsfstest/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsfstest/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsfstest/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsfstest
+mimfs_fsfstest_SOURCES = ../fsfstest/fs-test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsfstest.scn
+#dist_rtems_tests_DATA += mimfs_fsfstest.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsfstest_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsfstest_OBJECTS) $(mimfs_fsfstest_LDADD)
+LINK_LIBS = $(mimfs_fsfstest_LDLIBS)
+
+mimfs_fsfstest$(EXEEXT): $(mimfs_fsfstest_OBJECTS) $(mimfs_fsfstest_DEPENDENCIES)
+ @rm -f mimfs_fsfstest$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsimfs01/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:51 2011
+++ rtems/testsuites/fstests/mimfs_fsimfs01/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsimfs01/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsimfs01/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsimfs01
+mimfs_fsimfs01_SOURCES = ../fsimfs01/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsimfs01.scn
+#dist_rtems_tests_DATA += mimfs_fsimfs01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsimfs01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsimfs01_OBJECTS) $(mimfs_fsimfs01_LDADD)
+LINK_LIBS = $(mimfs_fsimfs01_LDLIBS)
+
+mimfs_fsimfs01$(EXEEXT): $(mimfs_fsimfs01_OBJECTS) $(mimfs_fsimfs01_DEPENDENCIES)
+ @rm -f mimfs_fsimfs01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsimfs02/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsimfs02/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsimfs02/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsimfs02/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsimfs02
+mimfs_fsimfs02_SOURCES = ../fsimfs02/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsimfs02.scn
+#dist_rtems_tests_DATA += mimfs_fsimfs02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsimfs02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsimfs02_OBJECTS) $(mimfs_fsimfs02_LDADD)
+LINK_LIBS = $(mimfs_fsimfs02_LDLIBS)
+
+mimfs_fsimfs02$(EXEEXT): $(mimfs_fsimfs02_OBJECTS) $(mimfs_fsimfs02_DEPENDENCIES)
+ @rm -f mimfs_fsimfs02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fslink/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fslink/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fslink/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fslink/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fslink
+mimfs_fslink_SOURCES = ../fslink/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fslink.scn
+#dist_rtems_tests_DATA += mimfs_fslink.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fslink_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fslink_OBJECTS) $(mimfs_fslink_LDADD)
+LINK_LIBS = $(mimfs_fslink_LDLIBS)
+
+mimfs_fslink$(EXEEXT): $(mimfs_fslink_OBJECTS) $(mimfs_fslink_DEPENDENCIES)
+ @rm -f mimfs_fslink$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsmkdir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsmkdir/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsmkdir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsmkdir/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsmkdir
+mimfs_fsmkdir_SOURCES = ../fsmkdir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsmkdir.scn
+#dist_rtems_tests_DATA += mimfs_fsmkdir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsmkdir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsmkdir_OBJECTS) $(mimfs_fsmkdir_LDADD)
+LINK_LIBS = $(mimfs_fsmkdir_LDLIBS)
+
+mimfs_fsmkdir$(EXEEXT): $(mimfs_fsmkdir_OBJECTS) $(mimfs_fsmkdir_DEPENDENCIES)
+ @rm -f mimfs_fsmkdir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsopen/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsopen/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsopen/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsopen/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsopen
+mimfs_fsopen_SOURCES = ../fsopen/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsopen.scn
+#dist_rtems_tests_DATA += mimfs_fsopen.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsopen_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsopen_OBJECTS) $(mimfs_fsopen_LDADD)
+LINK_LIBS = $(mimfs_fsopen_LDLIBS)
+
+mimfs_fsopen$(EXEEXT): $(mimfs_fsopen_OBJECTS) $(mimfs_fsopen_DEPENDENCIES)
+ @rm -f mimfs_fsopen$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsrdwrv/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsrdwrv/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsrdwrv/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:52 2011
+++ rtems/testsuites/fstests/mimfs_fsrdwrv/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsrdwrv
+mimfs_fsrdwrv_SOURCES = ../fsrdwrv/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsrdwrv.scn
+#dist_rtems_tests_DATA += mimfs_fsrdwrv.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsrdwrv_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsrdwrv_OBJECTS) $(mimfs_fsrdwrv_LDADD)
+LINK_LIBS = $(mimfs_fsrdwrv_LDLIBS)
+
+mimfs_fsrdwrv$(EXEEXT): $(mimfs_fsrdwrv_OBJECTS) $(mimfs_fsrdwrv_DEPENDENCIES)
+ @rm -f mimfs_fsrdwrv$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsreaddir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsreaddir/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsreaddir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsreaddir/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsreaddir
+mimfs_fsreaddir_SOURCES = ../fsreaddir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsreaddir.scn
+#dist_rtems_tests_DATA += mimfs_fsreaddir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsreaddir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsreaddir_OBJECTS) $(mimfs_fsreaddir_LDADD)
+LINK_LIBS = $(mimfs_fsreaddir_LDLIBS)
+
+mimfs_fsreaddir$(EXEEXT): $(mimfs_fsreaddir_OBJECTS) $(mimfs_fsreaddir_DEPENDENCIES)
+ @rm -f mimfs_fsreaddir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsrename/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsrename/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsrename/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsrename/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsrename
+mimfs_fsrename_SOURCES = ../fsrename/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsrename.scn
+#dist_rtems_tests_DATA += mimfs_fsrename.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsrename_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsrename_OBJECTS) $(mimfs_fsrename_LDADD)
+LINK_LIBS = $(mimfs_fsrename_LDLIBS)
+
+mimfs_fsrename$(EXEEXT): $(mimfs_fsrename_OBJECTS) $(mimfs_fsrename_DEPENDENCIES)
+ @rm -f mimfs_fsrename$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsrmdir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsrmdir/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsrmdir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsrmdir/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsrmdir
+mimfs_fsrmdir_SOURCES = ../fsrmdir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsrmdir.scn
+#dist_rtems_tests_DATA += mimfs_fsrmdir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsrmdir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsrmdir_OBJECTS) $(mimfs_fsrmdir_LDADD)
+LINK_LIBS = $(mimfs_fsrmdir_LDLIBS)
+
+mimfs_fsrmdir$(EXEEXT): $(mimfs_fsrmdir_OBJECTS) $(mimfs_fsrmdir_DEPENDENCIES)
+ @rm -f mimfs_fsrmdir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsrwfile/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsrwfile/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsrwfile/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsrwfile/Makefile.am Mon Aug 1 09:29:52 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsrwfile
+mimfs_fsrwfile_SOURCES = ../fsrwfile/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsrwfile.scn
+#dist_rtems_tests_DATA += mimfs_fsrwfile.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsrwfile_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsrwfile_OBJECTS) $(mimfs_fsrwfile_LDADD)
+LINK_LIBS = $(mimfs_fsrwfile_LDLIBS)
+
+mimfs_fsrwfile$(EXEEXT): $(mimfs_fsrwfile_OBJECTS) $(mimfs_fsrwfile_DEPENDENCIES)
+ @rm -f mimfs_fsrwfile$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsstat/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsstat/.cvsignore Mon Aug 1 09:29:52 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fsstat/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fsstat/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fsstat
+mimfs_fsstat_SOURCES = ../fsstat/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fsstat.scn
+#dist_rtems_tests_DATA += mimfs_fsstat.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fsstat_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsstat_OBJECTS) $(mimfs_fsstat_LDADD)
+LINK_LIBS = $(mimfs_fsstat_LDLIBS)
+
+mimfs_fsstat$(EXEEXT): $(mimfs_fsstat_OBJECTS) $(mimfs_fsstat_DEPENDENCIES)
+ @rm -f mimfs_fsstat$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fssymlink/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:53 2011
+++ rtems/testsuites/fstests/mimfs_fssymlink/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fssymlink/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mimfs_fssymlink/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fssymlink
+mimfs_fssymlink_SOURCES = ../fssymlink/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fssymlink.scn
+#dist_rtems_tests_DATA += mimfs_fssymlink.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fssymlink_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fssymlink_OBJECTS) $(mimfs_fssymlink_LDADD)
+LINK_LIBS = $(mimfs_fssymlink_LDLIBS)
+
+mimfs_fssymlink$(EXEEXT): $(mimfs_fssymlink_OBJECTS) $(mimfs_fssymlink_DEPENDENCIES)
+ @rm -f mimfs_fssymlink$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mimfs_fstruncate/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mimfs_fstruncate/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mimfs_fstruncate/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mimfs_fstruncate/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mimfs_fstruncate
+mimfs_fstruncate_SOURCES = ../fstruncate/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mimfs_support/fs_support.c ../mimfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mimfs_fstruncate.scn
+#dist_rtems_tests_DATA += mimfs_fstruncate.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mimfs_fstruncate_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fstruncate_OBJECTS) $(mimfs_fstruncate_LDADD)
+LINK_LIBS = $(mimfs_fstruncate_LDLIBS)
+
+mimfs_fstruncate$(EXEEXT): $(mimfs_fstruncate_OBJECTS) $(mimfs_fstruncate_DEPENDENCIES)
+ @rm -f mimfs_fstruncate$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u rtems/testsuites/fstests/mimfs_support/fs_config.h:1.1 rtems/testsuites/fstests/mimfs_support/fs_config.h:1.2
--- rtems/testsuites/fstests/mimfs_support/fs_config.h:1.1 Wed Apr 20 16:30:15 2011
+++ rtems/testsuites/fstests/mimfs_support/fs_config.h Mon Aug 1 09:29:53 2011
@@ -2,9 +2,19 @@
* $Id$
*/
+#ifndef __MIMFS_SUPPORT_h
+#define __MIMFS_SUPPORT_h
+
+#define MIMFS_TEST
+
#define FILESYSTEM "MOUNTED IMFS"
#define BASE_FOR_TEST "/mnt/"
+#ifdef __cplusplus
+extern "C" {
+#endif
-extern void test_initialize_filesystem(void);
+#ifdef __cplusplus
+};
+#endif
-extern void test_shutdown_filesystem(void);
+#endif
diff -u rtems/testsuites/fstests/mimfs_support/fs_support.c:1.1 rtems/testsuites/fstests/mimfs_support/fs_support.c:1.2
--- rtems/testsuites/fstests/mimfs_support/fs_support.c:1.1 Wed Apr 20 16:30:15 2011
+++ rtems/testsuites/fstests/mimfs_support/fs_support.c Mon Aug 1 09:29:53 2011
@@ -5,37 +5,67 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include "pmacros.h"
+
+#include "fs_config.h"
#include <sys/stat.h>
#include <sys/types.h>
-#include "pmacros.h"
-#include "fs_config.h"
-
#include <rtems/libio.h>
+
+
void test_initialize_filesystem(void)
{
- int rc;
+ int rc=0;
+ rc=mkdir(BASE_FOR_TEST,0777);
+ rtems_test_assert(rc==0);
- rc = mkdir( BASE_FOR_TEST, 0777 );
- rtems_test_assert( rc == 0 );
- rc = mount(
- "null",
- BASE_FOR_TEST,
- "imfs",
- RTEMS_FILESYSTEM_READ_ONLY,
- NULL
- );
- rtems_test_assert( rc == 0 );
+ rc=mount(NULL,
+ BASE_FOR_TEST,
+ "imfs",
+ RTEMS_FILESYSTEM_READ_WRITE,
+ NULL);
+ rtems_test_assert(rc==0);
}
+
void test_shutdown_filesystem(void)
{
- int rc;
+ int rc=0;
+ rc=unmount(BASE_FOR_TEST) ;
+ rtems_test_assert(rc==0);
+}
- rc = unmount( BASE_FOR_TEST );
- rtems_test_assert( rc == 0 );
+/* configuration information */
+
+/* drivers */
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+/**
+ * Configure base RTEMS resources.
+ */
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_MEMORY_OVERHEAD 512
+#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited (10)
+#define CONFIGURE_MAXIMUM_SEMAPHORES rtems_resource_unlimited (10)
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES rtems_resource_unlimited (6)
+#define CONFIGURE_MAXIMUM_PARTITIONS rtems_resource_unlimited (4)
+#define CONFIGURE_MAXIMUM_TIMERS 10
+
+
+/**
+ * Configure file system and libblock.
+ */
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 100
+#define CONFIGURE_MAXIMUM_DRIVERS 100
+#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
+
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
-}
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsfchx/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mrfs_fsfchx/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsfchx/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mrfs_fsfchx/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsfchx
+mrfs_fsfchx_SOURCES = ../fsfchx/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsfchx.scn
+#dist_rtems_tests_DATA += mrfs_fsfchx.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsfchx_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsfchx_OBJECTS) $(mrfs_fsfchx_LDADD)
+LINK_LIBS = $(mrfs_fsfchx_LDLIBS)
+
+mrfs_fsfchx$(EXEEXT): $(mrfs_fsfchx_OBJECTS) $(mrfs_fsfchx_DEPENDENCIES)
+ @rm -f mrfs_fsfchx$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsfile01/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mrfs_fsfile01/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsfile01/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mrfs_fsfile01/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,37 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsfile01
+mrfs_fsfile01_SOURCES = ../fsfile01/test_cat.c ../fsfile01/test.c\
+ ../fsfile01/test_write.c ../fsfile01/test_extend.c\
+ ../support/ramdisk_support.c ../support/fstest_support.c\
+ ../support/fstest_support.h ../support/ramdisk_support.h\
+ ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsfile01.scn
+#dist_rtems_tests_DATA += mrfs_fsfile01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsfile01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsfile01_OBJECTS) $(mrfs_fsfile01_LDADD)
+LINK_LIBS = $(mrfs_fsfile01_LDLIBS)
+
+mrfs_fsfile01$(EXEEXT): $(mrfs_fsfile01_OBJECTS) $(mrfs_fsfile01_DEPENDENCIES)
+ @rm -f mrfs_fsfile01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsfile02/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mrfs_fsfile02/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsfile02/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mrfs_fsfile02/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsfile02
+mrfs_fsfile02_SOURCES = ../fsfile02/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsfile02.scn
+#dist_rtems_tests_DATA += mrfs_fsfile02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsfile02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsfile02_OBJECTS) $(mrfs_fsfile02_LDADD)
+LINK_LIBS = $(mrfs_fsfile02_LDLIBS)
+
+mrfs_fsfile02$(EXEEXT): $(mrfs_fsfile02_OBJECTS) $(mrfs_fsfile02_DEPENDENCIES)
+ @rm -f mrfs_fsfile02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsfstest/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:54 2011
+++ rtems/testsuites/fstests/mrfs_fsfstest/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsfstest/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsfstest/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsfstest
+mrfs_fsfstest_SOURCES = ../fsfstest/fs-test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsfstest.scn
+#dist_rtems_tests_DATA += mrfs_fsfstest.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsfstest_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsfstest_OBJECTS) $(mrfs_fsfstest_LDADD)
+LINK_LIBS = $(mrfs_fsfstest_LDLIBS)
+
+mrfs_fsfstest$(EXEEXT): $(mrfs_fsfstest_OBJECTS) $(mrfs_fsfstest_DEPENDENCIES)
+ @rm -f mrfs_fsfstest$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsimfs01/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsimfs01/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsimfs01/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsimfs01/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsimfs01
+mrfs_fsimfs01_SOURCES = ../fsimfs01/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsimfs01.scn
+#dist_rtems_tests_DATA += mrfs_fsimfs01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsimfs01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsimfs01_OBJECTS) $(mrfs_fsimfs01_LDADD)
+LINK_LIBS = $(mrfs_fsimfs01_LDLIBS)
+
+mrfs_fsimfs01$(EXEEXT): $(mrfs_fsimfs01_OBJECTS) $(mrfs_fsimfs01_DEPENDENCIES)
+ @rm -f mrfs_fsimfs01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsimfs02/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsimfs02/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsimfs02/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsimfs02/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsimfs02
+mrfs_fsimfs02_SOURCES = ../fsimfs02/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsimfs02.scn
+#dist_rtems_tests_DATA += mrfs_fsimfs02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsimfs02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsimfs02_OBJECTS) $(mrfs_fsimfs02_LDADD)
+LINK_LIBS = $(mrfs_fsimfs02_LDLIBS)
+
+mrfs_fsimfs02$(EXEEXT): $(mrfs_fsimfs02_OBJECTS) $(mrfs_fsimfs02_DEPENDENCIES)
+ @rm -f mrfs_fsimfs02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fslink/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fslink/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fslink/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fslink/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fslink
+mrfs_fslink_SOURCES = ../fslink/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fslink.scn
+#dist_rtems_tests_DATA += mrfs_fslink.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fslink_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fslink_OBJECTS) $(mrfs_fslink_LDADD)
+LINK_LIBS = $(mrfs_fslink_LDLIBS)
+
+mrfs_fslink$(EXEEXT): $(mrfs_fslink_OBJECTS) $(mrfs_fslink_DEPENDENCIES)
+ @rm -f mrfs_fslink$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsmkdir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsmkdir/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsmkdir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsmkdir/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsmkdir
+mrfs_fsmkdir_SOURCES = ../fsmkdir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsmkdir.scn
+#dist_rtems_tests_DATA += mrfs_fsmkdir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsmkdir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsmkdir_OBJECTS) $(mrfs_fsmkdir_LDADD)
+LINK_LIBS = $(mrfs_fsmkdir_LDLIBS)
+
+mrfs_fsmkdir$(EXEEXT): $(mrfs_fsmkdir_OBJECTS) $(mrfs_fsmkdir_DEPENDENCIES)
+ @rm -f mrfs_fsmkdir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsopen/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsopen/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsopen/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:55 2011
+++ rtems/testsuites/fstests/mrfs_fsopen/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsopen
+mrfs_fsopen_SOURCES = ../fsopen/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsopen.scn
+#dist_rtems_tests_DATA += mrfs_fsopen.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsopen_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsopen_OBJECTS) $(mrfs_fsopen_LDADD)
+LINK_LIBS = $(mrfs_fsopen_LDLIBS)
+
+mrfs_fsopen$(EXEEXT): $(mrfs_fsopen_OBJECTS) $(mrfs_fsopen_DEPENDENCIES)
+ @rm -f mrfs_fsopen$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsrdwrv/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsrdwrv/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsrdwrv/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsrdwrv/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsrdwrv
+mrfs_fsrdwrv_SOURCES = ../fsrdwrv/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsrdwrv.scn
+#dist_rtems_tests_DATA += mrfs_fsrdwrv.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsrdwrv_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsrdwrv_OBJECTS) $(mrfs_fsrdwrv_LDADD)
+LINK_LIBS = $(mrfs_fsrdwrv_LDLIBS)
+
+mrfs_fsrdwrv$(EXEEXT): $(mrfs_fsrdwrv_OBJECTS) $(mrfs_fsrdwrv_DEPENDENCIES)
+ @rm -f mrfs_fsrdwrv$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsreaddir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsreaddir/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsreaddir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsreaddir/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsreaddir
+mrfs_fsreaddir_SOURCES = ../fsreaddir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsreaddir.scn
+#dist_rtems_tests_DATA += mrfs_fsreaddir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsreaddir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsreaddir_OBJECTS) $(mrfs_fsreaddir_LDADD)
+LINK_LIBS = $(mrfs_fsreaddir_LDLIBS)
+
+mrfs_fsreaddir$(EXEEXT): $(mrfs_fsreaddir_OBJECTS) $(mrfs_fsreaddir_DEPENDENCIES)
+ @rm -f mrfs_fsreaddir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsrename/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsrename/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsrename/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsrename/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsrename
+mrfs_fsrename_SOURCES = ../fsrename/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsrename.scn
+#dist_rtems_tests_DATA += mrfs_fsrename.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsrename_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsrename_OBJECTS) $(mrfs_fsrename_LDADD)
+LINK_LIBS = $(mrfs_fsrename_LDLIBS)
+
+mrfs_fsrename$(EXEEXT): $(mrfs_fsrename_OBJECTS) $(mrfs_fsrename_DEPENDENCIES)
+ @rm -f mrfs_fsrename$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsrmdir/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsrmdir/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsrmdir/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsrmdir/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsrmdir
+mrfs_fsrmdir_SOURCES = ../fsrmdir/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsrmdir.scn
+#dist_rtems_tests_DATA += mrfs_fsrmdir.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsrmdir_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsrmdir_OBJECTS) $(mrfs_fsrmdir_LDADD)
+LINK_LIBS = $(mrfs_fsrmdir_LDLIBS)
+
+mrfs_fsrmdir$(EXEEXT): $(mrfs_fsrmdir_OBJECTS) $(mrfs_fsrmdir_DEPENDENCIES)
+ @rm -f mrfs_fsrmdir$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsrwfile/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsrwfile/.cvsignore Mon Aug 1 09:29:53 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsrwfile/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsrwfile/Makefile.am Mon Aug 1 09:29:53 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsrwfile
+mrfs_fsrwfile_SOURCES = ../fsrwfile/init.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsrwfile.scn
+#dist_rtems_tests_DATA += mrfs_fsrwfile.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsrwfile_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsrwfile_OBJECTS) $(mrfs_fsrwfile_LDADD)
+LINK_LIBS = $(mrfs_fsrwfile_LDLIBS)
+
+mrfs_fsrwfile$(EXEEXT): $(mrfs_fsrwfile_OBJECTS) $(mrfs_fsrwfile_DEPENDENCIES)
+ @rm -f mrfs_fsrwfile$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsstat/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:56 2011
+++ rtems/testsuites/fstests/mrfs_fsstat/.cvsignore Mon Aug 1 09:29:54 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fsstat/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/mrfs_fsstat/Makefile.am Mon Aug 1 09:29:54 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fsstat
+mrfs_fsstat_SOURCES = ../fsstat/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fsstat.scn
+#dist_rtems_tests_DATA += mrfs_fsstat.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fsstat_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsstat_OBJECTS) $(mrfs_fsstat_LDADD)
+LINK_LIBS = $(mrfs_fsstat_LDLIBS)
+
+mrfs_fsstat$(EXEEXT): $(mrfs_fsstat_OBJECTS) $(mrfs_fsstat_DEPENDENCIES)
+ @rm -f mrfs_fsstat$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fssymlink/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/mrfs_fssymlink/.cvsignore Mon Aug 1 09:29:54 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fssymlink/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/mrfs_fssymlink/Makefile.am Mon Aug 1 09:29:54 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fssymlink
+mrfs_fssymlink_SOURCES = ../fssymlink/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fssymlink.scn
+#dist_rtems_tests_DATA += mrfs_fssymlink.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fssymlink_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fssymlink_OBJECTS) $(mrfs_fssymlink_LDADD)
+LINK_LIBS = $(mrfs_fssymlink_LDLIBS)
+
+mrfs_fssymlink$(EXEEXT): $(mrfs_fssymlink_OBJECTS) $(mrfs_fssymlink_DEPENDENCIES)
+ @rm -f mrfs_fssymlink$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_fstruncate/.cvsignore:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/mrfs_fstruncate/.cvsignore Mon Aug 1 09:29:54 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/fstests/mrfs_fstruncate/Makefile.am:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/mrfs_fstruncate/Makefile.am Mon Aug 1 09:29:54 2011
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = mrfs_fstruncate
+mrfs_fstruncate_SOURCES = ../fstruncate/test.c ../support/ramdisk_support.c\
+ ../support/fstest_support.c ../support/fstest_support.h\
+ ../support/ramdisk_support.h ../support/fstest.h ../../psxtests/include/pmacros.h \
+ ../mrfs_support/fs_support.c ../mrfs_support/fs_config.h
+
+
+#dist_rtems_tests_DATA = mrfs_fstruncate.scn
+#dist_rtems_tests_DATA += mrfs_fstruncate.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+mrfs_fstruncate_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fstruncate_OBJECTS) $(mrfs_fstruncate_LDADD)
+LINK_LIBS = $(mrfs_fstruncate_LDLIBS)
+
+mrfs_fstruncate$(EXEEXT): $(mrfs_fstruncate_OBJECTS) $(mrfs_fstruncate_DEPENDENCIES)
+ @rm -f mrfs_fstruncate$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/fstests/mrfs_support/fs_config.h:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/mrfs_support/fs_config.h Mon Aug 1 09:29:54 2011
@@ -0,0 +1,21 @@
+/*
+ * $Id$
+ */
+
+#ifndef __MIMFS_SUPPORT_h
+#define __MIMFS_SUPPORT_h
+
+#define MRFS_TEST
+
+#define FILESYSTEM "MOUNTED RFS"
+#define BASE_FOR_TEST "/mnt/"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
diff -u /dev/null rtems/testsuites/fstests/mrfs_support/fs_support.c:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/mrfs_support/fs_support.c Mon Aug 1 09:29:54 2011
@@ -0,0 +1,85 @@
+/*
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "pmacros.h"
+
+#include "fs_config.h"
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <rtems/libio.h>
+#include <rtems/rtems-rfs-format.h>
+#include "ramdisk_support.h"
+
+#define BLOCK_SIZE (512)
+
+rtems_rfs_format_config config=
+{
+block_size:BLOCK_SIZE
+};
+
+
+void test_initialize_filesystem(void)
+{
+ int rc=0;
+ rc=mkdir(BASE_FOR_TEST,0777);
+ rtems_test_assert(rc==0);
+
+ init_ramdisk();
+
+ rc=rtems_rfs_format(RAMDISK_PATH,&config);
+ rtems_test_assert(rc==0);
+
+ rc=mount(RAMDISK_PATH,
+ BASE_FOR_TEST,
+ "rfs",
+ RTEMS_FILESYSTEM_READ_WRITE,
+ NULL);
+ rtems_test_assert(rc==0);
+}
+
+
+void test_shutdown_filesystem(void)
+{
+ int rc=0;
+ rc=unmount(BASE_FOR_TEST) ;
+ rtems_test_assert(rc==0);
+ del_ramdisk();
+}
+
+/* configuration information */
+
+/* drivers */
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+/**
+ * Configure base RTEMS resources.
+ */
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_MEMORY_OVERHEAD 512
+#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited (10)
+#define CONFIGURE_MAXIMUM_SEMAPHORES rtems_resource_unlimited (10)
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES rtems_resource_unlimited (6)
+#define CONFIGURE_MAXIMUM_PARTITIONS rtems_resource_unlimited (4)
+#define CONFIGURE_MAXIMUM_TIMERS 10
+
+
+/**
+ * Configure file system and libblock.
+ */
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 100
+#define CONFIGURE_MAXIMUM_DRIVERS 100
+#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
+
+#define CONFIGURE_FILESYSTEM_RFS
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
diff -u /dev/null rtems/testsuites/fstests/support/fstest.h:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/support/fstest.h Mon Aug 1 09:29:54 2011
@@ -0,0 +1,23 @@
+/*
+ *
+ * $Id$
+ */
+
+#ifndef __FSTEST_H
+#define __FSTEST_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pmacros.h>
+
+#include "fs_config.h"
+
+#define TIME_PRECISION (2)
+#define time_equal(x,y) (abs((x)-(y))<TIME_PRECISION)
+#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
+
+
diff -u /dev/null rtems/testsuites/fstests/support/fstest_support.h:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/support/fstest_support.h Mon Aug 1 09:29:54 2011
@@ -0,0 +1,33 @@
+
+/*
+ *
+ * $Id$
+ */
+#ifndef __FSTEST_SUPPORT_H
+#define __FSTEST_SUPPORT_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "pmacros.h"
+
+#include "rtems.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern rtems_task Init(
+ rtems_task_argument ignored
+);
+
+extern void test(void);
+
+extern void test_initialize_filesystem(void);
+
+extern void test_shutdown_filesystem(void);
+#ifdef __cplusplus
+};
+#endif
+
+#endif
diff -u /dev/null rtems/testsuites/fstests/support/fstest_support.c:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/support/fstest_support.c Mon Aug 1 09:29:54 2011
@@ -0,0 +1,98 @@
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "rtems.h"
+
+#include "fstest_support.h"
+#include "fs_config.h"
+
+#define TEMP_DIR "waterbuffalo"
+
+
+/* Break out of a chroot() environment in C */
+void break_out_of_chroot(void)
+{
+
+ int x; /* Used to move up a directory tree */
+ int done=0; /* Are we done yet ? */
+ int dir_fd; /* File descriptor to directory */
+ struct stat sbuf; /* The stat() buffer */
+ chdir("/");
+
+ if (stat(TEMP_DIR,&sbuf)<0) {
+ if (errno==ENOENT) {
+ if (mkdir(TEMP_DIR,0755)<0) {
+ fprintf(stderr,"Failed to create %s - %s\n", TEMP_DIR,
+ strerror(errno));
+ exit(1);
+ }
+ } else {
+ fprintf(stderr,"Failed to stat %s - %s\n", TEMP_DIR,
+ strerror(errno));
+ exit(1);
+ }
+ } else if (!S_ISDIR(sbuf.st_mode)) {
+ fprintf(stderr,"Error - %s is not a directory!\n",TEMP_DIR);
+ exit(1);
+ }
+
+ if ((dir_fd=open(".",O_RDONLY))<0) {
+ fprintf(stderr,"Failed to open \".\" for reading - %s\n", strerror(errno));
+ exit(1);
+ }
+
+ if (chroot(TEMP_DIR)<0) {
+ fprintf(stderr,"Failed to chroot to %s - %s\n",TEMP_DIR,
+ strerror(errno));
+ exit(1);
+ }
+
+ if (fchdir(dir_fd)<0) {
+ fprintf(stderr,"Failed to fchdir - %s\n",
+ strerror(errno));
+ exit(1);
+ }
+ close(dir_fd);
+ chdir("..");
+ chroot(".");
+
+}
+
+
+/*
+ * Main entry point of every filesystem test
+ */
+
+rtems_task Init(
+ rtems_task_argument ignored)
+{
+ int rc=0;
+ puts( "\n\n*** FILE SYSTEM TEST ( " FILESYSTEM " ) ***" );
+
+ puts( "Initializing filesystem " FILESYSTEM );
+ test_initialize_filesystem();
+ rc=chdir(BASE_FOR_TEST);
+ rtems_test_assert(rc==0);
+
+ rc=chroot(BASE_FOR_TEST);
+ rtems_test_assert(rc==0);
+
+ test();
+
+ break_out_of_chroot();
+ chdir("/");
+
+
+ puts( "\n\nShutting down filesystem " FILESYSTEM );
+ test_shutdown_filesystem();
+
+ puts( "*** END OF FILE SYSTEM TEST ( " FILESYSTEM " ) ***" );
+ rtems_test_exit(0);
+
+}
+
diff -u /dev/null rtems/testsuites/fstests/support/ramdisk_support.h:1.1
--- /dev/null Mon Aug 1 10:11:57 2011
+++ rtems/testsuites/fstests/support/ramdisk_support.h Mon Aug 1 09:29:54 2011
@@ -0,0 +1,26 @@
+/*
+ *
+ * $Id$
+ */
+#ifndef __RAMDISK_SUPPORT_H
+#define __RAMDISK_SUPPORT_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "fstest_support.h"
+
+#define RAMDISK_BLOCK_SIZE (512)
+#define RAMDISK_BLOCK_COUNT (1024)
+#define RAMDISK_PATH "/dev/ramdisk"
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void init_ramdisk(void);
+extern void del_ramdisk(void );
+#ifdef __cplusplus
+};
+#endif
+
+#endif
diff -u /dev/null rtems/testsuites/fstests/support/ramdisk_support.c:1.1
--- /dev/null Mon Aug 1 10:11:58 2011
+++ rtems/testsuites/fstests/support/ramdisk_support.c Mon Aug 1 09:29:54 2011
@@ -0,0 +1,46 @@
+
+/*
+ *
+ * $Id$
+ */
+#include <rtems/ramdisk.h>
+#include <rtems/blkdev.h>
+#include <rtems/libio.h>
+
+#include "ramdisk_support.h"
+/*
+ * Ramdisk information
+ */
+
+dev_t dev = 0;
+
+void init_ramdisk(void)
+{
+
+ int rc=0;
+ rc =rtems_disk_io_initialize();
+ rtems_test_assert( rc == 0 );
+ rc =ramdisk_register(RAMDISK_BLOCK_SIZE,RAMDISK_BLOCK_COUNT,\
+ false,RAMDISK_PATH,&dev);
+ rtems_test_assert( rc == 0 );
+
+}
+void del_ramdisk(void )
+{
+ int rc=0;
+ rtems_device_major_number major=0;
+ rtems_device_minor_number minor=0;
+
+ rc=rtems_disk_delete (dev);
+ rtems_test_assert( rc == 0 );
+
+ rtems_filesystem_split_dev_t(dev,major,minor);
+
+ rc=rtems_io_unregister_driver(major);
+ rtems_test_assert( rc == 0 );
+
+ rc=rtems_disk_io_done();
+ rtems_test_assert( rc == 0 );
+}
+
+
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110801/8da7fe85/attachment.html>
More information about the vc
mailing list