From 42cd4b0bdea8156aea4b90e85f1735e34d9d7e62 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sat, 1 Sep 2012 13:34:42 -0500 Subject: [PATCH] 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(-) create mode 100644 testsuite/netshell01/Makefile create mode 100644 testsuite/netshell01/shellconfig.c create mode 100644 testsuite/netshell01/test_main.c diff --git a/testsuite/init01/init.c b/testsuite/init01/init.c index eba9e743..028dcde3 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 00000000..d6723efb --- /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 00000000..64e9e128 --- /dev/null +++ b/testsuite/netshell01/shellconfig.c @@ -0,0 +1,15 @@ +/* + * Shell Configuration + */ + +#include + +#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 + + diff --git a/testsuite/netshell01/test_main.c b/testsuite/netshell01/test_main.c new file mode 100644 index 00000000..65304849 --- /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 +#include +#include +#include +#include + +#include + +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 ); +}