change log for rtems (2010-08-06)

rtems-vc at rtems.org rtems-vc at rtems.org
Sat Aug 7 01:12:29 UTC 2010


 *joel*:
2010-08-06	Bharath Suri <bharath.s.jois at gmail.com>

	PR 1654/testing
	* psx13/test.c, psx13/psx13.scn: Test case to improve testing of
	dup2 routine.
	* psxfile01/test.c, psxfile01/psxfile01.scn: New test to improve
	testing of fcntl routine.
	* psximfs01/init.c, psximfs01/psximfs01.scn: Improve testing of
	imfs routines.
	* psximfs02/init.c, psximfs02/psximfs02.scn: Improve coverage of
	imfs routines.
	* psxpasswd02/init.c, psxpasswd02/psxpasswd02.scn: New tests to
	improve coverage of getpwent.c.

M  1.304  testsuites/psxtests/ChangeLog
M   1.10  testsuites/psxtests/psx13/psx13.scn
M   1.18  testsuites/psxtests/psx13/test.c
M   1.14  testsuites/psxtests/psxfile01/psxfile01.scn
M   1.30  testsuites/psxtests/psxfile01/test.c
M    1.5  testsuites/psxtests/psximfs01/init.c
M    1.3  testsuites/psxtests/psximfs01/psximfs01.scn
M    1.3  testsuites/psxtests/psximfs02/init.c
M    1.3  testsuites/psxtests/psximfs02/psximfs02.scn
M    1.2  testsuites/psxtests/psxpasswd02/init.c
M    1.2  testsuites/psxtests/psxpasswd02/psxpasswd02.scn

diff -u rtems/testsuites/psxtests/ChangeLog:1.303 rtems/testsuites/psxtests/ChangeLog:1.304
--- rtems/testsuites/psxtests/ChangeLog:1.303	Fri Aug  6 02:44:22 2010
+++ rtems/testsuites/psxtests/ChangeLog	Fri Aug  6 19:22:45 2010
@@ -1,3 +1,17 @@
+2010-08-06	Bharath Suri <bharath.s.jois at gmail.com>
+
+	PR 1654/testing
+	* psx13/test.c, psx13/psx13.scn: Test case to improve testing of
+	dup2 routine.
+	* psxfile01/test.c, psxfile01/psxfile01.scn: New test to improve
+	testing of fcntl routine.
+	* psximfs01/init.c, psximfs01/psximfs01.scn: Improve testing of
+	imfs routines.
+	* psximfs02/init.c, psximfs02/psximfs02.scn: Improve coverage of
+	imfs routines.
+	* psxpasswd02/init.c, psxpasswd02/psxpasswd02.scn: New tests to
+	improve coverage of getpwent.c.
+
 2010-08-06	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	PR 1652/GCC:

diff -u rtems/testsuites/psxtests/psx13/psx13.scn:1.9 rtems/testsuites/psxtests/psx13/psx13.scn:1.10
--- rtems/testsuites/psxtests/psx13/psx13.scn:1.9	Mon Jul 19 08:13:20 2010
+++ rtems/testsuites/psxtests/psx13/psx13.scn	Fri Aug  6 19:22:46 2010
@@ -1,10 +1,9 @@
-
 *** POSIX TEST 13 ***
 
 Files initialized successfully.
 Testing device_lseek()... Failed!!!
 Testing dup()............ Failed!!!
-Testing dup2()........... Failed!!!
+Testing dup2()........... Success.
 Testing fdatasync()...... Success.
 Testing umask().......... Success.
 Testing utime().......... Success.

diff -u rtems/testsuites/psxtests/psx13/test.c:1.17 rtems/testsuites/psxtests/psx13/test.c:1.18
--- rtems/testsuites/psxtests/psx13/test.c:1.17	Mon Jul 19 08:13:20 2010
+++ rtems/testsuites/psxtests/psx13/test.c	Fri Aug  6 19:22:46 2010
@@ -142,7 +142,7 @@
   else
     retval = FALSE;
 
-  /* assert (retval == TRUE);*/
+  close( fd );  /* assert (retval == TRUE);*/
 
   return (retval);
 }
@@ -187,6 +187,8 @@
   else
     retval = FALSE;
 
