Commit cbfe9f3b authored by Ondřej Zajíček's avatar Ondřej Zajíček

Tests: Use iproute native family arg for IP version selection

parent 1ef90733
......@@ -34,13 +34,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -34,13 +34,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -34,13 +34,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,13 +17,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,19 +17,19 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4_ospf3(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt5", exp_devs, "IPv4", "100")
tk.test_krt_routes("krt5", exp_devs, "inet", "100")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,13 +17,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,13 +17,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,13 +17,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,13 +17,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,13 +17,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,13 +17,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -17,13 +17,13 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
......@@ -16,25 +16,25 @@ def test_wait():
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv4(exp_devs: str):
"""IPv4: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt4", exp_devs, "IPv4")
tk.test_krt_routes("krt4", exp_devs, "inet")
def test_krt_routes_ipv4_vrf2():
tk.test_krt_routes("krt4vrf2", "m1", "IPv4", "200")
tk.test_krt_routes("krt4vrf2", "m1", "inet", "200")
def test_krt_routes_ipv4_vrf3():
tk.test_krt_routes("krt4vrf3", "m1", "IPv4", "300")
tk.test_krt_routes("krt4vrf3", "m1", "inet", "300")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_krt_routes_ipv6(exp_devs: str):
"""IPv6: get the content of KERNEL tables and check it"""
tk.test_krt_routes("krt6", exp_devs, "IPv6")
tk.test_krt_routes("krt6", exp_devs, "inet6")
def test_krt_routes_ipv6_vrf2():
tk.test_krt_routes("krt6vrf2", "m1", "IPv6", "200")
tk.test_krt_routes("krt6vrf2", "m1", "inet6", "200")
def test_krt_routes_ipv6_vrf3():
tk.test_krt_routes("krt6vrf3", "m1", "IPv6", "300")
tk.test_krt_routes("krt6vrf3", "m1", "inet6", "300")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
......
#!/bin/sh
. tests/strip_output
if [ $1 = "IPv4" ]; then variant=4; fi
if [ $1 = "IPv6" ]; then variant=6; fi
ip "-$variant" route show $2 \
ip -f $1 route show $2 \
| strip_addresses \
| strip_interfaces_via \
| strip_nexthop_pref \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment