diff --git a/tests/gnrc_rpl/Makefile b/tests/gnrc_rpl/Makefile index f36d5a9f8159e..5e90bd90e2a6f 100644 --- a/tests/gnrc_rpl/Makefile +++ b/tests/gnrc_rpl/Makefile @@ -4,11 +4,14 @@ USEMODULE += auto_init_gnrc_netif USEMODULE += auto_init_gnrc_rpl USEMODULE += gnrc_ipv6_router_default USEMODULE += gnrc_icmpv6_echo +USEMODULE += gnrc_netif_bus USEMODULE += gnrc_rpl USEMODULE += shell USEMODULE += shell_cmds_default +DISABLE_MODULE += test_utils_print_stack_usage + ifeq (native, $(BOARD)) USEMODULE += socket_zep USEMODULE += socket_zep_hello diff --git a/tests/gnrc_rpl/main.c b/tests/gnrc_rpl/main.c index 116f93cb8817b..9faec900bf087 100644 --- a/tests/gnrc_rpl/main.c +++ b/tests/gnrc_rpl/main.c @@ -20,14 +20,33 @@ #include "shell.h" #include "msg.h" +#include "thread.h" +#include "net/gnrc/netif.h" #define MAIN_QUEUE_SIZE (8) static msg_t _main_msg_queue[MAIN_QUEUE_SIZE]; +static char _uplink_mon_stack[2 * THREAD_STACKSIZE_DEFAULT]; + +static void * _uplink_mon(void *arg) +{ + (void)arg; + + if (gnrc_netif_ipv6_wait_for_global_address(NULL, 10 * MS_PER_SEC)) { + puts("uplink ready"); + } else { + puts("uplink timeout"); + } + + return NULL; +} int main(void) { char line_buf[SHELL_DEFAULT_BUFSIZE]; + thread_create(_uplink_mon_stack, sizeof(_uplink_mon_stack), THREAD_PRIORITY_MAIN - 1, + THREAD_CREATE_STACKTEST, _uplink_mon, NULL, "uplink monitor"); + msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE); shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); diff --git a/tests/gnrc_rpl/tests/01-run.py b/tests/gnrc_rpl/tests/01-run.py index 9610f7ed84365..e47c318f4d730 100755 --- a/tests/gnrc_rpl/tests/01-run.py +++ b/tests/gnrc_rpl/tests/01-run.py @@ -90,13 +90,14 @@ def test_linear_topology(factory, zep_dispatch): D = nodes[3] # add prefix to root node - A.cmd("nib prefix add 5 2001:db8::/32") - A.cmd("ifconfig 5 add 2001:db8::1/32") + A.cmd("nib prefix add 5 2001:db8::/64") + A.cmd("ifconfig 5 add 2001:db8::1/64") A.cmd("rpl root 0 2001:db8::1") root_addr = global_addr(A.ifconfig_list())[1] # wait for the creation of the DODAG - time.sleep(10) + D.riotctrl.term.expect("uplink ready") + time.sleep(5) # ping root node from last node parser = GNRCICMPv6EchoParser() @@ -137,13 +138,14 @@ def test_alternative_route(factory, zep_dispatch): D = nodes[3] # add prefix to root node - A.cmd("nib prefix add 5 2001:db8::/32") - A.cmd("ifconfig 5 add 2001:db8::1/32") + A.cmd("nib prefix add 5 2001:db8::/64") + A.cmd("ifconfig 5 add 2001:db8::1/64") A.cmd("rpl root 0 2001:db8::1") root_addr = global_addr(A.ifconfig_list())[1] # wait for the creation of the DODAG - time.sleep(10) + D.riotctrl.term.expect("uplink ready") + time.sleep(5) # ping root node from last node parser = GNRCICMPv6EchoParser()