+  close( fd1 );
+  close( fd2 );
   /* assert (retval == TRUE);*/
 
   return (retval);
@@ -257,7 +259,7 @@
   }
 
   close (fd1);
-
+  close (fd2);
   /* assert (retval == TRUE);*/
 
   return (retval);

diff -u rtems/testsuites/psxtests/psxfile01/psxfile01.scn:1.13 rtems/testsuites/psxtests/psxfile01/psxfile01.scn:1.14
--- rtems/testsuites/psxtests/psxfile01/psxfile01.scn:1.13	Mon Jul 19 08:13:20 2010
+++ rtems/testsuites/psxtests/psxfile01/psxfile01.scn	Fri Aug  6 19:22:46 2010
@@ -1,10 +1,9 @@
-
 *** FILE TEST 1 ***
 *************** Dump of Entire IMFS ***************
 /
 ....dev/
 ........console (device 0, 0)
-***************       End of Dump        ***************
+***************      End of Dump       ***************
 stat of /dev/console
 ....st_dev     (0xfffe:0x0)
 ....st_ino     3  may vary by small amount
@@ -55,6 +54,7 @@
 Unlink /tmp/bha using the reentrant version -- OK
 mknod with bad type - expect EINVAL
 open /tmp/bha in write only mode -- OK
+attempt fcntl on opened file -- OK
 attempt to read from /tmp/bha - expect EINVAL
 closing and unlinking /tmp/bha
 open /tmp/bha in read only mode -- OK
@@ -192,7 +192,7 @@
 ........j (file 130)
 ....imfs/
 ........hidden_on_mount/
-***************       End of Dump        ***************
+***************      End of Dump       ***************
 truncate /tmp/j to length of 40
 ....st_dev     (0xfffe:0x0)
 ....st_ino     17  may vary by small amount
@@ -221,7 +221,7 @@
 ........j (file 40)
 ....imfs/
 ........hidden_on_mount/
-***************       End of Dump        ***************
+***************      End of Dump       ***************
 truncate /tmp/j to length of 0
 truncate /tmp to length of 0 should fail with EISDIR
 
@@ -242,7 +242,7 @@
 ........j (file 0)
 ....imfs/
 ........hidden_on_mount/
-***************       End of Dump        ***************
+***************      End of Dump       ***************
 Writing First File
 Writing Second File
 (0)this is a test line

diff -u rtems/testsuites/psxtests/psxfile01/test.c:1.29 rtems/testsuites/psxtests/psxfile01/test.c:1.30
--- rtems/testsuites/psxtests/psxfile01/test.c:1.29	Mon Jul 19 08:13:20 2010
+++ rtems/testsuites/psxtests/psxfile01/test.c	Fri Aug  6 19:22:46 2010
@@ -374,7 +374,11 @@
   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 );

diff -u rtems/testsuites/psxtests/psximfs01/init.c:1.4 rtems/testsuites/psxtests/psximfs01/init.c:1.5
--- rtems/testsuites/psxtests/psximfs01/init.c:1.4	Thu Jul 29 17:35:36 2010
+++ rtems/testsuites/psxtests/psximfs01/init.c	Fri Aug  6 19:22:46 2010
@@ -147,7 +147,6 @@
 
   position = lseek( TestFd, 0, SEEK_END );
   printf( "Seek to end .. returned %d\n", (int) position );
-  rtems_test_assert( position == 1 );
 
   /* 
    * test case to ftruncate a file to a length > its size 
@@ -179,6 +178,7 @@
 	  rc,
 	  strerror( errno )
         );
+	break;
       }
       else {
 	break;
@@ -216,6 +216,8 @@
   int i;
   void *alloc_ptr = (void *)0;
   Heap_Information_block Info;
+  int position = 0;
+  int status = 0;
 
   puts( "\n\n*** TEST IMFS 01 ***" );
 
@@ -248,6 +250,12 @@
    */
   free(alloc_ptr);
 
+  extend_helper();
+  position = lseek( TestFd , 0, SEEK_END );
+  status = lseek( TestFd, position+2, SEEK_SET );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == ENOSPC );
+
   close_it();
   unlink_it();
 

