change log for rtems (2011-04-20)

rtems-vc at rtems.org rtems-vc at rtems.org
Wed Apr 20 22:10:20 UTC 2011


 *joel*:
2011-04-20	Joel Sherrill <joel.sherrill at oarcorp.com>

	Add initial test to File System Test Suite.
	* .cvsignore, ChangeLog, Makefile.am, configure.ac, fs01/fs91.doc,
	fs01/init.c, imfs_fs01/.cvsignore, imfs_fs01/Makefile.am,
	imfs_fs01/imfs_fs01.scn, imfs_support/fs_config.h,
	imfs_support/fs_support.c, mimfs_fs01/.cvsignore,
	mimfs_fs01/Makefile.am, mimfs_fs01/mimfs_fs01.scn,
	mimfs_support/fs_config.h, mimfs_support/fs_support.c: New files.

A    1.1  testsuites/fstests/.cvsignore
A    1.1  testsuites/fstests/ChangeLog
A    1.1  testsuites/fstests/Makefile.am
A    1.1  testsuites/fstests/configure.ac
A    1.1  testsuites/fstests/fs01/fs91.doc
A    1.1  testsuites/fstests/fs01/init.c
A    1.1  testsuites/fstests/imfs_fs01/.cvsignore
A    1.1  testsuites/fstests/imfs_fs01/Makefile.am
A    1.1  testsuites/fstests/imfs_fs01/imfs_fs01.scn
A    1.1  testsuites/fstests/imfs_support/fs_config.h
A    1.1  testsuites/fstests/imfs_support/fs_support.c
A    1.1  testsuites/fstests/mimfs_fs01/.cvsignore
A    1.1  testsuites/fstests/mimfs_fs01/Makefile.am
A    1.1  testsuites/fstests/mimfs_fs01/mimfs_fs01.scn
A    1.1  testsuites/fstests/mimfs_support/fs_config.h
A    1.1  testsuites/fstests/mimfs_support/fs_support.c

diff -u /dev/null rtems/testsuites/fstests/.cvsignore:1.1
--- /dev/null	Wed Apr 20 17:10:18 2011
+++ rtems/testsuites/fstests/.cvsignore	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,15 @@
+aclocal.m4
+autom4te*.cache
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+Makefile
+Makefile.in
+missing
+mkinstalldirs

diff -u /dev/null rtems/testsuites/fstests/ChangeLog:1.1
--- /dev/null	Wed Apr 20 17:10:18 2011
+++ rtems/testsuites/fstests/ChangeLog	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,10 @@
+2011-04-20	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	Add initial test to File System Test Suite.
+	* .cvsignore, ChangeLog, Makefile.am, configure.ac, fs01/fs91.doc,
+	fs01/init.c, imfs_fs01/.cvsignore, imfs_fs01/Makefile.am,
+	imfs_fs01/imfs_fs01.scn, imfs_support/fs_config.h,
+	imfs_support/fs_support.c, mimfs_fs01/.cvsignore,
+	mimfs_fs01/Makefile.am, mimfs_fs01/mimfs_fs01.scn,
+	mimfs_support/fs_config.h, mimfs_support/fs_support.c: New files.
+

diff -u /dev/null rtems/testsuites/fstests/Makefile.am:1.1
--- /dev/null	Wed Apr 20 17:10:18 2011
+++ rtems/testsuites/fstests/Makefile.am	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,15 @@
+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../aclocal
+
+SUBDIRS = \
+  imfs_fs01 \
+  mimfs_fs01
+
+DIST_SUBDIRS = $(SUBDIRS)
+EXTRA_DIST = fs01/init.c fs01/fs01.doc
+
+include $(top_srcdir)/../automake/subdirs.am
+include $(top_srcdir)/../automake/local.am

