First version of phase 2 tests added. * Tests included: + team vs team + team vs bond + team vs eth + 3 VLANs over team
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
diff --git a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml new file mode 100644 index 0000000..59ff534 --- /dev/null +++ b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml @@ -0,0 +1,102 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "activebackup"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="1.2.3.4/24" /> + </addresses> + </team> + <vlan id="vlan10"> + <options> + <option name="vlan_tci" value="10" /> + </options> + <slaves> + <slave id="test_if" /> + </slaves> + <addresses> + <address value="192.168.10.1/24" /> + </addresses> + </vlan> + <vlan id="vlan20"> + <options> + <option name="vlan_tci" value="20" /> + </options> + <slaves> + <slave id="test_if" /> + </slaves> + <addresses> + <address value="192.168.20.1/24" /> + </addresses> + </vlan> + <vlan id="vlan30"> + <options> + <option name="vlan_tci" value="30" /> + </options> + <slaves> + <slave id="test_if" /> + </slaves> + <addresses> + <address value="192.168.30.1/24" /> + </addresses> + </vlan> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="eth1" label="tnet" /> + <vlan id="vlan10"> + <options> + <option name="vlan_tci" value="10" /> + </options> + <slaves> + <slave id="eth1" /> + </slaves> + <addresses> + <address value="192.168.10.2/24" /> + </addresses> + </vlan> + <vlan id="vlan20"> + <options> + <option name="vlan_tci" value="20" /> + </options> + <slaves> + <slave id="eth1" /> + </slaves> + <addresses> + <address value="192.168.20.2/24" /> + </addresses> + </vlan> + <vlan id="vlan30"> + <options> + <option name="vlan_tci" value="30" /> + </options> + <slaves> + <slave id="eth1" /> + </slaves> + <addresses> + <address value="192.168.30.2/24" /> + </addresses> + </vlan> + </interfaces> + </host> + </network> + + <task python="3_vlans_over_team.py" /> +</lnstrecipe> diff --git a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml new file mode 100644 index 0000000..0e9f009 --- /dev/null +++ b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml @@ -0,0 +1,102 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "roundrobin"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="1.2.3.4/24" /> + </addresses> + </team> + <vlan id="vlan10"> + <options> + <option name="vlan_tci" value="10" /> + </options> + <slaves> + <slave id="test_if" /> + </slaves> + <addresses> + <address value="192.168.10.1/24" /> + </addresses> + </vlan> + <vlan id="vlan20"> + <options> + <option name="vlan_tci" value="20" /> + </options> + <slaves> + <slave id="test_if" /> + </slaves> + <addresses> + <address value="192.168.20.1/24" /> + </addresses> + </vlan> + <vlan id="vlan30"> + <options> + <option name="vlan_tci" value="30" /> + </options> + <slaves> + <slave id="test_if" /> + </slaves> + <addresses> + <address value="192.168.30.1/24" /> + </addresses> + </vlan> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="eth1" label="tnet" /> + <vlan id="vlan10"> + <options> + <option name="vlan_tci" value="10" /> + </options> + <slaves> + <slave id="eth1" /> + </slaves> + <addresses> + <address value="192.168.10.2/24" /> + </addresses> + </vlan> + <vlan id="vlan20"> + <options> + <option name="vlan_tci" value="20" /> + </options> + <slaves> + <slave id="eth1" /> + </slaves> + <addresses> + <address value="192.168.20.2/24" /> + </addresses> + </vlan> + <vlan id="vlan30"> + <options> + <option name="vlan_tci" value="30" /> + </options> + <slaves> + <slave id="eth1" /> + </slaves> + <addresses> + <address value="192.168.30.2/24" /> + </addresses> + </vlan> + </interfaces> + </host> + </network> + + <task python="3_vlans_over_team.py" /> +</lnstrecipe> diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py new file mode 100644 index 0000000..645e2cf --- /dev/null +++ b/recipes/regression_tests/phase2/3_vlans_over_team.py @@ -0,0 +1,93 @@ +from lnst.Controller.Task import ctl + +# ------ +# SETUP +# ------ + +m1 = ctl.get_host("testmachine1") +m2 = ctl.get_host("testmachine2") + +m1.sync_resources(modules=["IcmpPing", "Netperf"]) +m2.sync_resources(modules=["IcmpPing", "Netperf"]) + +# ------ +# TESTS +# ------ + +vlans = ["vlan10", "vlan20", "vlan30"] +offloads = ["gso", "gro", "tso"] + +for vlan1 in vlans: + for vlan2 in vlans: + ping_mod = ctl.get_module("IcmpPing", + options={ + "addr" : m2.get_ip(vlan2), + "count" : 100, + "iface" : m1.get_devname(vlan1), + "interval" : 0.1 + }) + netperf_srv = ctl.get_module("Netperf", + options={ + "role" : "server", + "bind" : m1.get_ip(vlan1), + }) + netperf_cli_tcp = ctl.get_module("Netperf", + options={ + "role" : "client", + "netperf_server" : + m1.get_ip(vlan1), + "duration" : 60, + "testname" : "TCP_STREAM", + "netperf_opts" : + "-L %s" % m2.get_ip(vlan1) + }) + netperf_cli_udp = ctl.get_module("Netperf", + options={ + "role" : "client", + "netperf_server" : + m1.get_ip(vlan1), + "duration" : 60, + "testname" : "UDP_STREAM", + "netperf_opts" : + "-L %s" % m2.get_ip(vlan1) + }) + for offload in offloads: + # These tests should pass + # Ping between same VLANs + if vlan1 == vlan2: + for state in ["on", "off"]: + # Offload setup + m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"), + offload, state)) + m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth2"), + offload, state)) + m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth3"), + offload, state)) + m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"), + offload, state)) + # Ping test + m1.run(ping_mod) + + # Netperf test (both TCP and UDP) + srv_proc = m1.run(netperf_srv, bg=True) + ctl.wait(2) + m2.run(netperf_cli_tcp, timeout=65) + m2.run(netperf_cli_udp, timeout=65) + srv_proc.intr() + + # These tests should fail + # Ping across different VLAN + elif vlan1 != vlan2: + for state in ["on", "off"]: + # Offload setup + m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"), + offload, state)) + m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth2"), + offload, state)) + m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth3"), + offload, state)) + m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"), + offload, state)) + + # Ping test + m1.run(ping_mod, expect="fail") diff --git a/recipes/regression_tests/phase2/active_backup_double_team.xml b/recipes/regression_tests/phase2/active_backup_double_team.xml new file mode 100644 index 0000000..0f98b40 --- /dev/null +++ b/recipes/regression_tests/phase2/active_backup_double_team.xml @@ -0,0 +1,58 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "activebackup"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.1/24" /> + </addresses> + </team> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "10:22:33:44:55:66", + "runner" : {"name" : "activebackup"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.2/24" /> + </addresses> + </team> + </interfaces> + </host> + </network> + + <task python="team_test.py" /> +</lnstrecipe> + + diff --git a/recipes/regression_tests/phase2/active_backup_team.xml b/recipes/regression_tests/phase2/active_backup_team.xml new file mode 100644 index 0000000..44a6430 --- /dev/null +++ b/recipes/regression_tests/phase2/active_backup_team.xml @@ -0,0 +1,40 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "activebackup"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.1/24" /> + </addresses> + </team> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="test_if" label="tnet"> + <addresses> + <address value="192.168.0.2/24" /> + </addresses> + </eth> + </interfaces> + </host> + </network> + + <task python="team_test.py" /> +</lnstrecipe> diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml new file mode 100644 index 0000000..621a4e8 --- /dev/null +++ b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml @@ -0,0 +1,54 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "activebackup"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.1/24" /> + </addresses> + </team> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <bond id="test_if"> + <options> + <option name="mode" value="active-backup" /> + <option name="miimon" value="100" /> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.2/24" /> + </addresses> + </bond> + </interfaces> + </host> + </network> + + <task python="team_test.py" /> +</lnstrecipe> + + diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml new file mode 100644 index 0000000..e7119a7 --- /dev/null +++ b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml @@ -0,0 +1,54 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "activebackup"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.1/24" /> + </addresses> + </team> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <bond id="test_if"> + <options> + <option name="mode" value="balance-rr" /> + <option name="miimon" value="100" /> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.2/24" /> + </addresses> + </bond> + </interfaces> + </host> + </network> + + <task python="team_test.py" /> +</lnstrecipe> + + diff --git a/recipes/regression_tests/phase2/round_robin_double_team.xml b/recipes/regression_tests/phase2/round_robin_double_team.xml new file mode 100644 index 0000000..fe6bdfe --- /dev/null +++ b/recipes/regression_tests/phase2/round_robin_double_team.xml @@ -0,0 +1,58 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "10:22:33:44:55:66", + "runner" : {"name" : "roundrobin"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.1/24" /> + </addresses> + </team> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "roundrobin"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.2/24" /> + </addresses> + </team> + </interfaces> + </host> + </network> + + <task python="team_test.py" /> +</lnstrecipe> + + diff --git a/recipes/regression_tests/phase2/round_robin_team.xml b/recipes/regression_tests/phase2/round_robin_team.xml new file mode 100644 index 0000000..4a69db9 --- /dev/null +++ b/recipes/regression_tests/phase2/round_robin_team.xml @@ -0,0 +1,40 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "roundrobin"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.1/24" /> + </addresses> + </team> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="test_if" label="tnet"> + <addresses> + <address value="192.168.0.2/24" /> + </addresses> + </eth> + </interfaces> + </host> + </network> + + <task python="team_test.py" /> +</lnstrecipe> diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml new file mode 100644 index 0000000..d645f1f --- /dev/null +++ b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml @@ -0,0 +1,54 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "roundrobin"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.1/24" /> + </addresses> + </team> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <bond id="test_if"> + <options> + <option name="mode" value="active-backup" /> + <option name="miimon" value="100" /> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.2/24" /> + </addresses> + </bond> + </interfaces> + </host> + </network> + + <task python="team_test.py" /> +</lnstrecipe> + + diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml new file mode 100644 index 0000000..d134119 --- /dev/null +++ b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml @@ -0,0 +1,54 @@ +<lnstrecipe> + <network> + <host id="testmachine1"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <team id="test_if"> + <options> + <option name="teamd_config"> + { + "hwaddr" : "00:11:22:33:44:55", + "runner" : {"name" : "roundrobin"} + } + </option> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.1/24" /> + </addresses> + </team> + </interfaces> + </host> + <host id="testmachine2"> + <interfaces> + <eth id="eth1" label="tnet" /> + <eth id="eth2" label="tnet" /> + <eth id="eth3" label="tnet" /> + <bond id="test_if"> + <options> + <option name="mode" value="balance-rr" /> + <option name="miimon" value="100" /> + </options> + <slaves> + <slave id="eth1" /> + <slave id="eth2" /> + <slave id="eth3" /> + </slaves> + <addresses> + <address value="192.168.0.2/24" /> + </addresses> + </bond> + </interfaces> + </host> + </network> + + <task python="team_test.py" /> +</lnstrecipe> + + diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py new file mode 100644 index 0000000..38e058b --- /dev/null +++ b/recipes/regression_tests/phase2/team_test.py @@ -0,0 +1,110 @@ +from lnst.Controller.Task import ctl + +# ------ +# SETUP +# ------ + +m1 = ctl.get_host("testmachine1") +m2 = ctl.get_host("testmachine2") + +m1.sync_resources(modules=["IcmpPing", "Netperf"]) +m2.sync_resources(modules=["IcmpPing", "Netperf"]) + +m1_ip = m1.get_ip("test_if") +m2_ip = m2.get_ip("test_if") + +# ------ +# TESTS +# ------ + +offloads = ["tso", "gro", "gso"] + +ping_mod = ctl.get_module("IcmpPing", + options={ + "addr" : m2_ip, + "count" : 100, + "iface" : m1.get_devname("test_if"), + "interval" : 0.1 + }) + +netperf_srv = ctl.get_module("Netperf", + options = { + "role" : "server", + "bind" : m1_ip + }) + +netperf_cli_tcp = ctl.get_module("Netperf", + options = { + "role" : "client", + "netperf_server" : m1_ip, + "duration" : 60, + "testname" : "TCP_STREAM", + "netperf_opts" : "-L %s" % m2_ip + }) + +netperf_cli_udp = ctl.get_module("Netperf", + options = { + "role" : "client", + "netperf_server" : m1_ip, + "duration" : 60, + "testname" : "UDP_STREAM", + "netperf_opts" : "-L %s" % m2_ip + }) +for offload in offloads: + for state in ["on", "off"]: + m1.run("ethtool -K %s %s %s" % (m1.get_devname("test_if"), offload, + state)) + m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload, + state)) + m1.run(ping_mod) + server_proc = m1.run(netperf_srv, bg=True) + ctl.wait(2) + m2.run(netperf_cli_tcp, timeout=65) + m2.run(netperf_cli_udp, timeout=65) + server_proc.intr() + +ping_mod = ctl.get_module("IcmpPing", + options={ + "addr" : m1_ip, + "count" : 100, + "iface" : m2.get_devname("test_if"), + "interval" : 0.1 + }) + + +netperf_srv = ctl.get_module("Netperf", + options = { + "role" : "server", + "bind" : m2_ip + }) + +netperf_cli_tcp = ctl.get_module("Netperf", + options = { + "role" : "client", + "netperf_server" : m2_ip, + "duration" : 60, + "testname" : "TCP_STREAM", + "netperf_opts" : "-L %s" % m1_ip + }) + +netperf_cli_udp = ctl.get_module("Netperf", + options = { + "role" : "client", + "netperf_server" : m2_ip, + "duration" : 60, + "testname" : "UDP_STREAM", + "netperf_opts" : "-L %s" % m1_ip + }) + +for offload in offloads: + for state in ["on", "off"]: + m1.run("ethtool -K %s %s %s" % (m1.get_devname("test_if"), offload, + state)) + m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload, + state)) + m2.run(ping_mod) + server_proc = m2.run(netperf_srv, bg=True) + ctl.wait(2) + m1.run(netperf_cli_tcp, timeout=65) + m1.run(netperf_cli_udp, timeout=65) + server_proc.intr()
Applying: Phase 2 team tests added /home/jirka/work/lnst/.git/rebase-apply/patch:378: new blank line at EOF. + /home/jirka/work/lnst/.git/rebase-apply/patch:484: new blank line at EOF. + /home/jirka/work/lnst/.git/rebase-apply/patch:544: new blank line at EOF. + /home/jirka/work/lnst/.git/rebase-apply/patch:608: new blank line at EOF. + /home/jirka/work/lnst/.git/rebase-apply/patch:714: new blank line at EOF. + warning: squelched 1 whitespace error warning: 6 lines add whitespace errors.
Please send a patch to fix that if it is possible. I applied this in the meantime.
Thanks.
Jiri
Tue, Nov 25, 2014 at 04:31:10PM CET, jprochaz@redhat.com wrote:
First version of phase 2 tests added.
- Tests included:
- team vs team
- team vs bond
- team vs eth
- 3 VLANs over team
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
diff --git a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml new file mode 100644 index 0000000..59ff534 --- /dev/null +++ b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml @@ -0,0 +1,102 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "activebackup"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="1.2.3.4/24" />
</addresses>
</team>
<vlan id="vlan10">
<options>
<option name="vlan_tci" value="10" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
<address value="192.168.10.1/24" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
<option name="vlan_tci" value="20" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
<address value="192.168.20.1/24" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
<option name="vlan_tci" value="30" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
<address value="192.168.30.1/24" />
</addresses>
</vlan>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
<vlan id="vlan10">
<options>
<option name="vlan_tci" value="10" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
<address value="192.168.10.2/24" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
<option name="vlan_tci" value="20" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
<address value="192.168.20.2/24" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
<option name="vlan_tci" value="30" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
<address value="192.168.30.2/24" />
</addresses>
</vlan>
</interfaces>
</host>
</network>
<task python="3_vlans_over_team.py" />
+</lnstrecipe> diff --git a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml new file mode 100644 index 0000000..0e9f009 --- /dev/null +++ b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml @@ -0,0 +1,102 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "roundrobin"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="1.2.3.4/24" />
</addresses>
</team>
<vlan id="vlan10">
<options>
<option name="vlan_tci" value="10" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
<address value="192.168.10.1/24" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
<option name="vlan_tci" value="20" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
<address value="192.168.20.1/24" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
<option name="vlan_tci" value="30" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
<address value="192.168.30.1/24" />
</addresses>
</vlan>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
<vlan id="vlan10">
<options>
<option name="vlan_tci" value="10" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
<address value="192.168.10.2/24" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
<option name="vlan_tci" value="20" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
<address value="192.168.20.2/24" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
<option name="vlan_tci" value="30" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
<address value="192.168.30.2/24" />
</addresses>
</vlan>
</interfaces>
</host>
</network>
<task python="3_vlans_over_team.py" />
+</lnstrecipe> diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py new file mode 100644 index 0000000..645e2cf --- /dev/null +++ b/recipes/regression_tests/phase2/3_vlans_over_team.py @@ -0,0 +1,93 @@ +from lnst.Controller.Task import ctl
+# ------ +# SETUP +# ------
+m1 = ctl.get_host("testmachine1") +m2 = ctl.get_host("testmachine2")
+m1.sync_resources(modules=["IcmpPing", "Netperf"]) +m2.sync_resources(modules=["IcmpPing", "Netperf"])
+# ------ +# TESTS +# ------
+vlans = ["vlan10", "vlan20", "vlan30"] +offloads = ["gso", "gro", "tso"]
+for vlan1 in vlans:
- for vlan2 in vlans:
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : m2.get_ip(vlan2),
"count" : 100,
"iface" : m1.get_devname(vlan1),
"interval" : 0.1
})
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : m1.get_ip(vlan1),
})
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1),
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1)
})
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1),
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1)
})
for offload in offloads:
# These tests should pass
# Ping between same VLANs
if vlan1 == vlan2:
for state in ["on", "off"]:
# Offload setup
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"),
offload, state))
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth2"),
offload, state))
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth3"),
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
# Ping test
m1.run(ping_mod)
# Netperf test (both TCP and UDP)
srv_proc = m1.run(netperf_srv, bg=True)
ctl.wait(2)
m2.run(netperf_cli_tcp, timeout=65)
m2.run(netperf_cli_udp, timeout=65)
srv_proc.intr()
# These tests should fail
# Ping across different VLAN
elif vlan1 != vlan2:
for state in ["on", "off"]:
# Offload setup
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"),
offload, state))
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth2"),
offload, state))
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth3"),
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
# Ping test
m1.run(ping_mod, expect="fail")
diff --git a/recipes/regression_tests/phase2/active_backup_double_team.xml b/recipes/regression_tests/phase2/active_backup_double_team.xml new file mode 100644 index 0000000..0f98b40 --- /dev/null +++ b/recipes/regression_tests/phase2/active_backup_double_team.xml @@ -0,0 +1,58 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "activebackup"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.1/24" />
</addresses>
</team>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "10:22:33:44:55:66",
"runner" : {"name" : "activebackup"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.2/24" />
</addresses>
</team>
</interfaces>
</host>
</network>
<task python="team_test.py" />
+</lnstrecipe>
diff --git a/recipes/regression_tests/phase2/active_backup_team.xml b/recipes/regression_tests/phase2/active_backup_team.xml new file mode 100644 index 0000000..44a6430 --- /dev/null +++ b/recipes/regression_tests/phase2/active_backup_team.xml @@ -0,0 +1,40 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "activebackup"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.1/24" />
</addresses>
</team>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
</addresses>
</eth>
</interfaces>
</host>
</network>
<task python="team_test.py" />
+</lnstrecipe> diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml new file mode 100644 index 0000000..621a4e8 --- /dev/null +++ b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml @@ -0,0 +1,54 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "activebackup"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.1/24" />
</addresses>
</team>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<bond id="test_if">
<options>
<option name="mode" value="active-backup" />
<option name="miimon" value="100" />
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.2/24" />
</addresses>
</bond>
</interfaces>
</host>
</network>
<task python="team_test.py" />
+</lnstrecipe>
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml new file mode 100644 index 0000000..e7119a7 --- /dev/null +++ b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml @@ -0,0 +1,54 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "activebackup"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.1/24" />
</addresses>
</team>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<bond id="test_if">
<options>
<option name="mode" value="balance-rr" />
<option name="miimon" value="100" />
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.2/24" />
</addresses>
</bond>
</interfaces>
</host>
</network>
<task python="team_test.py" />
+</lnstrecipe>
diff --git a/recipes/regression_tests/phase2/round_robin_double_team.xml b/recipes/regression_tests/phase2/round_robin_double_team.xml new file mode 100644 index 0000000..fe6bdfe --- /dev/null +++ b/recipes/regression_tests/phase2/round_robin_double_team.xml @@ -0,0 +1,58 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "10:22:33:44:55:66",
"runner" : {"name" : "roundrobin"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.1/24" />
</addresses>
</team>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "roundrobin"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.2/24" />
</addresses>
</team>
</interfaces>
</host>
</network>
<task python="team_test.py" />
+</lnstrecipe>
diff --git a/recipes/regression_tests/phase2/round_robin_team.xml b/recipes/regression_tests/phase2/round_robin_team.xml new file mode 100644 index 0000000..4a69db9 --- /dev/null +++ b/recipes/regression_tests/phase2/round_robin_team.xml @@ -0,0 +1,40 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "roundrobin"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.1/24" />
</addresses>
</team>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
</addresses>
</eth>
</interfaces>
</host>
</network>
<task python="team_test.py" />
+</lnstrecipe> diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml new file mode 100644 index 0000000..d645f1f --- /dev/null +++ b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml @@ -0,0 +1,54 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "roundrobin"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.1/24" />
</addresses>
</team>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<bond id="test_if">
<options>
<option name="mode" value="active-backup" />
<option name="miimon" value="100" />
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.2/24" />
</addresses>
</bond>
</interfaces>
</host>
</network>
<task python="team_test.py" />
+</lnstrecipe>
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml new file mode 100644 index 0000000..d134119 --- /dev/null +++ b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml @@ -0,0 +1,54 @@ +<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<team id="test_if">
<options>
<option name="teamd_config">
{
"hwaddr" : "00:11:22:33:44:55",
"runner" : {"name" : "roundrobin"}
}
</option>
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.1/24" />
</addresses>
</team>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
<eth id="eth2" label="tnet" />
<eth id="eth3" label="tnet" />
<bond id="test_if">
<options>
<option name="mode" value="balance-rr" />
<option name="miimon" value="100" />
</options>
<slaves>
<slave id="eth1" />
<slave id="eth2" />
<slave id="eth3" />
</slaves>
<addresses>
<address value="192.168.0.2/24" />
</addresses>
</bond>
</interfaces>
</host>
</network>
<task python="team_test.py" />
+</lnstrecipe>
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py new file mode 100644 index 0000000..38e058b --- /dev/null +++ b/recipes/regression_tests/phase2/team_test.py @@ -0,0 +1,110 @@ +from lnst.Controller.Task import ctl
+# ------ +# SETUP +# ------
+m1 = ctl.get_host("testmachine1") +m2 = ctl.get_host("testmachine2")
+m1.sync_resources(modules=["IcmpPing", "Netperf"]) +m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1_ip = m1.get_ip("test_if") +m2_ip = m2.get_ip("test_if")
+# ------ +# TESTS +# ------
+offloads = ["tso", "gro", "gso"]
+ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : m2_ip,
"count" : 100,
"iface" : m1.get_devname("test_if"),
"interval" : 0.1
})
+netperf_srv = ctl.get_module("Netperf",
options = {
"role" : "server",
"bind" : m1_ip
})
+netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m1_ip,
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" % m2_ip
})
+netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m1_ip,
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" % m2_ip
})
+for offload in offloads:
- for state in ["on", "off"]:
m1.run("ethtool -K %s %s %s" % (m1.get_devname("test_if"), offload,
state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
state))
m1.run(ping_mod)
server_proc = m1.run(netperf_srv, bg=True)
ctl.wait(2)
m2.run(netperf_cli_tcp, timeout=65)
m2.run(netperf_cli_udp, timeout=65)
server_proc.intr()
+ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : m1_ip,
"count" : 100,
"iface" : m2.get_devname("test_if"),
"interval" : 0.1
})
+netperf_srv = ctl.get_module("Netperf",
options = {
"role" : "server",
"bind" : m2_ip
})
+netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m2_ip,
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" % m1_ip
})
+netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m2_ip,
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" % m1_ip
})
+for offload in offloads:
- for state in ["on", "off"]:
m1.run("ethtool -K %s %s %s" % (m1.get_devname("test_if"), offload,
state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
state))
m2.run(ping_mod)
server_proc = m2.run(netperf_srv, bg=True)
ctl.wait(2)
m1.run(netperf_cli_tcp, timeout=65)
m1.run(netperf_cli_udp, timeout=65)
server_proc.intr()
-- 1.9.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
lnst-developers@lists.fedorahosted.org