Skip to content

Commit

Permalink
zdtm: workaround ip route dump problem
Browse files Browse the repository at this point in the history
This is needed to workaround the problem with "ip route save":
(00.113153)     Running ip route save
Error: ipv4: FIB table does not exist.

checkpoint-restore#747
https://jira.sw.ru/browse/PSBM-120728

v2: add the same to openvswitch test

https://jira.sw.ru/browse/PSBM-123769
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

Feature: ZDTM
  • Loading branch information
Snorch committed Apr 26, 2023
1 parent d5ce54e commit bc9fcbd
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/zdtm/static/detached_namespace_with_bindmount.c
Expand Up @@ -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;

Expand Down
7 changes: 6 additions & 1 deletion 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'
}
5 changes: 5 additions & 0 deletions test/zdtm/static/netns_sysfs.c
Expand Up @@ -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);

Expand Down
5 changes: 5 additions & 0 deletions test/zdtm/static/ns_file_bindmount.c
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion 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'
}
3 changes: 3 additions & 0 deletions test/zdtm/static/openvswitch00.c
Expand Up @@ -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) {
Expand Down

0 comments on commit bc9fcbd

Please sign in to comment.