diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-09-01 13:34:42 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-09-01 13:34:49 -0500 |
commit | 42cd4b0bdea8156aea4b90e85f1735e34d9d7e62 (patch) | |
tree | e9e4b5cfeb26527cbf7e59109ae0c3fd88b98040 | |
parent | res_send.c: Now compiles (diff) | |
download | rtems-libbsd-42cd4b0bdea8156aea4b90e85f1735e34d9d7e62.tar.bz2 |
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.
-rw-r--r-- | testsuite/init01/init.c | 6 | ||||
-rw-r--r-- | testsuite/netshell01/Makefile | 30 | ||||
-rw-r--r-- | testsuite/netshell01/shellconfig.c | 15 | ||||
-rw-r--r-- | 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 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 <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 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 <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 ); +} |