diff --git a/test/zdtm/static/detached_namespace_with_bindmount.c b/test/zdtm/static/detached_namespace_with_bindmount.c index 64380a97b..9d93dd694 100644 --- a/test/zdtm/static/detached_namespace_with_bindmount.c +++ b/test/zdtm/static/detached_namespace_with_bindmount.c @@ -125,6 +125,9 @@ static int child(void *arg) char ns_path[PATH_MAX], *net_bind = (char *)arg; int ppid = getppid(), ret = 1, sk = -1; + if (system("ip link set up dev lo")) + goto err; + if (create_self_netns_bind(net_bind)) goto err; diff --git a/test/zdtm/static/detached_namespace_with_bindmount.desc b/test/zdtm/static/detached_namespace_with_bindmount.desc index 684a82cec..6076c4f66 100644 --- a/test/zdtm/static/detached_namespace_with_bindmount.desc +++ b/test/zdtm/static/detached_namespace_with_bindmount.desc @@ -1 +1,6 @@ -{'flavor': 'ns uns', 'flags': 'suid', 'ropts': '--no-mounts-compat'} +{ + 'deps': ['/sbin/ip|bin/ip', '/bin/sh'], + 'flavor': 'ns uns', + 'flags': 'suid', + 'ropts': '--no-mounts-compat' +} diff --git a/test/zdtm/static/netns_sysfs.c b/test/zdtm/static/netns_sysfs.c index 8ce265ff7..66bc2ff29 100644 --- a/test/zdtm/static/netns_sysfs.c +++ b/test/zdtm/static/netns_sysfs.c @@ -34,6 +34,11 @@ static int netns_child(void *arg) char ip_cmd[64]; char *path = (char *)arg; + if (system("ip link set up dev lo")) { + futex_set_and_wake(futex, EMERGENCY_ABORT); + return 1; + } + snprintf(ip_cmd, sizeof(ip_cmd), "ip link add name %s type bridge", NETNS_SYSFS_ZDTMBR); diff --git a/test/zdtm/static/ns_file_bindmount.c b/test/zdtm/static/ns_file_bindmount.c index 800b1e946..405eb4a72 100644 --- a/test/zdtm/static/ns_file_bindmount.c +++ b/test/zdtm/static/ns_file_bindmount.c @@ -20,6 +20,8 @@ TEST_OPTION(dirname, string, "directory name", 1); static int child(void *unused) { + system("ip link set up dev lo"); + while (1) sleep(1); return 0; diff --git a/test/zdtm/static/ns_file_bindmount.desc b/test/zdtm/static/ns_file_bindmount.desc index 684a82cec..851416e86 100644 --- a/test/zdtm/static/ns_file_bindmount.desc +++ b/test/zdtm/static/ns_file_bindmount.desc @@ -1 +1,6 @@ -{'flavor': 'ns uns', 'flags': 'suid', 'ropts': '--no-mounts-compat'} +{ + 'deps': ['/sbin/ip|/bin/ip', '/bin/sh'], + 'flavor': 'ns uns', + 'flags': 'suid', + 'ropts': '--no-mounts-compat' +}