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
This commit is contained in:
Andrei Vagin
2020-07-31 16:14:06 -07:00
committed by gVisor bot
parent a7d9aa6d5b
commit fd5f4ffed1
+4 -1
View File
@@ -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;
}