<!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 (2011-05-06)</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>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-05-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
* ftp01/.cvsignore, ftp01/Makefile.am, ftp01/ftp01.doc,
ftp01/ftp01.scn, ftp01/init.c: New files.
* Makefile.am, configure.ac: Reflect changes above.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ChangeLog.diff?r1=text&tr1=1.265&r2=text&tr2=1.266&diff_format=h">M</a></td><td width='1%'>1.266</td><td width='100%'>testsuites/libtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/Makefile.am.diff?r1=text&tr1=1.51&r2=text&tr2=1.52&diff_format=h">M</a></td><td width='1%'>1.52</td><td width='100%'>testsuites/libtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/configure.ac.diff?r1=text&tr1=1.63&r2=text&tr2=1.64&diff_format=h">M</a></td><td width='1%'>1.64</td><td width='100%'>testsuites/libtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ftp01/.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/libtests/ftp01/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ftp01/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/libtests/ftp01/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ftp01/ftp01.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/libtests/ftp01/ftp01.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ftp01/ftp01.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/libtests/ftp01/ftp01.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ftp01/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/libtests/ftp01/init.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/libtests/ChangeLog:1.265 rtems/testsuites/libtests/ChangeLog:1.266
--- rtems/testsuites/libtests/ChangeLog:1.265 Thu May 5 11:45:47 2011
+++ rtems/testsuites/libtests/ChangeLog Fri May 6 04:08:07 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-05-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * ftp01/.cvsignore, ftp01/Makefile.am, ftp01/ftp01.doc,
+ ftp01/ftp01.scn, ftp01/init.c: New files.
+ * Makefile.am, configure.ac: Reflect changes above.
+
</font> 2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* devnullfatal01/testcase.h, malloc02/init.c, malloc04/init.c,
<font color='#006600'>diff -u rtems/testsuites/libtests/Makefile.am:1.51 rtems/testsuites/libtests/Makefile.am:1.52
--- rtems/testsuites/libtests/Makefile.am:1.51 Mon Mar 14 11:18:10 2011
+++ rtems/testsuites/libtests/Makefile.am Fri May 6 04:08:07 2011
</font><font color='#997700'>@@ -18,5 +18,9 @@
</font> math mathf mathl complex \
mouse01
<font color='#000088'>+if NETTESTS
+SUBDIRS += ftp01
+endif
+
</font> include $(top_srcdir)/../automake/subdirs.am
include $(top_srcdir)/../automake/local.am
<font color='#006600'>diff -u rtems/testsuites/libtests/configure.ac:1.63 rtems/testsuites/libtests/configure.ac:1.64
--- rtems/testsuites/libtests/configure.ac:1.63 Mon Mar 14 11:18:10 2011
+++ rtems/testsuites/libtests/configure.ac Fri May 6 04:08:07 2011
</font><font color='#997700'>@@ -28,6 +28,7 @@
</font>
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
RTEMS_CHECK_CXX(RTEMS_BSP)
<font color='#000088'>+RTEMS_CHECK_CPUOPTS([RTEMS_NETWORKING])
</font>
AC_PROG_LN_S
AC_PATH_PROG([PAX],[pax])
<font color='#997700'>@@ -38,6 +39,7 @@
</font>
AM_CONDITIONAL(HAS_CXX,test "$rtems_cv_HAS_CPLUSPLUS" = "yes")
AM_CONDITIONAL([HAS_COMPLEX],[test "$ac_cv_header_complex_h" = yes])
<font color='#000088'>+AM_CONDITIONAL(NETTESTS,test "$rtems_cv_RTEMS_NETWORKING" = "yes")
</font>
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
<font color='#997700'>@@ -60,6 +62,7 @@
</font> deviceio01/Makefile
devnullfatal01/Makefile
dumpbuf01/Makefile
<font color='#000088'>+ftp01/Makefile
</font> gxx01/Makefile
heapwalk/Makefile
malloctest/Makefile
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/ftp01/.cvsignore:1.1
--- /dev/null Fri May 6 04:11:48 2011
+++ rtems/testsuites/libtests/ftp01/.cvsignore Fri May 6 04:08:07 2011
</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/libtests/ftp01/Makefile.am:1.1
--- /dev/null Fri May 6 04:11:48 2011
+++ rtems/testsuites/libtests/ftp01/Makefile.am Fri May 6 04:08:07 2011
</font><font color='#997700'>@@ -0,0 +1,28 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = ftp01
+ftp01_SOURCES = init.c
+ftp01_LDADD = -lftpd
+
+dist_rtems_tests_DATA = ftp01.scn
+dist_rtems_tests_DATA += ftp01.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
+AM_CPPFLAGS += -I$(top_srcdir)/termios04
+
+LINK_OBJS = $(ftp01_OBJECTS) $(ftp01_LDADD)
+LINK_LIBS = $(ftp01_LDLIBS)
+
+ftp01$(EXEEXT): $(ftp01_OBJECTS) $(ftp01_DEPENDENCIES)
+ @rm -f ftp01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/ftp01/ftp01.doc:1.1
--- /dev/null Fri May 6 04:11:48 2011
+++ rtems/testsuites/libtests/ftp01/ftp01.doc Fri May 6 04:08:07 2011
</font><font color='#997700'>@@ -0,0 +1,27 @@
</font><font color='#000088'>+#<span style="background-color: #FF0000"> </span>
+# Copyright (c) 2011 embedded brains GmbH. All rights reserved.
+#<span style="background-color: #FF0000"> </span>
+# embedded brains GmbH
+# Obere Lagerstr. 30
+# 82178 Puchheim
+# Germany
+# <rtems@embedded-brains.de>
+#<span style="background-color: #FF0000"> </span>
+# 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$
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: ftp
+
+directives:
+
+ FTP server and client
+
+concepts:
+
++ Check if FTP server and client works.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/ftp01/ftp01.scn:1.1
--- /dev/null Fri May 6 04:11:48 2011
+++ rtems/testsuites/libtests/ftp01/ftp01.scn Fri May 6 04:08:07 2011
</font><font color='#997700'>@@ -0,0 +1,51 @@
</font><font color='#000088'>+*** TEST FTP 1 ***
+syslog: ftpd: FTP daemon started (2 sessions max)
+220 RTEMS FTP server (Version 1.1-JWJ) ready.
+USER anonymous
+230 User logged in.
+TYPE I
+200 Type set to I.
+PASV
+227 Entering passive mode (127,0,0,1,4,1).
+STOR a.txt
+150 Opening BINARY mode data connection.
+226 Transfer complete.
+QUIT
+221 Goodbye.
+220 RTEMS FTP server (Version 1.1-JWJ) ready.
+USER anonymous
+230 User logged in.
+TYPE I
+200 Type set to I.
+PASV
+227 Entering passive mode (127,0,0,1,4,4).
+RETR a.txt
+150 Opening BINARY mode data connection.
+220 RTEMS FTP server (Version 1.1-JWJ) ready.
+USER anonymous
+230 User logged in.
+TYPE I
+200 Type set to I.
+PASV
+227 Entering passive mode (127,0,0,1,4,7).
+STOR b.txt
+150 Opening BINARY mode data connection.
+226 Transfer complete.
+226 Transfer complete.
+QUIT
+221 Goodbye.
+QUIT
+221 Goodbye.
+220 RTEMS FTP server (Version 1.1-JWJ) ready.
+USER anonymous
+230 User logged in.
+TYPE I
+200 Type set to I.
+PASV
+227 Entering passive mode (127,0,0,1,4,10).
+RETR b.txt
+150 Opening BINARY mode data connection.
+226 Transfer complete.
+QUIT
+221 Goodbye.
+*** END OF TEST FTP 1 ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/ftp01/init.c:1.1
--- /dev/null Fri May 6 04:11:48 2011
+++ rtems/testsuites/libtests/ftp01/init.c Fri May 6 04:08:07 2011
</font><font color='#997700'>@@ -0,0 +1,211 @@
</font><font color='#000088'>+/*
+ * Copyright (c) 2011 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * 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 <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+#include <rtems.h>
+#include <tmacros.h>
+
+#include <rtems/rtems_bsdnet.h>
+#include <rtems/ftpd.h>
+#include <rtems/ftpfs.h>
+
+struct rtems_bsdnet_config rtems_bsdnet_config;
+
+struct rtems_ftpd_configuration rtems_ftpd_configuration = {
+ .priority = 90,
+ .max_hook_filesize = 0,
+ .port = 21,
+ .hooks = NULL,
+ .root = NULL,
+ .tasks_count = 2,
+ .idle = 0,
+ .access = 0
+};
+
+static const char content [] =
+" LICENSE INFORMATION\n"
+"\n"
+"RTEMS is free software; you can redistribute it and/or modify it under\n"
+"terms of the GNU General Public License as published by the\n"
+"Free Software Foundation; either version 2, or (at your option) any\n"
+"later version. RTEMS is distributed in the hope that it will be useful,\n"
+"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
+"General Public License for more details. You should have received\n"
+"a copy of the GNU General Public License along with RTEMS; see\n"
+"file COPYING. If not, write to the Free Software Foundation, 675\n"
+"Mass Ave, Cambridge, MA 02139, USA.\n"
+"\n"
+"As a special exception, including RTEMS header files in a file,\n"
+"instantiating RTEMS generics or templates, or linking other files\n"
+"with RTEMS objects to produce an executable application, does not\n"
+"by itself cause the resulting executable application to be covered\n"
+"by the GNU General Public License. This exception does not\n"
+"however invalidate any other reasons why the executable file might be\n"
+"covered by the GNU Public License.\n";
+
+static void initialize_ftpfs(void)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ int rv = 0;
+ struct timeval to = {
+ .tv_sec = 10,
+ .tv_usec = 0
+ };
+ const char *target = RTEMS_FTPFS_MOUNT_POINT_DEFAULT;
+
+ rv = mount_and_make_target_path(
+ NULL,
+ target,
+ RTEMS_FILESYSTEM_TYPE_FTPFS,
+ RTEMS_FILESYSTEM_READ_WRITE,
+ NULL
+ );
+ rtems_test_assert(rv == 0);
+
+ sc = rtems_ftpfs_set_verbose(target, true);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_ftpfs_set_timeout(target, &to);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void change_self_priority(void)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ rtems_task_priority cur = 0;
+
+ sc = rtems_task_set_priority(RTEMS_SUCCESSFUL, 110, &cur);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void create_file(const char *path)
+{
+ int rv = 0;
+ int fd = open(path, O_WRONLY);
+ ssize_t n = 0;
+
+ rtems_test_assert(fd >= 0);
+
+ n = write(fd, &content [0], sizeof(content));
+ rtems_test_assert(n == (ssize_t) sizeof(content));
+
+ rv = close(fd);
+ rtems_test_assert(rv == 0);
+}
+
+static void copy_file(const char *src_path, const char *dest_path)
+{
+ int rv = 0;
+ int in = open(src_path, O_RDONLY);
+ int out = open(dest_path, O_WRONLY);
+ ssize_t n_in = 0;
+ char buf [64];
+
+ rtems_test_assert(in >= 0);
+ rtems_test_assert(out >= 0);
+
+ while ((n_in = read(in, buf, sizeof(buf))) > 0) {
+ ssize_t n_out = write(out, buf, (size_t) n_in);
+ rtems_test_assert(n_out == n_in);
+ }
+
+ rv = close(out);
+ rtems_test_assert(rv == 0);
+
+ rv = close(in);
+ rtems_test_assert(rv == 0);
+}
+
+static void check_file(const char *path)
+{
+ int rv = 0;
+ int fd = open(path, O_RDONLY);
+ ssize_t n = 0;
+ char buf [64];
+ const char *current = &content [0];
+ size_t done = 0;
+
+ rtems_test_assert(fd >= 0);
+
+ while ((n = read(fd, buf, sizeof(buf))) > 0) {
+ done += (size_t) n;
+ rtems_test_assert(done <= sizeof(content));
+ rtems_test_assert(memcmp(current, buf, (size_t) n) == 0);
+ current += (size_t) n;
+ }
+
+ rtems_test_assert(done == sizeof(content));
+
+ rv = close(fd);
+ rtems_test_assert(rv == 0);
+}
+
+static void test(void)
+{
+ int rv = 0;
+ const char file_a [] = "/FTP/127.0.0.1/a.txt";
+ const char file_b [] = "/FTP/127.0.0.1/b.txt";
+
+ rv = rtems_bsdnet_initialize_network();
+ rtems_test_assert(rv == 0);
+
+ rv = rtems_initialize_ftpd();
+ rtems_test_assert(rv == 0);
+
+ initialize_ftpfs();
+ change_self_priority();
+ create_file(file_a);
+ copy_file(file_a, file_b);
+ check_file(file_b);
+}
+
+static rtems_task Init(rtems_task_argument argument)
+{
+ puts("\n\n*** TEST FTP 1 ***");
+ test();
+ puts("*** END OF TEST FTP 1 ***");
+
+ rtems_test_exit(0);
+}
+
+#define CONFIGURE_INIT
+
+#define CONFIGURE_MICROSECONDS_PER_TICK 10000
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 14
+
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_FILESYSTEM_FTPFS
+
+#define CONFIGURE_MAXIMUM_DRIVERS 2
+
+#define CONFIGURE_MAXIMUM_TASKS 5
+#define CONFIGURE_MAXIMUM_SEMAPHORES 2
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#include <rtems/confdefs.h>
</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>