change log for rtems (2010-07-09)

rtems-vc at rtems.org rtems-vc at rtems.org
Fri Jul 9 22:11:11 UTC 2010


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

	PR 1610/testing
	* psx13/test.c, psx13/psx13.scn: Remove the test cases which
	exercise pipe. These are new a new test under psxpipe01/
	* psxpipe01/init.c, psxpipe01/Makefile.am,
	psxpipe01/psxpipe01.scn, psxpipe01/psxpipe01.doc: Added new test.
	* Makefile.am, configure.ac: Changes due to addition of new test:
	psxpipe01.

M  1.291  testsuites/psxtests/ChangeLog
M   1.66  testsuites/psxtests/Makefile.am
M   1.70  testsuites/psxtests/configure.ac
M    1.8  testsuites/psxtests/psx13/psx13.scn
M   1.16  testsuites/psxtests/psx13/test.c
A    1.1  testsuites/psxtests/psxpipe01/.cvsignore
A    1.1  testsuites/psxtests/psxpipe01/Makefile.am
A    1.1  testsuites/psxtests/psxpipe01/init.c
A    1.1  testsuites/psxtests/psxpipe01/psxpipe01.doc
A    1.1  testsuites/psxtests/psxpipe01/psxpipe01.scn

diff -u rtems/testsuites/psxtests/ChangeLog:1.290 rtems/testsuites/psxtests/ChangeLog:1.291
--- rtems/testsuites/psxtests/ChangeLog:1.290	Thu Jul  8 14:37:00 2010
+++ rtems/testsuites/psxtests/ChangeLog	Fri Jul  9 17:07:11 2010
@@ -1,3 +1,13 @@
+2010-07-09	Bharath Suri <bharath.s.jois at gmail.com>
+
+	PR 1610/testing
+	* psx13/test.c, psx13/psx13.scn: Remove the test cases which
+	exercise pipe. These are new a new test under psxpipe01/
+	* psxpipe01/init.c, psxpipe01/Makefile.am,
+	psxpipe01/psxpipe01.scn, psxpipe01/psxpipe01.doc: Added new test.
+	* Makefile.am, configure.ac: Changes due to addition of new test:
+	psxpipe01.
+
 2010-07-08	Bharath Suri <bharath.s.jois at gmail.com>
 
 	PR 1608/testing

diff -u rtems/testsuites/psxtests/Makefile.am:1.65 rtems/testsuites/psxtests/Makefile.am:1.66
--- rtems/testsuites/psxtests/Makefile.am:1.65	Mon Jul  5 20:01:42 2010
+++ rtems/testsuites/psxtests/Makefile.am	Fri Jul  9 17:07:11 2010
@@ -21,7 +21,7 @@
 ## File IO tests
 SUBDIRS += psxfile01 psxfile02 psxfilelock01 psxgetrusage01 psxid01 \
     psximfs01 psxreaddir psxstat psxmount psx13 psxchroot01 psxpasswd01 \
-    psxpasswd02 psxtimes01
+    psxpasswd02 psxpipe01 psxtimes01
 
 ## Until sys/uio.h is moved to libcsupport, we have to have networking
 ## enabled to support readv and writev.  Hopefully this is a temporary

diff -u rtems/testsuites/psxtests/configure.ac:1.69 rtems/testsuites/psxtests/configure.ac:1.70
--- rtems/testsuites/psxtests/configure.ac:1.69	Mon Jul  5 20:01:42 2010
+++ rtems/testsuites/psxtests/configure.ac	Fri Jul  9 17:07:11 2010
@@ -107,6 +107,7 @@
 psxobj01/Makefile
 psxpasswd01/Makefile
 psxpasswd02/Makefile
+psxpipe01/Makefile
 psxreaddir/Makefile
 psxrdwrv/Makefile
 psxrwlock01/Makefile

diff -u rtems/testsuites/psxtests/psx13/psx13.scn:1.7 rtems/testsuites/psxtests/psx13/psx13.scn:1.8
--- rtems/testsuites/psxtests/psx13/psx13.scn:1.7	Thu Jul  1 12:23:47 2010
+++ rtems/testsuites/psxtests/psx13/psx13.scn	Fri Jul  9 17:07:11 2010
@@ -1,18 +1,17 @@
-*** POSIX TEST 13 ***
+
+** POSIX TEST 13 ***
 
 Files initialized successfully.
