<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-07-05)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-07-05 Bharath Suri <bharath.s.jois@gmail.com>

        PR 1600/testing
        * spfifo05/init.c, spfifo05/spfifo05.doc, spfifo05/spfifo05.scn,
        spfifo05/Makefile.am: New tests for pipe/fifo routines.
        * Makefile.am, configure.ac: Add new test.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/ChangeLog.diff?r1=text&tr1=1.391&r2=text&tr2=1.392&diff_format=h">M</a></td><td width='1%'>1.392</td><td width='100%'>testsuites/sptests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/Makefile.am.diff?r1=text&tr1=1.94&r2=text&tr2=1.95&diff_format=h">M</a></td><td width='1%'>1.95</td><td width='100%'>testsuites/sptests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/configure.ac.diff?r1=text&tr1=1.99&r2=text&tr2=1.100&diff_format=h">M</a></td><td width='1%'>1.100</td><td width='100%'>testsuites/sptests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spfifo05/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/sptests/spfifo05/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spfifo05/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/sptests/spfifo05/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spfifo05/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/sptests/spfifo05/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spfifo05/spfifo05.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/sptests/spfifo05/spfifo05.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spfifo05/spfifo05.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/sptests/spfifo05/spfifo05.scn</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/sptests/ChangeLog:1.391 rtems/testsuites/sptests/ChangeLog:1.392
--- rtems/testsuites/sptests/ChangeLog:1.391    Fri Jul  2 13:07:12 2010
+++ rtems/testsuites/sptests/ChangeLog  Mon Jul  5 15:14:18 2010
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2010-07-05    Bharath Suri <bharath.s.jois@gmail.com>
+
+       PR 1600/testing
+       * spfifo05/init.c, spfifo05/spfifo05.doc, spfifo05/spfifo05.scn,
+       spfifo05/Makefile.am: New tests for pipe/fifo routines.
+       * Makefile.am, configure.ac: Add new test.
+
</font> 2010-07-02        Bharath Suri <bharath.s.jois@gmail.com>
 
        PR 1600/testing

<font color='#006600'>diff -u rtems/testsuites/sptests/Makefile.am:1.94 rtems/testsuites/sptests/Makefile.am:1.95
--- rtems/testsuites/sptests/Makefile.am:1.94   Fri Jul  2 13:07:12 2010
+++ rtems/testsuites/sptests/Makefile.am        Mon Jul  5 15:14:18 2010
</font><font color='#997700'>@@ -21,7 +21,7 @@
</font>     spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
     spfatal08 spfatal09 spfatal10 spfatal11 spfatal12 spfatal13 spfatal14 \
     spfatal15 spfatal16 spfatal17 spfatal18 spfatal19 \
<font color='#880000'>-    spfifo01 spfifo02 spfifo03 spfifo04 \
</font><font color='#000088'>+    spfifo01 spfifo02 spfifo03 spfifo04 spfifo05 \
</font>     spintrcritical01 spintrcritical02 spintrcritical03 spintrcritical04 \
     spintrcritical05 spintrcritical06 spintrcritical07 spintrcritical08 \
     spintrcritical09 spintrcritical10 spintrcritical11 spintrcritical12 \

<font color='#006600'>diff -u rtems/testsuites/sptests/configure.ac:1.99 rtems/testsuites/sptests/configure.ac:1.100
--- rtems/testsuites/sptests/configure.ac:1.99  Fri Jul  2 13:07:12 2010
+++ rtems/testsuites/sptests/configure.ac       Mon Jul  5 15:14:19 2010
</font><font color='#997700'>@@ -126,6 +126,7 @@
</font> spfifo02/Makefile
 spfifo03/Makefile
 spfifo04/Makefile
<font color='#000088'>+spfifo05/Makefile
</font> spintrcritical01/Makefile
 spintrcritical02/Makefile
 spintrcritical03/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/sptests/spfifo05/.cvsignore:1.1
