From fd5f4ffed1e425ec29d29477dc4e2a61420c1cf6 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 31 Jul 2020 16:10:24 -0700 Subject: test/socket_netlink_route: check that there is a route on local or main tables A new network namespace has only the local route table. PiperOrigin-RevId: 324303629 --- test/syscalls/linux/socket_netlink_route.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/syscalls') diff --git a/test/syscalls/linux/socket_netlink_route.cc b/test/syscalls/linux/socket_netlink_route.cc index e6647a1c3..b3fcf8e7c 100644 --- a/test/syscalls/linux/socket_netlink_route.cc +++ b/test/syscalls/linux/socket_netlink_route.cc @@ -577,7 +577,10 @@ TEST(NetlinkRouteTest, GetRouteDump) { std::cout << std::endl; - if (msg->rtm_table == RT_TABLE_MAIN) { + // If the test is running in a new network namespace, it will have only + // the local route table. + if (msg->rtm_table == RT_TABLE_MAIN || + (!IsRunningOnGvisor() && msg->rtm_table == RT_TABLE_LOCAL)) { routeFound = true; dstFound = rtDstFound && dstFound; } -- cgit v1.2.3