diff -u /dev/null rtems/testsuites/fstests/configure.ac:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/configure.ac	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,84 @@
+## Process this file with autoconf to produce a configure script.
+## 
+## $Id$
+
+AC_PREREQ([2.68])
+AC_INIT([rtems-c-src-tests-fstests],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
+AC_CONFIG_SRCDIR([imfs_support])
+RTEMS_TOP([../..],[..])
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE([no-define foreign 1.11.1])
+AM_MAINTAINER_MODE
+
+RTEMS_ENV_RTEMSBSP
+
+RTEMS_PROJECT_ROOT
+
+RTEMS_PROG_CC_FOR_TARGET
+
+RTEMS_CANONICALIZE_TOOLS
+
+RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
+AC_CONFIG_HEADER([config.h])
+
+RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API])
+AM_CONDITIONAL(HAS_POSIX,test x"${rtems_cv_RTEMS_POSIX_API}" = x"yes")
+
+# but newlib doesn't have sys/mman.h
+AC_CHECK_HEADERS([sys/mman.h])
+
+# FIXME: newlib should supply declaration of pthread_rwlock_unlock()
+AC_CHECK_DECLS([pthread_rwlock_unlock],[],[],[[#include <pthread.h>]])
+
+# FIXME: newlib should supply declaration of pthread_atfork()
+AC_CHECK_DECLS([pthread_atfork],[],[],[[#include <pthread.h>]])
+
+# FIXME: RTEMS presumes pthread_attr_getcputime to be IEEE Std 1003.1
+# Likely an anachronism in RTEMS.
+AC_CHECK_DECLS([pthread_attr_getcputime],[],[],[[#include <pthread.h>]])
+
+# FIXME: RTEMS presumes pthread_attr_getcputime to be IEEE Std 1003.1
+# Likely an anachronism in RTEMS.
+AC_CHECK_DECLS([pthread_attr_getcputime],[],[],[[#include <pthread.h>]])
+
+# FIXME: RTEMS presumes pthread_attr_setcputime to be IEEE Std 1003.1
+# Likely an anachronism in RTEMS.
+AC_CHECK_DECLS([pthread_attr_setcputime],[],[],[[#include <pthread.h>]])
+
+# Added to pthreads after initial revision.  May not be in toolset
+AC_CHECK_DECLS([pthread_attr_getstack],[],[],[[#include <pthread.h>]])
+
+# Added to pthreads after initial revision.  May not be in toolset
+AC_CHECK_DECLS([pthread_attr_setstack],[],[],[[#include <pthread.h>]])
+
+# Added to pthreads after initial revision.  May not be in toolset
+AC_CHECK_DECLS([pthread_attr_getguardsize],[],[],[[#include <pthread.h>]])
+
+# Added to pthreads after initial revision.  May not be in toolset
+AC_CHECK_DECLS([pthread_attr_setguardsize],[],[],[[#include <pthread.h>]])
+
+# FIXME: adjtime is a non-standardized BSD/Linux extension
+# RTEMS should not rely on adjtime
+AC_CHECK_DECLS([adjtime],[],[],[[#include <sys/time.h>]])
+
+# FIXME: IEEE Std 1003.1-2008 mandates mprotect in sys/mman.h,
+# RTEMS provides a stub, despite newlib doesn't have sys/mman.h
+AC_CHECK_DECLS([mprotect],[],[],[[#include <sys/mman.h>]])
+
+# FIXME: IEEE Std 1003.1-2008 mandates seteuid in unistd.h
+# RTEMS provides it, despite newlib doesn't declare it.
+AC_CHECK_DECLS([seteuid],[],[],[#include <unistd.h>])
+
+# FIXME: We should get rid of this. It's a cludge.
+AC_CHECK_SIZEOF([off_t])
+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_OUTPUT

diff -u /dev/null rtems/testsuites/fstests/fs01/init.c:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/fs01/init.c	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,117 @@
+/*
+ *
+ *  $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pmacros.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <unistd.h>
+
+#include "fs_config.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.";
+
+rtems_task Init(
+  rtems_task_argument ignored
+)
+{
+  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 (" FILESYSTEM ") ***" );
+
+  puts( "Initializing filesystem " FILESYSTEM );
+  test_initialize_filesystem();
+
+  printf( "sizeof(buffer) = %d\n", len);
+  total_written = 0;
+
+  /*
+   *  Create the file
+   */
+  puts( "Creating " BASE_FOR_TEST "tester" );
+  fd = creat(BASE_FOR_TEST "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( BASE_FOR_TEST "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" );
+       rtems_test_exit( 0 );
+     }
+  }
+  if ( total_written != total_read ) {
+    printf( "Not enough data read back\\n" );
+    rtems_test_exit( 0 );
+  }
+  printf("Successfully read: %d\n", total_read);
+  free(bufr2);
+  rc = close(fd);
+  rtems_test_assert( rc == 0 );
+
+  puts( "Shutting down filesystem " FILESYSTEM );
+  test_shutdown_filesystem();
+
+  puts( "*** END OF SIMPLE READ/WRITE TEST (" FILESYSTEM ") ***" );
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+/* NOTICE: the clock driver is explicitly disabled */
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_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 4
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+
+/* end of file */

diff -u /dev/null rtems/testsuites/fstests/imfs_fs01/.cvsignore:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/imfs_fs01/.cvsignore	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

diff -u /dev/null rtems/testsuites/fstests/imfs_fs01/Makefile.am:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/imfs_fs01/Makefile.am	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,30 @@
+##
+##  $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = imfs_fs01
+imfs_fs01_SOURCES = ../fs01/init.c ../../psxtests/include/pmacros.h \
+  ../imfs_support/fs_support.c ../imfs_support/fs_config.h
+
+dist_rtems_tests_DATA = imfs_fs01.scn
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+imfs_fs01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fs01_OBJECTS) $(imfs_fs01_LDADD)
+LINK_LIBS = $(imfs_fs01_LDLIBS)
+
+imfs_fs01$(EXEEXT): $(imfs_fs01_OBJECTS) $(imfs_fs01_DEPENDENCIES)
+	@rm -f imfs_fs01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am

diff -u /dev/null rtems/testsuites/fstests/imfs_support/fs_config.h:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/imfs_support/fs_config.h	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,10 @@
+/*
+ *  $Id$
+ */
+
+#define FILESYSTEM "IMFS"
+#define BASE_FOR_TEST ""
+
+extern void test_initialize_filesystem(void);
+
+extern void test_shutdown_filesystem(void);

diff -u /dev/null rtems/testsuites/fstests/imfs_support/fs_support.c:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/imfs_support/fs_support.c	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,11 @@
+/*
+ *  $Id$
+ */
+
+void test_initialize_filesystem(void)
+{
+}
+
+void test_shutdown_filesystem(void)
+{
+}

diff -u /dev/null rtems/testsuites/fstests/mimfs_fs01/.cvsignore:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/mimfs_fs01/.cvsignore	Wed Apr 20 16:30:14 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

diff -u /dev/null rtems/testsuites/fstests/mimfs_fs01/Makefile.am:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/mimfs_fs01/Makefile.am	Wed Apr 20 16:30:15 2011
@@ -0,0 +1,26 @@
+##
+##  $Id$
+##
+
+rtems_tests_PROGRAMS = mimfs_fs01
+mimfs_fs01_SOURCES = ../fs01/init.c ../../psxtests/include/pmacros.h \
+  ../mimfs_support/fs_support.c ../imfs_support/fs_config.h
+
+dist_rtems_tests_DATA = mimfs_fs01.scn
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fs01_OBJECTS) $(mimfs_fs01_LDADD)
+LINK_LIBS = $(mimfs_fs01_LDLIBS)
+
+mimfs_fs01$(EXEEXT): $(mimfs_fs01_OBJECTS) $(mimfs_fs01_DEPENDENCIES)
+	@rm -f mimfs_fs01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am

diff -u /dev/null rtems/testsuites/fstests/mimfs_support/fs_config.h:1.1
--- /dev/null	Wed Apr 20 17:10:19 2011
+++ rtems/testsuites/fstests/mimfs_support/fs_config.h	Wed Apr 20 16:30:15 2011
@@ -0,0 +1,10 @@
+/*
+ *  $Id$
+ */
+
+#define FILESYSTEM "MOUNTED IMFS"
+#define BASE_FOR_TEST "/mnt/"
+
+extern void test_initialize_filesystem(void);
+
+extern void test_shutdown_filesystem(void);

diff -u /dev/null rtems/testsuites/fstests/mimfs_support/fs_support.c:1.1
--- /dev/null	Wed Apr 20 17:10:20 2011
+++ rtems/testsuites/fstests/mimfs_support/fs_support.c	Wed Apr 20 16:30:15 2011
@@ -0,0 +1,41 @@
+/*
+ *  $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#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;
+
+  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 );
+}
+
+void test_shutdown_filesystem(void)
+{
+  int rc;
+
+  rc = unmount( BASE_FOR_TEST );
+  rtems_test_assert( rc == 0 );
+
+}


 *joel*:
2011-04-20	Joel Sherrill <joel.sherrill at oarcorp.com>

	* configure.ac: Add fstests.

M  1.181  testsuites/ChangeLog
M   1.30  testsuites/configure.ac

diff -u rtems/testsuites/ChangeLog:1.180 rtems/testsuites/ChangeLog:1.181
--- rtems/testsuites/ChangeLog:1.180	Fri Mar  4 10:14:42 2011
+++ rtems/testsuites/ChangeLog	Wed Apr 20 16:30:36 2011
@@ -1,3 +1,7 @@
+2011-04-20	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* configure.ac: Add fstests.
+
 2011-03-04	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	* aclocal/env-rtemsbsp.m4, aclocal/rtems-top.m4, aclocal/version.m4:

diff -u rtems/testsuites/configure.ac:1.29 rtems/testsuites/configure.ac:1.30
--- rtems/testsuites/configure.ac:1.29	Wed Feb  2 09:01:19 2011
+++ rtems/testsuites/configure.ac	Wed Apr 20 16:30:36 2011
@@ -34,7 +34,7 @@
 
 if test "$enable_tests" = "yes"; then
   # do functionality tests first, then performance tests
-  AC_CONFIG_SUBDIRS(libtests sptests psxtests)
+  AC_CONFIG_SUBDIRS(libtests sptests fstests psxtests)
   if test "$rtems_cv_RTEMS_MULTIPROCESSING" = "yes"; then
     AC_CONFIG_SUBDIRS(mptests)
   fi



--

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/20110420/817da1bd/attachment-0001.html>


More information about the vc mailing list