Commit ae41ff15 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

testsuite/smokey: net: do not down a previously running test interface

If the test interface is already up on entry, keep it that way on
exit, so that we may run this test multiple times without having to
reconfigure.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent db26782f
......@@ -36,7 +36,7 @@ struct module {
static struct rtnet_core_cmd cmd;
static int fd;
static pthread_t loopback_server_tid;
static bool loopback_thread_created;
static bool loopback_thread_created, ifup;
static struct module modules[] = {
{
.name = "rtnet",
......@@ -447,6 +447,7 @@ int smokey_net_setup(const char *driver, const char *intf, int tested_config,
err = do_up(intf);
if (err < 0)
goto err;
ifup = true;
}
smokey_trace("Waiting for interface %s to be running", intf);
......@@ -543,9 +544,11 @@ int smokey_net_teardown(const char *driver, const char *intf, int tested_config)
err = tmp;
}
tmp = do_down(intf);
if (err == 0)
err = tmp;
if (ifup) {
tmp = do_down(intf);
if (err == 0)
err = tmp;
}
close(fd);
} else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment