diff --git a/test/zdtm/static/detached_namespace_with_bindmount.c b/test/zdtm/static/detached_namespace_with_bindmount.c index 700f6b0a45..2019224053 100644 --- a/test/zdtm/static/detached_namespace_with_bindmount.c +++ b/test/zdtm/static/detached_namespace_with_bindmount.c @@ -126,6 +126,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 8b580b71ad..bd7a0e0d9a 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-mntns-compat-mode'} +{ + 'deps': ['/sbin/ip|bin/ip', '/bin/sh'], + 'flavor': 'ns uns', + 'flags': 'suid', + 'ropts': '--no-mntns-compat-mode' +} diff --git a/test/zdtm/static/netns_sysfs.c b/test/zdtm/static/netns_sysfs.c index e2e394f743..125c711e1e 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 510c45ad72..89351b3c8b 100644 --- a/test/zdtm/static/ns_file_bindmount.c +++ b/test/zdtm/static/ns_file_bindmount.c @@ -31,6 +31,11 @@ futex_t *futex; static int child(void *unused) { + if (system("ip link set up dev lo")) { + futex_set_and_wake(futex, EMERGENCY_ABORT); + return 1; + } + futex_set_and_wake(futex, CHILD_READY); futex_wait_while_lt(futex, TEST_FINISH); return 0; diff --git a/test/zdtm/static/ns_file_bindmount.desc b/test/zdtm/static/ns_file_bindmount.desc index 8b580b71ad..d786a5137e 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-mntns-compat-mode'} +{ + 'deps': ['/sbin/ip|/bin/ip', '/bin/sh'], + 'flavor': 'ns uns', + 'flags': 'suid', + 'ropts': '--no-mntns-compat-mode' +} diff --git a/test/zdtm/static/openvswitch00.c b/test/zdtm/static/openvswitch00.c index a20de3b1a9..3d8db1c436 100644 --- a/test/zdtm/static/openvswitch00.c +++ b/test/zdtm/static/openvswitch00.c @@ -38,6 +38,9 @@ int main(int argc, char **argv) pr_perror("can't unshare"); return 1; } + + if (system("ip link set up dev lo")) + goto err; #endif if (mkdir(dirname, 0700) < 0) {