summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2020-07-31 16:10:24 -0700
committergVisor bot <gvisor-bot@google.com>2020-07-31 16:14:06 -0700
commitfd5f4ffed1e425ec29d29477dc4e2a61420c1cf6 (patch)
treed4982b87588cecaffc2cd3913bfc1e19ff203567 /test/syscalls
parenta7d9aa6d5bfbed11c94578c6a2eb04ce75cbdbe5 (diff)
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
Diffstat (limited to 'test/syscalls')
-rw-r--r--test/syscalls/linux/socket_netlink_route.cc5
1 files changed, 4 insertions, 1 deletions
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;
}