-Testing device_lseek()... Success.
-Testing dup()............ Success. ( Add when dup flags resolved )
-Testing dup2()........... Success.
+Testing device_lseek()... Failed!!!
+Testing dup()............ Failed!!!
+Testing dup2()........... Failed!!!
 Testing fdatasync()...... Success.
 Testing umask().......... Success.
 Testing utime().......... Success.
 Testing utimes().......... Success.
-Testing pipe()........... Success.
-Testing pipe() with NULL........... Failed!!!
 Testing fsync().......... Success.
 Testing pathconf()....... Success.
 Testing fpathconf()...... Success.
-
+Testing sync()...... 
 
 *** END OF TEST PSX13 ***

diff -u rtems/testsuites/psxtests/psx13/test.c:1.15 rtems/testsuites/psxtests/psx13/test.c:1.16
--- rtems/testsuites/psxtests/psx13/test.c:1.15	Fri Jul  2 13:51:48 2010
+++ rtems/testsuites/psxtests/psx13/test.c	Fri Jul  9 17:07:11 2010
@@ -11,7 +11,6 @@
  *     fsync        - test implemented
  *     pathconf     - test implemented
  *     fpathconf    - test implemented
- *     pipe         - test implemented
  *     umask        - test implemented
  *     utime        - test implemented
  *     utimes       - test implemented
@@ -46,8 +45,6 @@
 int UMaskTest(void);
 int UTimeTest(void);
 int UTimesTest(void);
-int PipeTest(void);
-int PipeTestNull(void);
 int PathConfTest(void);
 int FPathConfTest(void);
 int FSyncTest(void);
