Skip to content

Add IPV6 default route test #10842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/route/test_default_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from tests.common.utilities import wait_until
from tests.common.utilities import find_duthost_on_role
from tests.common.utilities import get_upstream_neigh_type
from tests.syslog.syslog_utils import is_mgmt_vrf_enabled


pytestmark = [
Expand Down Expand Up @@ -215,3 +216,21 @@ def test_default_route_with_bgp_flap(duthosts, tbinfo):
duthost.command("sudo config bgp startup all")
if not wait_until(300, 10, 0, duthost.check_bgp_session_state, list(bgp_neighbors.keys())):
pytest.fail("not all bgp sessions are up after config reload")


def test_ipv6_default_route_table_enabled_for_mgmt_interface(duthosts, tbinfo):
"""
check if ipv6 default route nexthop address uses global address

"""
duthost = find_duthost_on_role(
duthosts, get_upstream_neigh_type(tbinfo['topo']['type']), tbinfo)

# When management-vrf enabled, IPV6 route of management interface will not add to 'default' route table
if is_mgmt_vrf_enabled(duthost):
logging.info("Ignore IPV6 default route table test because management-vrf enabled")
return

ipv6_rules = duthost.command("ip -6 rule list")["stdout"]
pytest_assert("32767:\tfrom all lookup default" in ipv6_rules,
"IPV6 rules does not include default route table: {}".format(ipv6_rules))