diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-10-22 11:06:19 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-10-31 13:18:50 +0100 |
commit | 5ddce1f19667e20e197dd05cef8587aedc27ade1 (patch) | |
tree | 47752005398872add0fae589fa67a956b5e47806 /testsuite/loopback01 | |
parent | Map <sys/md5.h> to RTEMS <md5.h> (diff) | |
download | rtems-libbsd-5ddce1f19667e20e197dd05cef8587aedc27ade1.tar.bz2 |
loopback01: Initialize via IFCONFIG(8)
Diffstat (limited to 'testsuite/loopback01')
-rw-r--r-- | testsuite/loopback01/test_main.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/testsuite/loopback01/test_main.c b/testsuite/loopback01/test_main.c index 6f58f329..396b8ef9 100644 --- a/testsuite/loopback01/test_main.c +++ b/testsuite/loopback01/test_main.c @@ -6,12 +6,14 @@ #include <stdlib.h> #include <stdio.h> +#include <rtems/bsd/sys/param.h> #include <sys/socket.h> #include <netinet/in.h> #define TEST_NAME "LIBBSD LOOPBACK 1" #include <rtems/error.h> +#include <assert.h> #include <stdio.h> #include <stdarg.h> #include <stdlib.h> @@ -19,31 +21,11 @@ #include <errno.h> #include <sys/socket.h> #include <netinet/in.h> +#include <sysexits.h> -/* for old configuration structure */ -#include <rtems/rtems_bsdnet.h> +#include <machine/rtems-bsd-commands.h> -/* - * Network configuration - */ -struct rtems_bsdnet_config rtems_bsdnet_config = { - NULL, /* Network interface */ - NULL, /* Use fixed network configuration */ - 0, /* Default network task priority */ - 0, /* Default mbuf capacity */ - 0, /* Default mbuf cluster capacity */ - "testSystem", /* Host name */ - "nowhere.com", /* Domain name */ - "127.0.0.1", /* Gateway */ - "127.0.0.1", /* Log host */ - {"127.0.0.1" }, /* Name server(s) */ - {"127.0.0.1" }, /* NTP server(s) */ - 0, - 0, - 0, - 0, - 0 -}; +#include <rtems.h> /* * Thread-safe output routines @@ -216,6 +198,16 @@ static void test_main(void) { rtems_status_code sc; rtems_task_priority old; + int exit_code; + char *lo0[] = { + "ifconfig", + "lo0", + "inet", + "127.0.0.1", + "netmask", + "255.255.255.0", + NULL + }; sc = rtems_semaphore_create( rtems_build_name('P','m','t','x'), @@ -240,6 +232,9 @@ static void test_main(void) printf("Should fail with `connection refused'.\n"); clientWorker(0); + exit_code = rtems_bsd_command_ifconfig(nitems(lo0) - 1, lo0); + assert(exit_code == EX_OK); + printf("\nStart server.\n"); spawnTask(serverTask, 150, 0); |