diff -u rtems/testsuites/psxtests/psximfs01/psximfs01.scn:1.2 rtems/testsuites/psxtests/psximfs01/psximfs01.scn:1.3
--- rtems/testsuites/psxtests/psximfs01/psximfs01.scn:1.2	Thu Jul 29 17:35:36 2010
+++ rtems/testsuites/psxtests/psximfs01/psximfs01.scn	Fri Aug  6 19:22:46 2010
@@ -14,6 +14,8 @@
 lseek/ftruncate loop..
 Seek to end .. returned 1
 lseek/ftruncate loop..
+Seek to end .. returned 1295
+lseek/ftruncate loop..
 close(biggie) - OK 
 unlink(biggie) - OK
 *** END OF TEST IMFS 01 ***

diff -u rtems/testsuites/psxtests/psximfs02/init.c:1.2 rtems/testsuites/psxtests/psximfs02/init.c:1.3
--- rtems/testsuites/psxtests/psximfs02/init.c:1.2	Mon Aug  2 13:19:35 2010
+++ rtems/testsuites/psxtests/psximfs02/init.c	Fri Aug  6 19:22:46 2010
@@ -161,6 +161,22 @@
 
   IMFS_dump();
   
+  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 );
+
+  printk( "chown /fifo to %o -- OK", 0 );
+  status = chown( "/fifo", 0, 0 );
+  rtems_test_assert( status == 0 );
+
   puts( "*** END OF TEST IMFS 02 ***" );
   rtems_test_exit(0);
 }

diff -u rtems/testsuites/psxtests/psximfs02/psximfs02.scn:1.2 rtems/testsuites/psxtests/psximfs02/psximfs02.scn:1.3
--- rtems/testsuites/psxtests/psximfs02/psximfs02.scn:1.2	Mon Aug  2 13:19:35 2010
+++ rtems/testsuites/psxtests/psximfs02/psximfs02.scn	Fri Aug  6 19:22:46 2010
@@ -57,5 +57,8 @@
 ....node-link links not printed
 ....node-slink links not printed
 ....fifo FIFO not printed
-***************       End of Dump        ***************
-*** END OF TEST IMFS 02 ***
+***************      End of Dump       ***************
+chown /fifo to 10 -- OK
+Changing euid to 10
+chmod /fifo -- OK
+chown /fifo to 0 -- OK*** END OF TEST IMFS 02 ***