--- /dev/null   Mon Jul  5 16:13:11 2010
+++ rtems/testsuites/sptests/spfifo05/.cvsignore        Mon Jul  5 15:14:19 2010
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/sptests/spfifo05/Makefile.am:1.1
--- /dev/null   Mon Jul  5 16:13:11 2010
+++ rtems/testsuites/sptests/spfifo05/Makefile.am       Mon Jul  5 15:14:19 2010
</font><font color='#997700'>@@ -0,0 +1,24 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+rtems_tests_PROGRAMS = spfifo05
+spfifo05_SOURCES = init.c
+
+dist_rtems_tests_DATA = spfifo05.scn
+dist_rtems_tests_DATA += spfifo05.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spfifo05_OBJECTS) $(spfifo05_LDADD)
+LINK_LIBS = $(spfifo05_LDLIBS)
+
+spfifo05$(EXEEXT): $(spfifo05_OBJECTS) $(spfifo05_DEPENDENCIES)
+       @rm -f spfifo05$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/sptests/spfifo05/init.c:1.1
--- /dev/null   Mon Jul  5 16:13:11 2010
+++ rtems/testsuites/sptests/spfifo05/init.c    Mon Jul  5 15:14:19 2010
</font><font color='#997700'>@@ -0,0 +1,275 @@
</font><font color='#000088'>+/*
+ *  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$
+ */
+
+/* Includes */
+#include <bsp.h>
+#include <tmacros.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <rtems.h>
+#include <rtems/libio.h>
+
+#define SEND_RCV_BUFSIZ       (PIPE_BUF+20)
+
+rtems_id rBarrier;
+rtems_id wBarrier;
+
+char recvBuf[SEND_RCV_BUFSIZ] = {0};
+char sendBuf[SEND_RCV_BUFSIZ] = {0};
+
+rtems_task read_task( rtems_task_argument not_used )
+{
+  int fd = 0;
+  int status = -1;
+  uint32_t released = 0;
+
+  puts( "read_task - opening /fifo in non-blocking mode" );
+
+  fd = open( "/fifo", O_RDONLY | O_NONBLOCK );
+  if( fd <= 0 ) {
+    printf( "Error opening file: (%d) :: %s\n", errno, strerror( errno ) );
+    rtems_test_assert( 0 );
+  }
+
+  puts( "read_task - attempt to read with number of writers = 0" );
+  status = read( fd, recvBuf, SEND_RCV_BUFSIZ );
+  rtems_test_assert( status == 0 );
+
+  puts( "read_task - releasing the write task" );
+  status = rtems_barrier_release( wBarrier, &released );
+  rtems_test_assert( status == 0 );
+
+  puts( "read_task - waiting at a barrier" );
+  status = rtems_barrier_wait( rBarrier, RTEMS_NO_TIMEOUT );
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );
+
+  puts( "read_task - attempting to read from the fifo -- Expect EAGAIN" );
+  status = read( fd, recvBuf, SEND_RCV_BUFSIZ );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == EAGAIN );
+
+  puts( "read_task - closing /fifo" );
+  status = close( fd );
+  rtems_test_assert( status == 0 );
+
+  puts("read_task - opening /fifo in read-only mode");
+  fd = open( "/fifo", O_RDONLY );
+  if( fd <= 0 ) {
+    printf( "Error opening file: (%d) :: %s\n", errno, strerror( errno ) );
+    rtems_test_assert( 0 );
+  }
+
+  puts( "read_task - releasing the write task" );
+  status = rtems_barrier_release( wBarrier, &released );
+  rtems_test_assert( status == 0 );
+
+  puts( "read_task - reading from /fifo - OK" );
+  status = read( fd, recvBuf, 10 );
+  rtems_test_assert( status == 10 );
+
+  puts( "read_task - reading from /fifo - OK" );
+  status = read( fd, recvBuf+10, 10 );
+  rtems_test_assert( status == 10 );
+
+  puts( "read_task - waiting at a barrier" );
+  status = rtems_barrier_wait( rBarrier, RTEMS_NO_TIMEOUT );
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );
+
+  puts( "read_task - reading from /fifo - OK" );
+  status = read( fd, recvBuf+20, SEND_RCV_BUFSIZ - 20 );
+  rtems_test_assert( status == SEND_RCV_BUFSIZ - 20 );
+
+  if( strcmp( sendBuf, recvBuf ) ) {
+    puts( "Sent, received buffer do not match" );
+    rtems_test_assert( 0 );
+  }
+
+  puts( "read_task - releasing the write task" );
+  status = rtems_barrier_release( wBarrier, &released );
+  rtems_test_assert( status == 0 );
+
+  puts( "read_task - waiting at a barrier" );
+  status = rtems_barrier_wait( rBarrier, RTEMS_NO_TIMEOUT );
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );
+
+  status = close( fd );
+  rtems_test_assert( status == 0 );
+
+  puts( "read_task - releasing the write task" );
+  status = rtems_barrier_release( wBarrier, &released );
+  rtems_test_assert( status == 0 );
+
+  rtems_task_delete( RTEMS_SELF );
+}
+
+
+
+rtems_task Init(
+  rtems_task_argument not_used
+)
+{
+  rtems_id readTaskID;
+
+  rtems_name readTaskName;
+
+  int status = -1;
+  int fd = 0;
+  uint32_t released = 0;
+  int flag = 1;
+
+  puts("\n*** FIFO / PIPE TESTS - 5 ***");
+
+  memset( sendBuf, '1', SEND_RCV_BUFSIZ - 30 );
+  memset( sendBuf, '2', 29 );
+  sendBuf[SEND_RCV_BUFSIZ-1] = 0;
+
+  memset( &rBarrier, 0, sizeof(rBarrier) );
+  status = rtems_barrier_create (
+    rtems_build_name ( 'B', 'A', 'R', 'r' ),
+    RTEMS_BARRIER_MANUAL_RELEASE,
+    2,
+    &rBarrier
+    );
+
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );
+
+  memset( &wBarrier, 0, sizeof( wBarrier ) );
+  status = rtems_barrier_create (
+    rtems_build_name ( 'B', 'A', 'R', 'w' ),
+    RTEMS_BARRIER_MANUAL_RELEASE,
+    2,
+    &wBarrier
+    );
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );
+
+  readTaskName = rtems_build_name( 'T','A','r',' ' );
+  status = rtems_task_create(
+                            readTaskName,
+                            1,
+                            RTEMS_MINIMUM_STACK_SIZE * 2,
+                            RTEMS_INTERRUPT_LEVEL(31),
+                            RTEMS_DEFAULT_ATTRIBUTES,
+                            &readTaskID
+                            );
+<span style="background-color: #FF0000">  </span>
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );
+
+  puts( "Init - Creating fifo file /fifo" );
+  status = mkfifo( "/fifo", 0777 );
+  rtems_test_assert( status == 0 );
+
+  puts( "Init - starting the read task" );
+  status = rtems_task_start( readTaskID, read_task, 0 );
+  rtems_test_assert( status == 0 );
+
+  puts( "Init - waiting at a barrier" );
+  status = rtems_barrier_wait( wBarrier, RTEMS_NO_TIMEOUT );
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );
+
+  puts("Init - opening the fifo in write only mode -- OK");
+  fd = open("/fifo", O_WRONLY);
+  if(fd <= 0) {
+    printf("Error opening file: (%d) :: %s\n", errno, strerror(errno));
+    rtems_test_assert(0);
+  }
+
+  puts( "Init - writing to /fifo" );
+  status = write(fd, sendBuf, 0 );
+  rtems_test_assert( status == 0 );
+
+  puts( "Init - releasing the read_task" );
+  status = rtems_barrier_release( rBarrier, &released );
+  rtems_test_assert( status == 0 );
+
+  puts( "Init - waiting at a barrier" );
+  status = rtems_barrier_wait( wBarrier, RTEMS_NO_TIMEOUT );
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );
+<span style="background-color: #FF0000">  </span>
+  puts( "Init - writing to /fifo - OK" );
+  status = write(fd, sendBuf, SEND_RCV_BUFSIZ - 30 );
+  rtems_test_assert( status == SEND_RCV_BUFSIZ - 30 );
+
+  puts( "Init - writing to /fifo - OK" );
+  status = write(fd, sendBuf+SEND_RCV_BUFSIZ - 30, 30 );
+  rtems_test_assert( status == 30 );
+
+  puts( "Init - releasing the read_task" );
+  status = rtems_barrier_release( rBarrier, &released );
+  rtems_test_assert( status == 0 );
+
+  puts( "Init - waiting at a barrier" );
+  status = rtems_barrier_wait( wBarrier, RTEMS_NO_TIMEOUT );
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );<span style="background-color: #FF0000">  </span>
+
+  puts( "Init - converting the write-mode to non-block" );
+  status = ioctl( fd, FIONBIO, &flag );
+  rtems_test_assert( status == 0 );
+
+  puts( "Init - writing to /fifo - OK" );
+  status = write(fd, sendBuf, SEND_RCV_BUFSIZ - 30 );
+  rtems_test_assert( status == SEND_RCV_BUFSIZ - 30 );
+<span style="background-color: #FF0000">  </span>
+  puts( "Init - writing to /fifo - Expect EAGAIN" );
+  status = write(fd, sendBuf, SEND_RCV_BUFSIZ - 30 );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == EAGAIN );
+
+  puts( "Init - releasing the read_task" );
+  status = rtems_barrier_release( rBarrier, &released );
+  rtems_test_assert( status == 0 );
+
+  puts( "Init - waiting at a barrier" );
+  status = rtems_barrier_wait( wBarrier, RTEMS_NO_TIMEOUT );
+  rtems_test_assert( status == RTEMS_SUCCESSFUL );<span style="background-color: #FF0000">  </span>
+
+  puts( "Init - writing to /fifo - Expect EPIPE" );
+  status = write(fd, sendBuf, SEND_RCV_BUFSIZ - 30 );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == EPIPE );
+
+  status = close( fd );
+  rtems_test_assert( status == 0 );
+
+  puts( "Removing the fifo" );
+  status = unlink("/fifo");
+  rtems_test_assert(status == 0);
+<span style="background-color: #FF0000">  </span>
+  puts("*** END OF FIFO / PIPE OPEN TEST - 6 ***");
+  rtems_test_exit(0);
+}
+
+#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 6
+
+#define CONFIGURE_MAXIMUM_TASKS 3
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_MAXIMUM_BARRIERS 2
+
+#define CONFIGURE_INIT
+#define CONFIGURE_FIFOS_ENABLED
+#define CONFIGURE_MAXIMUM_FIFOS 1
+
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/sptests/spfifo05/spfifo05.doc:1.1
--- /dev/null   Mon Jul  5 16:13:11 2010
+++ rtems/testsuites/sptests/spfifo05/spfifo05.doc      Mon Jul  5 15:14:19 2010
</font><font color='#997700'>@@ -0,0 +1,23 @@
</font><font color='#000088'>+#
+#  $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.
+
+directives
+
++ fifo_open
++ pipe_read
++ pipe_read
+
+concepts
+
++ Exercise pipe_read completely, including the error paths
++ Exercise pipe_write completely, including the error paths
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/sptests/spfifo05/spfifo05.scn:1.1
--- /dev/null   Mon Jul  5 16:13:11 2010
+++ rtems/testsuites/sptests/spfifo05/spfifo05.scn      Mon Jul  5 15:14:19 2010
</font><font color='#997700'>@@ -0,0 +1,36 @@
</font><font color='#000088'>+*** FIFO / PIPE TESTS - 5 ***
+Init - Creating fifo file /fifo
+Init - starting the read task
+Init - waiting at a barrier
+read_task - opening /fifo in non-blocking mode
+read_task - attempt to read with number of writers = 0
+read_task - releasing the write task
+read_task - waiting at a barrier
+Init - opening the fifo in write only mode -- OK
+Init - writing to /fifo
+Init - releasing the read_task
+Init - waiting at a barrier
+read_task - attempting to read from the fifo -- Expect EAGAIN
+read_task - closing /fifo
+read_task - opening /fifo in read-only mode
+read_task - releasing the write task
+read_task - reading from /fifo - OKInit - writing to /fifo - OK
+
+Init - writing to /fifo - OK
+read_task - reading from /fifo - OK
+read_task - waiting at a barrierInit - releasing the read_task
+
+Init - waiting at a barrier
+read_task - reading from /fifo - OK
+read_task - releasing the write task
+read_task - waiting at a barrier
+Init - converting the write-mode to non-block
+Init - writing to /fifo - OK
+Init - writing to /fifo - Expect EAGAIN
+Init - releasing the read_task
+Init - waiting at a barrier
+read_task - releasing the write task
+Init - writing to /fifo - Expect EPIPE
+Removing the fifo
+*** END OF FIFO / PIPE OPEN TEST - 6 ***
+
</font></pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>