[rtems-libbsd commit] netshell01: New test and stop using old network configuration code

Joel Sherrill joel at rtems.org
Sat Sep 1 18:33:45 UTC 2012


Module:    rtems-libbsd
Branch:    master
Commit:    42cd4b0bdea8156aea4b90e85f1735e34d9d7e62
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=42cd4b0bdea8156aea4b90e85f1735e34d9d7e62

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Sat Sep  1 13:34:42 2012 -0500

netshell01: New test and stop using old network configuration code

The old network configuration using a data structure does not
support IPV6 and does not support all of the network settings
that the FreeBSD command line utilities do. Transition to using
the network utilities like ifconfig, route, etc. to initialize
the NIC configuration.

---

 testsuite/init01/init.c            |    6 ------
 testsuite/netshell01/Makefile      |   30 ++++++++++++++++++++++++++++++
 testsuite/netshell01/shellconfig.c |   15 +++++++++++++++
 testsuite/netshell01/test_main.c   |   30 ++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 6 deletions(-)

diff --git a/testsuite/init01/init.c b/testsuite/init01/init.c
index eba9e74..028dcde 100644
--- a/testsuite/init01/init.c
+++ b/testsuite/init01/init.c
@@ -11,9 +11,6 @@
 void print_test_name(void);
 void test_main(void);
 
-/* XXX temporary until in .h file */
-void rtems_initialize_interfaces(void);
-
 rtems_task Init(
   rtems_task_argument ignored
 )
@@ -28,9 +25,6 @@ rtems_task Init(
 
   rtems_bsd_initialize_with_interrupt_server();
 
-  puts( "Initializing interfaces" );
-  rtems_initialize_interfaces();
-
   test_main();
   /* should not return */
 
diff --git a/testsuite/netshell01/Makefile b/testsuite/netshell01/Makefile
new file mode 100644
index 0000000..d6723ef
--- /dev/null
+++ b/testsuite/netshell01/Makefile
@@ -0,0 +1,30 @@
+include ../../config.inc
+
+PGM=${ARCH}/netshell01.exe
+
+# optional managers required
+MANAGERS=all
+
+# C source names
+C_FILES = init.c test_main.c shellconfig.c
+C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
+
+AM_CPPFLAGS += -I $(INSTALL_BASE)/include
+AM_CPPFLAGS += -I ../init01
+LINK_LIBS += $(INSTALL_BASE)/libbsdc.a
+LINK_LIBS += $(INSTALL_BASE)/libbsd.a ${REL_ARGS}
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+OBJS= $(C_O_FILES)
+CLEAN_ADDITIONS += init.c
+
+all:    init.c ${ARCH} $(PGM)
+
+init.c: ../init01/init.c
+	cp ../init01/init.c .
+
+$(PGM): $(OBJS)
+	-$(make-exe)
diff --git a/testsuite/netshell01/shellconfig.c b/testsuite/netshell01/shellconfig.c
new file mode 100644
index 0000000..64e9e12
--- /dev/null
+++ b/testsuite/netshell01/shellconfig.c
@@ -0,0 +1,15 @@
+/*
+ *  Shell Configuration
+ */
+
+#include <rtems/shell.h>
+
+#define CONFIGURE_SHELL_COMMANDS_INIT
+#define CONFIGURE_SHELL_COMMANDS_ALL
+#define CONFIGURE_SHELL_MOUNT_MSDOS
+#define CONFIGURE_SHELL_MOUNT_RFS
+#define CONFIGURE_SHELL_DEBUGRFS
+
+#include <rtems/shellconfig.h>
+
+
diff --git a/testsuite/netshell01/test_main.c b/testsuite/netshell01/test_main.c
new file mode 100644
index 0000000..6530484
--- /dev/null
+++ b/testsuite/netshell01/test_main.c
@@ -0,0 +1,30 @@
+/*
+ *  This is the body of the test. It does not do much except ensure
+ *  that the target is alive after initializing the TCP/IP stack.
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include <rtems/shell.h>
+
+void print_test_name(void)
+{
+  printf( "\n\n*** LIBFREEBSD NETWORK SHELL TEST ***\n" );
+}
+
+/*
+ * RTEMS Startup Task
+ */
+void test_main(void)
+{
+  rtems_shell_env_t env = rtems_global_shell_env;
+
+  rtems_shell_main_loop( &env );
+
+  puts( "*** END OF NETWORK SHELL TEST ***" );
+  exit( 0 );
+}




More information about the vc mailing list