diff -u rtems/testsuites/psxtests/psxpasswd02/init.c:1.1 rtems/testsuites/psxtests/psxpasswd02/init.c:1.2
--- rtems/testsuites/psxtests/psxpasswd02/init.c:1.1	Thu Jul  1 12:26:35 2010
+++ rtems/testsuites/psxtests/psxpasswd02/init.c	Fri Aug  6 19:22:46 2010
@@ -17,6 +17,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <limits.h>
 
 void print_passwd(
   struct passwd *pw
@@ -63,6 +64,9 @@
   struct passwd *pw;
   struct group  *gr;
   int status = -1;
+  char str[100] = {0};
+  int max_int = INT_MAX;
+  int limit_value = 0;
 
   FILE *fp = NULL;
 
@@ -127,6 +131,28 @@
   rtems_test_assert( !pw ); 
   rtems_test_assert( errno == EINVAL );
 
+  fp = fopen( "/etc/passwd", "w" );
+  rtems_test_assert( fp != NULL );
+  fprintf( fp, "user:x:999999999999:1:dummy::/:/bin/sh\n" );
+  fclose( fp );
+
+  puts( "Init - getpwnam(\"root\") -- expected EINVAL" );
+  pw = getpwnam( "root" );
+  rtems_test_assert( !pw ); 
+  rtems_test_assert( errno == EINVAL );
+
+  sprintf( str, "user:x:%d%d:1:dummy::/:/bin/sh\n", max_int/10, max_int%10+1 );
+
+  fp = fopen( "/etc/passwd", "w" );
+  rtems_test_assert( fp != NULL );
+  fprintf( fp, str );
+  fclose( fp );
+
+  puts( "Init - getpwnam(\"root\") -- expected EINVAL" );
+  pw = getpwnam( "root" );
+  rtems_test_assert( !pw ); 
+  rtems_test_assert( errno == EINVAL );
+
   puts( "Init - getgrent() -- OK" );
   gr = getgrent();
   rtems_test_assert( gr != NULL );

diff -u rtems/testsuites/psxtests/psxpasswd02/psxpasswd02.scn:1.1 rtems/testsuites/psxtests/psxpasswd02/psxpasswd02.scn:1.2
--- rtems/testsuites/psxtests/psxpasswd02/psxpasswd02.scn:1.1	Thu Jul  1 12:26:37 2010
+++ rtems/testsuites/psxtests/psxpasswd02/psxpasswd02.scn	Fri Aug  6 19:22:46 2010
@@ -9,6 +9,8 @@
 Init - getpwnam("root") -- expected EINVAL
 Init - getpwnam("root") -- expected EINVAL
 Init - getpwnam("root") -- expected EINVAL
+Init - getpwnam("root") -- expected EINVAL
+Init - getpwnam("root") -- expected EINVAL
 Init - getgrent() -- OK
   group name: admin
   group  password: 


 *joel*:
2010-08-06	Bharath Suri <bharath.s.jois at gmail.com>

	PR 1654/testing
	* deviceio01/init.c, deviceio01/deviceio01.doc,
	deviceio01/deviceio01.scn, deviceio01/test_driver.c,
	deviceio01/test_driver.h, deviceio01/Makefile.am: New test added.
	* Makefile.am, configure.ac: Changes to added above test.
	* tar02/init.c, tar02/tar02.scn: New test case added: IMFS_dump().

M  1.232  testsuites/libtests/ChangeLog
M   1.47  testsuites/libtests/Makefile.am
M   1.55  testsuites/libtests/configure.ac
A    1.1  testsuites/libtests/deviceio01/.cvsignore
A    1.1  testsuites/libtests/deviceio01/Makefile.am
A    1.1  testsuites/libtests/deviceio01/deviceio01.doc
A    1.1  testsuites/libtests/deviceio01/deviceio01.scn
A    1.1  testsuites/libtests/deviceio01/init.c
A    1.1  testsuites/libtests/deviceio01/test_driver.h
A    1.1  testsuites/libtests/deviceio01/test_driver.c
M    1.2  testsuites/libtests/tar02/init.c
M    1.2  testsuites/libtests/tar02/tar02.scn

diff -u rtems/testsuites/libtests/ChangeLog:1.231 rtems/testsuites/libtests/ChangeLog:1.232
--- rtems/testsuites/libtests/ChangeLog:1.231	Mon Aug  2 13:17:10 2010
+++ rtems/testsuites/libtests/ChangeLog	Fri Aug  6 19:24:47 2010
@@ -1,3 +1,12 @@
+2010-08-06	Bharath Suri <bharath.s.jois at gmail.com>
+
+	PR 1654/testing
+	* deviceio01/init.c, deviceio01/deviceio01.doc,
+	deviceio01/deviceio01.scn, deviceio01/test_driver.c,
+	deviceio01/test_driver.h, deviceio01/Makefile.am: New test added.
+	* Makefile.am, configure.ac: Changes to added above test.
+	* tar02/init.c, tar02/tar02.scn: New test case added: IMFS_dump().
+
 2010-08-02	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	* Makefile.am, configure.ac: Add test for rtems_print_buffer().

diff -u rtems/testsuites/libtests/Makefile.am:1.46 rtems/testsuites/libtests/Makefile.am:1.47
--- rtems/testsuites/libtests/Makefile.am:1.46	Mon Aug  2 13:17:10 2010
+++ rtems/testsuites/libtests/Makefile.am	Fri Aug  6 19:24:47 2010
@@ -7,7 +7,7 @@
 SUBDIRS = POSIX
 
 SUBDIRS += bspcmdline01 cpuuse devfs01 devfs02 devfs03 devfs04 \
-    devnullfatal01 dumpbuf01 gxx01 gxx02 \
+    deviceio01 devnullfatal01 dumpbuf01 gxx01 gxx02 \
     malloctest malloc02 malloc03 malloc04 malloc05 heapwalk \
     putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
     termios termios01 termios02 termios03 termios04 termios05 \

diff -u rtems/testsuites/libtests/configure.ac:1.54 rtems/testsuites/libtests/configure.ac:1.55
--- rtems/testsuites/libtests/configure.ac:1.54	Mon Aug  2 13:17:10 2010
+++ rtems/testsuites/libtests/configure.ac	Fri Aug  6 19:24:47 2010
@@ -53,6 +53,7 @@
 devfs02/Makefile
 devfs03/Makefile
 devfs04/Makefile
+deviceio01/Makefile
 devnullfatal01/Makefile
 dumpbuf01/Makefile
 gxx01/Makefile

diff -u /dev/null rtems/testsuites/libtests/deviceio01/.cvsignore:1.1
--- /dev/null	Fri Aug  6 20:12:28 2010
+++ rtems/testsuites/libtests/deviceio01/.cvsignore	Fri Aug  6 19:24:48 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

diff -u /dev/null rtems/testsuites/libtests/deviceio01/Makefile.am:1.1
--- /dev/null	Fri Aug  6 20:12:28 2010
+++ rtems/testsuites/libtests/deviceio01/Makefile.am	Fri Aug  6 19:24:48 2010
@@ -0,0 +1,24 @@
+##
+## $Id$
+##
+
+rtems_tests_PROGRAMS = deviceio01
+deviceio01_SOURCES = init.c test_driver.c
+
+dist_rtems_tests_DATA = deviceio01.scn
+dist_rtems_tests_DATA += deviceio01.doc
+
+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)/../support/include
+
+LINK_OBJS = $(deviceio01_OBJECTS) $(deviceio01_LDADD)
+LINK_LIBS = $(deviceio01_LDLIBS)
+
+deviceio01$(EXEEXT): $(deviceio01_OBJECTS) $(deviceio01_DEPENDENCIES)
+	@rm -f deviceio01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am

