2011-08-01 Xiang Cui <medivhc@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.
This commit is contained in:
Joel Sherrill
2011-08-01 14:29:54 +00:00
parent bc018b12eb
commit 7336d4af62
26 changed files with 1410 additions and 28 deletions

View File

@@ -1,3 +1,95 @@
2011-08-01 Xiang Cui <medivhc@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@rtems.org>
* Makefile.am: Remove EXTRA_DIST.

View File

@@ -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

View File

@@ -77,8 +77,75 @@ AC_CHECK_SIZEOF([blksize_t])
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

View File

@@ -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

View File

@@ -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 ***" );
}

View File

@@ -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.

View File

@@ -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 ***" );
}

View File

@@ -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@.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

View File

@@ -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@.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

View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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@.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

View File

@@ -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@.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

View File

@@ -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

View File

@@ -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;
rc = unmount( BASE_FOR_TEST );
rtems_test_assert( rc == 0 );
int 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>

View File

@@ -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@.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

View File

@@ -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@.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

View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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 );
}

View File

@@ -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