@@ -489,52 +486,6 @@
 }
 
 /* ---------------------------------------------------------------
- * PipeTest function
- *
- * Hits the pipe code.
- *
- * arguments: none
- * assumptions: pipe function available.
- * actions: call pipe.
- *
- * returns: TRUE if pipe returns ENOSYS,
- *          FALSE otherwise.
- *
- * ---------------------------------------------------------------
- */
-
-int PipeTest (void)
-{
-  int error = 0, retval = FALSE;
-  int fd[2];
-
-  error = pipe(fd);
-
-  if ((error == -1) && (errno == ENOSYS))
-    retval = TRUE;
-  else
-    retval = FALSE;
-
-  /* assert (retval == TRUE);*/
-
-  return(retval);
-}
-
-int PipeTestNull (void)
-{
-  int error = 0, retval = FALSE;
-
-  error = pipe(NULL);
-
-  if ((error == -1) && (errno == ENOSYS))
-    retval = TRUE;
-  else
-    retval = FALSE;
-
-  return(retval);
-}
-
-/* ---------------------------------------------------------------
  * PathConfTest function
  *
  * Hits the pathconf code.
@@ -731,18 +682,6 @@
     else
       printf ("Failed!!!\n");
 
-   printf ("Testing pipe()........... ");
-    if (PipeTest() == TRUE)
-      printf ("Success.\n");
-    else
-      printf ("Failed!!!\n");
-
-   printf ("Testing pipe() with NULL........... ");
-    if (PipeTestNull() == TRUE)
-      printf ("Success.\n");
-    else
-      printf ("Failed!!!\n");
-
    printf ("Testing fsync().......... ");
     if (FSyncTest() == TRUE)
       printf ("Success.\n");

diff -u /dev/null rtems/testsuites/psxtests/psxpipe01/.cvsignore:1.1
--- /dev/null	Fri Jul  9 17:11:11 2010
+++ rtems/testsuites/psxtests/psxpipe01/.cvsignore	Fri Jul  9 17:07:11 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

diff -u /dev/null rtems/testsuites/psxtests/psxpipe01/Makefile.am:1.1
--- /dev/null	Fri Jul  9 17:11:11 2010
+++ rtems/testsuites/psxtests/psxpipe01/Makefile.am	Fri Jul  9 17:07:11 2010
@@ -0,0 +1,27 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxpipe01
+psxpipe01_SOURCES = init.c ../include/pmacros.h
+
+dist_rtems_tests_DATA = psxpipe01.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)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxpipe01_OBJECTS) $(psxpipe01_LDADD)
+LINK_LIBS = $(psxpipe01_LDLIBS)
+
+psxpipe01$(EXEEXT): $(psxpipe01_OBJECTS) $(psxpipe01_DEPENDENCIES)
+	@rm -f psxpipe01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am

diff -u /dev/null rtems/testsuites/psxtests/psxpipe01/init.c:1.1
--- /dev/null	Fri Jul  9 17:11:11 2010
+++ rtems/testsuites/psxtests/psxpipe01/init.c	Fri Jul  9 17:07:11 2010
@@ -0,0 +1,113 @@
+/*
+ *  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 <bsp.h>
+#include <pmacros.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <rtems/score/heap.h>
+
+extern Heap_Control  *RTEMS_Malloc_Heap;
+
+rtems_task Init(
+  rtems_task_argument not_used
+)
+{
+  int fd[2] = {0};
+  int dummy_fd[2] = {0};
+  int status = 0;
+  void *alloc_ptr = (void *)0;
+  Heap_Information_block Info;
+
+  puts( "*** TEST POSIX PIPE CREATION - 01 ***" );
+
+  puts( "Init - attempt to create pipe -- expect EFAULT" );
+  status = pipe( NULL );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == EFAULT );
+
+  puts( "Init - create pipe -- OK" );
+  status = pipe( fd );
+  rtems_test_assert( status == 0 );
+
+  status = close( fd[0] );
+  status |= close( fd[1] );
+  rtems_test_assert( status == 0 );
+
+  puts( "Init - create pipe -- OK" );
+  status = pipe( fd );
+  rtems_test_assert( status == 0 );
+
+  status = close( fd[0] );
+  status |= close( fd[1] );
+  rtems_test_assert( status == 0 );
+
+  _Heap_Get_information(RTEMS_Malloc_Heap, &Info);
+  alloc_ptr = malloc(Info.Free.largest-4);
+
+  /* case where mkfifo fails */
+  puts( "Init - attempt to create pipe -- expect ENOMEM" );
+  status = pipe( fd );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == ENOMEM );
+
+  free( alloc_ptr );
+  
+  dummy_fd[0] = open( "/file01", O_RDONLY | O_CREAT, S_IRWXU );
+  rtems_test_assert( dummy_fd[0] != -1 );
+  dummy_fd[1] = open( "/file02", O_RDONLY | O_CREAT, S_IRWXU );
+  rtems_test_assert( dummy_fd[1] != -1 );
+
+  /* case where fifo_open for read => open fails */
+  puts( "Init - create pipe -- expect ENFILE" );
+  status = pipe( fd );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == ENFILE );
+
+  status = close( dummy_fd[1] );
+  status |= unlink( "/file02" );
+  rtems_test_assert( status == 0 );
+
+  /* case where fifo_open for write => open fails */
+  puts( "Init - create pipe -- expect ENFILE" );
+  status = pipe( fd );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == ENFILE );
+
+  status = close( dummy_fd[0] );
+  status |= unlink( "/file01" );
+  rtems_test_assert( status == 0 );
+
+  puts( "*** END OF TEST POSIX PIPE CREATION - 01 ***" );
+  rtems_test_exit( 0 );
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_PIPES_ENABLED
+#define CONFIGURE_MAXIMUM_PIPES 2
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */

diff -u /dev/null rtems/testsuites/psxtests/psxpipe01/psxpipe01.doc:1.1
--- /dev/null	Fri Jul  9 17:11:11 2010
+++ rtems/testsuites/psxtests/psxpipe01/psxpipe01.doc	Fri Jul  9 17:07:11 2010
@@ -0,0 +1,24 @@
+#
+#  $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:  POSIX PIPE CREATION TEST
+
+directives:
+
++ pipe
++ pipe_create
+
+concepts:
+
++ Exercise the posix pipe creation routines, including the error paths
+

diff -u /dev/null rtems/testsuites/psxtests/psxpipe01/psxpipe01.scn:1.1
--- /dev/null	Fri Jul  9 17:11:11 2010
+++ rtems/testsuites/psxtests/psxpipe01/psxpipe01.scn	Fri Jul  9 17:07:11 2010
@@ -0,0 +1,8 @@
+*** TEST POSIX PIPE CREATION - 01 ***
+Init - attempt to create pipe -- expect EFAULT
+Init - create pipe -- OK
+Init - create pipe -- OK
+Init - attempt to create pipe -- expect ENOMEM
+Init - create pipe -- expect ENFILE
+Init - create pipe -- expect ENFILE
+*** END OF TEST POSIX PIPE CREATION - 01 ***



--

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/20100709/209ffae3/attachment-0001.html>


More information about the vc mailing list