diff -u /dev/null rtems/testsuites/libtests/deviceio01/deviceio01.doc:1.1
--- /dev/null	Fri Aug  6 20:12:28 2010
+++ rtems/testsuites/libtests/deviceio01/deviceio01.doc	Fri Aug  6 19:24:48 2010
@@ -0,0 +1,28 @@
+#
+#  $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:  devfs04
+
+directives:
+
++ device_read
++ device_write
++ device_ioctl
+
+concepts:
+
++ Custom driver for a device /dev/test lets us exercise the error
+paths in the read / write routines for devFS. These are invoked using
+the system calls read() and write().
+
++ Mostly hits the error paths in the above mentioned routines

diff -u /dev/null rtems/testsuites/libtests/deviceio01/deviceio01.scn:1.1
--- /dev/null	Fri Aug  6 20:12:28 2010
+++ rtems/testsuites/libtests/deviceio01/deviceio01.scn	Fri Aug  6 19:24:48 2010
@@ -0,0 +1,7 @@
+*** TEST DEVICEIO - 01 ***
+Init - attempt to open the /dev/test WR mode -- OK
+Init - attempt to write to /dev/test - expect ENOSYS
+Init - attempt to open the /dev/test RD mode -- OK
+Init - attempt to read from /dev/test - expect ENOSYS
+Init - attempt ioctl on the device - expect ENOSYS
+*** END OF TEST DEVICEIO - 01 ***

diff -u /dev/null rtems/testsuites/libtests/deviceio01/init.c:1.1
--- /dev/null	Fri Aug  6 20:12:28 2010
+++ rtems/testsuites/libtests/deviceio01/init.c	Fri Aug  6 19:24:48 2010
@@ -0,0 +1,78 @@
+/*
+ *  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 <tmacros.h>
+#include "test_support.h"
+#include <rtems/devfs.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include "test_driver.h"
+#include <rtems/devnull.h>
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  int status;
+  int fdr = 0, fdw = 0;
+  char buf[10];
+
+  puts( "\n\n*** TEST DEVICEIO - 01 ***" );
+
+  puts( "Init - attempt to open the /dev/test WR mode -- OK" );
+  fdw = open( "/dev/test", O_WRONLY );
+  rtems_test_assert( fdw != -1 );
+  
+  puts( "Init - attempt to write to /dev/test - expect ENOSYS" );
+  status = write( fdw, "data", 10 );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == ENOSYS );
+
+  puts( "Init - attempt to open the /dev/test RD mode -- OK" );
+  fdr = open( "/dev/test", O_RDONLY );
+  rtems_test_assert( fdr != -1 );
+
+  puts( "Init - attempt to read from /dev/test - expect ENOSYS" );
+  status = read( fdr, buf, 10 );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == ENOSYS );
+
+  puts( "Init - attempt ioctl on the device - expect ENOSYS" );
+  status = ioctl( fdr, -1 );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == ENOSYS );
+
+  puts( "*** END OF TEST DEVICEIO - 01 ***" );
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_EXTRA_DRIVERS TEST_DRIVER_TABLE_ENTRY
+
+/* include an extra slot for registering the termios one dynamically */
+#define CONFIGURE_MAXIMUM_DRIVERS 3
+
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
+
+#define CONFIGURE_MAXIMUM_TASKS             1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */

diff -u /dev/null rtems/testsuites/libtests/deviceio01/test_driver.h:1.1
--- /dev/null	Fri Aug  6 20:12:28 2010
+++ rtems/testsuites/libtests/deviceio01/test_driver.h	Fri Aug  6 19:24:48 2010
@@ -0,0 +1,64 @@
+/*
+ *  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$
+ */
+
+#ifndef __TEST_DRIVER_h
+#define __TEST_DRIVER_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TEST_DRIVER_TABLE_ENTRY \
+  { testDriver_initialize, testDriver_open, testDriver_close, testDriver_read, \
+    testDriver_write, testDriver_control }
+
+rtems_device_driver testDriver_initialize(
+  rtems_device_major_number,
+  rtems_device_minor_number,
+  void *
+);
+
+rtems_device_driver testDriver_open(
+  rtems_device_major_number,
+  rtems_device_minor_number,
+  void *
+);
+
+rtems_device_driver testDriver_close(
+  rtems_device_major_number,
+  rtems_device_minor_number,
+  void *
+);
+
+rtems_device_driver testDriver_read(
+  rtems_device_major_number,
+  rtems_device_minor_number,
+  void *
+);
+
+rtems_device_driver testDriver_write(
+  rtems_device_major_number,
+  rtems_device_minor_number,
+  void *
+);
+
+rtems_device_driver testDriver_control(
+  rtems_device_major_number,
+  rtems_device_minor_number,
+  void *
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */

diff -u /dev/null rtems/testsuites/libtests/deviceio01/test_driver.c:1.1
--- /dev/null	Fri Aug  6 20:12:28 2010
+++ rtems/testsuites/libtests/deviceio01/test_driver.c	Fri Aug  6 19:24:48 2010
@@ -0,0 +1,190 @@
+/*
+ *  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 <rtems.h>
+#include "test_driver.h"
+#include <rtems/libio.h>
+#include <rtems/devnull.h>
+/* 
+ * The test driver routines are mostly derived from the null driver routines.
+ */
+uint32_t   TEST_major;
+static char initialized;
+
+/*  testDriver_initialize
+ *
+ *  This routine is the test device driver init routine.
+ *
+ *  Input parameters:
+ *    major - device major number
+ *    minor - device minor number
+ *    pargp - pointer to parameter block
+ *
+ *  Output parameters:
+ *    rval       - RTEMS_SUCCESSFUL
+ */
+rtems_device_driver testDriver_initialize(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor __attribute__((unused)),
+  void *pargp __attribute__((unused))
+)
+{
+  rtems_device_driver status;
+
+  if ( !initialized ) {
+    initialized = 1;
+
+    status = rtems_io_register_name(
+      "/dev/test",
+      major,
+      (rtems_device_minor_number) 0
+    );
+
+    if (status != RTEMS_SUCCESSFUL)
+      rtems_fatal_error_occurred(status);
+
+    TEST_major = major;
+  }
+
+  return RTEMS_SUCCESSFUL;
+}
+
+/*  testDriver_open
+ *
+ *  This routine is the test device driver open routine.
+ *
+ *  Input parameters:
+ *    major - device major number
+ *    minor - device minor number
+ *    pargb - pointer to open parameter block
+ *
+ *  Output parameters:
+ *    rval       - RTEMS_SUCCESSFUL
+ */
+rtems_device_driver testDriver_open(
+  rtems_device_major_number major __attribute__((unused)),
+  rtems_device_minor_number minor __attribute__((unused)),
+  void *pargp __attribute__((unused))
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
+
+/*  testDriver_close
+ *
+ *  This routine is the test device driver close routine.
+ *
+ *  Input parameters:
+ *    major - device major number
+ *    minor - device minor number
+ *    pargb - pointer to close parameter block
+ *
+ *  Output parameters:
+ *    rval       - RTEMS_SUCCESSFUL
+ */
+rtems_device_driver testDriver_close(
+  rtems_device_major_number major __attribute__((unused)),
+  rtems_device_minor_number minor __attribute__((unused)),
+  void *pargp __attribute__((unused))
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
+
+/*  testDriver_read
+ *
+ *  This routine is the test device driver read routine.
+ *
+ *  Input parameters:
+ *    major - device major number
+ *    minor - device minor number
+ *    pargp - pointer to read parameter block
+ *
+ *  Output parameters:
+ *    rval       - RTEMS_SUCCESSFUL
+ */
+rtems_device_driver testDriver_read(
+  rtems_device_major_number major __attribute__((unused)),
+  rtems_device_minor_number minor __attribute__((unused)),
+  void *pargp
+)
+{
+  rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
+
+  if ( rw_args ) {
+    if( rw_args->count == 5 )
+      rw_args->bytes_moved = 0;
+    else {
+      rw_args->bytes_moved = 0;
+      return RTEMS_NOT_IMPLEMENTED;
+    }
+  }
+  
+  return RTEMS_SUCCESSFUL;
+}
+
+/*  testDriver_write
+ *
+ *  This routine is the test device driver write routine.
+ *
+ *  Input parameters:
+ *    major - device major number
+ *    minor - device minor number
+ *    pargp - pointer to write parameter block
+ *
+ *  Output parameters:
+ *    rval       - RTEMS_SUCCESSFUL
+ */
+rtems_device_driver testDriver_write(
+  rtems_device_major_number major __attribute__((unused)),
+  rtems_device_minor_number minor __attribute__((unused)),
+  void *pargp
+)
+{
+  rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
+
+  if ( rw_args ) {
+    if( rw_args->count == 5 )
+      return null_write( 0, 0, pargp );
+    else {
+      rw_args->bytes_moved = 0;
+      return RTEMS_NOT_IMPLEMENTED;
+    }
+  }
+
+  return RTEMS_SUCCESSFUL;
+}
+
+/*  testDriver_control
+ *
+ *  This routine is the test device driver control routine.
+ *
+ *  Input parameters:
+ *    major - device major number
+ *    minor - device minor number
+ *    pargp - pointer to cntrl parameter block
+ *
+ *  Output parameters:
+ *    rval       - RTEMS_SUCCESSFUL
+ */
+
+rtems_device_driver testDriver_control(
+  rtems_device_major_number major __attribute__((unused)),
+  rtems_device_minor_number minor __attribute__((unused)),
+  void *pargp __attribute__((unused))
+)
+{
+  return RTEMS_NOT_IMPLEMENTED;
+}

diff -u rtems/testsuites/libtests/tar02/init.c:1.1 rtems/testsuites/libtests/tar02/init.c:1.2
--- rtems/testsuites/libtests/tar02/init.c:1.1	Tue Jul 27 13:16:50 2010
+++ rtems/testsuites/libtests/tar02/init.c	Fri Aug  6 19:24:48 2010
@@ -63,6 +63,7 @@
   printf( "\n\n*** TAR02 TEST ***\n" );
 
   test_tarfs_load();
+  IMFS_dump();
 
   printf( "*** END OF TAR02 TEST ***\n" );
   exit( 0 );

diff -u rtems/testsuites/libtests/tar02/tar02.scn:1.1 rtems/testsuites/libtests/tar02/tar02.scn:1.2
--- rtems/testsuites/libtests/tar02/tar02.scn:1.1	Tue Jul 27 13:16:50 2010
+++ rtems/testsuites/libtests/tar02/tar02.scn	Fri Aug  6 19:24:48 2010
@@ -5,4 +5,11 @@
 initial tar image.
 
 *** Skipping symlink -- NOT CURRENTLY SUPPORTED ***
+*************** Dump of Entire IMFS ***************
+/
+....dev/
+........console (device 0, 0)
+....home/
+........test_file (file 73 0x12022c)
+***************      End of Dump       ***************
 *** END OF TAR02 TEST ***



--

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/20100806/8c625c5b/attachment-0001.html>


More information about the vc mailing list