[PATCH lnst] recipes: switchdev: Increase sleep time
by Yotam Gigi
Increase the sleep time needed for ports to become active to 30 seconds, as
15 seconds are not always enough.
Signed-off-by: Yotam Gigi <yotamg(a)mellanox.com>
---
recipes/switchdev/l2-000-minimal.py | 2 +-
recipes/switchdev/l2-001-bridge.py | 2 +-
recipes/switchdev/l2-002-bridge_fdb.py | 4 ++--
recipes/switchdev/l2-003-bridge_stp.py | 4 ++--
recipes/switchdev/l2-004-bridge_bond.py | 2 +-
recipes/switchdev/l2-005-bridge_bond_failover.py | 2 +-
recipes/switchdev/l2-006-bridge_team.py | 6 +++---
recipes/switchdev/l2-007-bridge_team_failover.py | 2 +-
recipes/switchdev/l2-008-bridge_vlan1q_sanity.py | 4 ++--
recipes/switchdev/l2-009-bridge_vlan1q.py | 2 +-
recipes/switchdev/l2-010-bridge_vlan1d_sanity.py | 4 ++--
recipes/switchdev/l2-011-bridge_vlan1d.py | 2 +-
recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py | 2 +-
recipes/switchdev/l2-013-bridge_bond_vlan1d.py | 2 +-
recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py | 2 +-
recipes/switchdev/l2-015-bridge_team_vlan1d.py | 6 +++---
recipes/switchdev/l2-017-bridge_fdb_vlan1d.py | 4 ++--
recipes/switchdev/l2-018-bridge_fdb_team.py | 10 +++++-----
recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py | 10 +++++-----
recipes/switchdev/l2-020-bridge_mdb.py | 2 +-
recipes/switchdev/l2-021-span.py | 2 +-
21 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/recipes/switchdev/l2-000-minimal.py b/recipes/switchdev/l2-000-minimal.py
index dcc9532..2b4dda7 100644
--- a/recipes/switchdev/l2-000-minimal.py
+++ b/recipes/switchdev/l2-000-minimal.py
@@ -21,7 +21,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
diff --git a/recipes/switchdev/l2-001-bridge.py b/recipes/switchdev/l2-001-bridge.py
index f92dae9..0b530b1 100644
--- a/recipes/switchdev/l2-001-bridge.py
+++ b/recipes/switchdev/l2-001-bridge.py
@@ -21,7 +21,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
diff --git a/recipes/switchdev/l2-002-bridge_fdb.py b/recipes/switchdev/l2-002-bridge_fdb.py
index 0dfb11b..f28997a 100644
--- a/recipes/switchdev/l2-002-bridge_fdb.py
+++ b/recipes/switchdev/l2-002-bridge_fdb.py
@@ -28,14 +28,14 @@ def do_task(ctl, hosts, ifaces, aliases):
br_options = {"vlan_filtering": 1, "ageing_time": 1000}
sw_br = sw.create_bridge(slaves = [sw_if1, sw_if2], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software")
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)
diff --git a/recipes/switchdev/l2-003-bridge_stp.py b/recipes/switchdev/l2-003-bridge_stp.py
index 94bd6be..44e87e7 100644
--- a/recipes/switchdev/l2-003-bridge_stp.py
+++ b/recipes/switchdev/l2-003-bridge_stp.py
@@ -53,7 +53,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software")
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)
@@ -65,7 +65,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software")
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)
diff --git a/recipes/switchdev/l2-004-bridge_bond.py b/recipes/switchdev/l2-004-bridge_bond.py
index 8378bbd..9599760 100644
--- a/recipes/switchdev/l2-004-bridge_bond.py
+++ b/recipes/switchdev/l2-004-bridge_bond.py
@@ -27,7 +27,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-005-bridge_bond_failover.py b/recipes/switchdev/l2-005-bridge_bond_failover.py
index f5c7c63..f3e0b76 100644
--- a/recipes/switchdev/l2-005-bridge_bond_failover.py
+++ b/recipes/switchdev/l2-005-bridge_bond_failover.py
@@ -27,7 +27,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-006-bridge_team.py b/recipes/switchdev/l2-006-bridge_team.py
index 5366b39..a649e6f 100644
--- a/recipes/switchdev/l2-006-bridge_team.py
+++ b/recipes/switchdev/l2-006-bridge_team.py
@@ -34,7 +34,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br = sw.create_bridge(slaves=[sw_lag1, sw_lag2],
options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
@@ -50,7 +50,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if1.reset(ip=["192.168.102.10/24", "2003::1/64"])
m1_if1.reset(ip=["192.168.102.11/24", "2003::2/64"])
- sleep(15)
+ sleep(30)
tl.ping_simple(sw_if1, m1_if1)
@@ -61,7 +61,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br.slave_add(sw_lag3.get_id())
m1_lag1.slave_add(m1_if1.get_id())
- sleep(15)
+ sleep(30)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-007-bridge_team_failover.py b/recipes/switchdev/l2-007-bridge_team_failover.py
index d3a8ee5..c89db02 100644
--- a/recipes/switchdev/l2-007-bridge_team_failover.py
+++ b/recipes/switchdev/l2-007-bridge_team_failover.py
@@ -33,7 +33,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py b/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py
index d415caf..0133df4 100644
--- a/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py
+++ b/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py
@@ -52,7 +52,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if1.add_br_vlan(20)
sw_if2.add_br_vlan(20)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
@@ -95,7 +95,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br.slave_del(sw_if1.get_id())
sw_if1.reset(ip=test_ip(1, 3))
- sleep(15)
+ sleep(30)
tl.ping_simple(sw_if1, m1_if1)
diff --git a/recipes/switchdev/l2-009-bridge_vlan1q.py b/recipes/switchdev/l2-009-bridge_vlan1q.py
index 7a982cd..5b8dea6 100644
--- a/recipes/switchdev/l2-009-bridge_vlan1q.py
+++ b/recipes/switchdev/l2-009-bridge_vlan1q.py
@@ -37,7 +37,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if1.add_br_vlan(20)
sw_if2.add_br_vlan(20)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
diff --git a/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py b/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py
index fc43ab3..6df2b2d 100644
--- a/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py
+++ b/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py
@@ -42,7 +42,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if2_21 = sw.create_vlan(sw_if2, 21)
sw.create_bridge(slaves=[sw_if1_20, sw_if2_21], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
@@ -53,7 +53,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br.slave_del(sw_if1_10.get_id())
sw_if1_10.reset(ip=test_ip(2, 3))
- sleep(15)
+ sleep(30)
tl.ping_simple(sw_if1_10, m1_if1_10)
diff --git a/recipes/switchdev/l2-011-bridge_vlan1d.py b/recipes/switchdev/l2-011-bridge_vlan1d.py
index ccacf79..0885720 100644
--- a/recipes/switchdev/l2-011-bridge_vlan1d.py
+++ b/recipes/switchdev/l2-011-bridge_vlan1d.py
@@ -40,7 +40,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if2_21 = sw.create_vlan(sw_if2, 21)
sw.create_bridge(slaves=[sw_if1_20, sw_if2_21], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
diff --git a/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py b/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py
index 66c3eff..4c408e9 100644
--- a/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py
+++ b/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py
@@ -46,7 +46,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-013-bridge_bond_vlan1d.py b/recipes/switchdev/l2-013-bridge_bond_vlan1d.py
index f2f68d2..e0d3160 100644
--- a/recipes/switchdev/l2-013-bridge_bond_vlan1d.py
+++ b/recipes/switchdev/l2-013-bridge_bond_vlan1d.py
@@ -44,7 +44,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
diff --git a/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py b/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py
index 58753ca..5924eaf 100644
--- a/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py
+++ b/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py
@@ -46,7 +46,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-015-bridge_team_vlan1d.py b/recipes/switchdev/l2-015-bridge_team_vlan1d.py
index 4078b94..64c4156 100644
--- a/recipes/switchdev/l2-015-bridge_team_vlan1d.py
+++ b/recipes/switchdev/l2-015-bridge_team_vlan1d.py
@@ -46,7 +46,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br3 = sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21],
options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
@@ -71,7 +71,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if1.reset(ip=test_ip(4, 1))
m1_if1.reset(ip=test_ip(4, 2))
- sleep(15)
+ sleep(30)
tl.ping_simple(sw_if1, m1_if1)
@@ -89,7 +89,7 @@ def do_task(ctl, hosts, ifaces, aliases):
m1_lag1.slave_add(m1_if1.get_id())
- sleep(15)
+ sleep(30)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py b/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py
index 26a0020..eb3fc60 100644
--- a/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py
+++ b/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py
@@ -30,14 +30,14 @@ def do_task(ctl, hosts, ifaces, aliases):
br_options = {"vlan_filtering": 0, "ageing_time": 1000}
sw_br = sw.create_bridge(slaves = [sw_if1_10, sw_if2_20], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1_10, m2_if1_20)
tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software")
tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False)
diff --git a/recipes/switchdev/l2-018-bridge_fdb_team.py b/recipes/switchdev/l2-018-bridge_fdb_team.py
index 0cf75e8..f7b70a4 100644
--- a/recipes/switchdev/l2-018-bridge_fdb_team.py
+++ b/recipes/switchdev/l2-018-bridge_fdb_team.py
@@ -32,14 +32,14 @@ def do_task(ctl, hosts, ifaces, aliases):
br_options = {"vlan_filtering": 1, "ageing_time": 1000}
sw_br = sw.create_bridge(slaves = [sw_lag1, sw_lag2], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software")
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)
@@ -74,7 +74,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software")
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)
@@ -101,7 +101,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software")
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)
@@ -113,7 +113,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
# Make sure static entry is not aged out.
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
diff --git a/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py b/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py
index 7784997..b3a20d5 100644
--- a/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py
+++ b/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py
@@ -39,14 +39,14 @@ def do_task(ctl, hosts, ifaces, aliases):
br_options = {"vlan_filtering": 0, "ageing_time": 1000}
sw_br = sw.create_bridge(slaves = [sw_lag1_10, sw_lag2_20], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1_10, m2_lag1_20)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software")
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False)
@@ -81,7 +81,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software")
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False)
@@ -108,7 +108,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software")
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False)
@@ -120,7 +120,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware")
- sleep(20)
+ sleep(30)
# Make sure static entry is not aged out.
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
diff --git a/recipes/switchdev/l2-020-bridge_mdb.py b/recipes/switchdev/l2-020-bridge_mdb.py
index fdd85e8..04bcae9 100644
--- a/recipes/switchdev/l2-020-bridge_mdb.py
+++ b/recipes/switchdev/l2-020-bridge_mdb.py
@@ -29,7 +29,7 @@ def do_task(ctl, hosts, ifaces, aliases):
m2_if.set_addresses(["192.168.101.11/24", "2002::2/64"])
m3_if.set_addresses(["192.168.101.13/24", "2002::3/64"])
m4_if.set_addresses(["192.168.101.14/24", "2002::4/64"])
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.iperf_mc(m1_if, [m2_if, m4_if], [m3_if], "239.255.1.3")
diff --git a/recipes/switchdev/l2-021-span.py b/recipes/switchdev/l2-021-span.py
index dfa0e99..92dea37 100644
--- a/recipes/switchdev/l2-021-span.py
+++ b/recipes/switchdev/l2-021-span.py
@@ -100,7 +100,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
mirred_port = MirredPort(sw_if2)
- sleep(15)
+ sleep(30)
mirror_status = {"ingress": False, "egress": False }
for i in range(10):
--
2.8.4
6 years, 10 months
[PATCH 0/2] recipes: switchdev: Two small adjustments
by Ido Schimmel
Two small adjustments I found necessary following refactoring of the
mlxsw driver.
Ido Schimmel (2):
recipes: switchdev: Don't unnecessarily configure VLAN-aware bridges
recipes: switchdev: Disable learning to ensure FDB isn't populated
recipes/switchdev/l2-002-bridge_fdb.py | 6 +++++-
recipes/switchdev/l2-010-bridge_vlan1d_sanity.py | 4 ++--
recipes/switchdev/l2-011-bridge_vlan1d.py | 4 ++--
recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py | 4 ++--
recipes/switchdev/l2-013-bridge_bond_vlan1d.py | 4 ++--
recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py | 4 ++--
recipes/switchdev/l2-015-bridge_team_vlan1d.py | 6 ++----
recipes/switchdev/l2-017-bridge_fdb_vlan1d.py | 6 +++++-
recipes/switchdev/l2-018-bridge_fdb_team.py | 6 +++++-
recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py | 6 +++++-
10 files changed, 32 insertions(+), 18 deletions(-)
--
2.9.3
6 years, 10 months
[RFC 00/42] Python Recipes
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
Hi all,
the long avaited patchset for Python Recipes is here.
At this point there's still quite a lot of work left, but since the current
state is functional and the tester facing API should be mostly stable I think
it's a good time to get this merged into upstream so that more people can get
involved with filling in the missing pieces and can slowly start experimenting
and porting their XML recipes.
This I know are missing:
* Recipe run summary - how the Summary should look like was described in the
running proposal document, but I didn't manage to start with the
implementation yet...
* Porting of all the old test_modules into the lnst.Tests package, so far we
only have the IcmpPing module that should still be reworked to be more
universal (ip4 and ip6 in one class). Porting test_modules should be fairly
easy, but at this point there's no guide how to do it so if you're having
trouble feel free to contact me either on irc or email.
* test_tools - we haven't even thought of these yet
* network namespaces - also didn't think about them yet, though I'm hoping this
will be simple
* Ip address and network generators as we've discussed them on the upstream
meeting
Please review and provide any comments or features I forgot that should be
added to the above list.
Regards,
Ondrej
Ondrej Lichtner (42):
add lnst.Common.LnstError
add lnst.Common.DeviceError
add lnst.Common.DeviceRef
add lnst.Common.IpAddress
add lnst.Common.Parameters
add lnst.Common.TestModule
add lnst.Common.JobError
add lnst.Controller.Common
add lnst.Devices
add lnst.Controller.Requirements
add lnst.Controller.Job
add lnst.Controller.Host
add lnst.Controller.Config
add lnst.Slave.Config
add lnst.Controller.MachineMapper
lnst.Controller.Machine: change object initialization
add lnst.Controller.MessageDispatcher
add lnst.Controller.SlavePoolManager
add lnst.Controller.Recipe
add lnst.Controller.Controller
various files: retype exceptions
add lnst.Tests package
lnst.Common.Config: remove {controller, slave}_init
lnst.Common.Config: remove global lnst_config
Slave: use a local config object instead of a global one
lnst.Common.Utils: add sha256sum function
lnst.Common.ResourceCache: simplification
lnst.Controller.CtlSecSocket: remove lnst_config import
lnst.Controller.SlaveMachineParser: make standalone
add lnst.Common.InterfaceManagerError
add lnst.Slave.Job
lnst.Slave.InterfaceManager: heavy reimplementation
Machine, NetTestSlave: heavy reimplementation
lnst.Slave.InterfaceManager: remove Device class implementation
add lnst.Controller package imports
lnst/__init__.py remove imports
lnst.Controller: remove old modules
setup.py: add new packages
add lnst.Devices.VirtNetCtl
lnst.Controller: move VirtUtils to VirtDomainCtl, remove VirtNetCtl
class
lnst.Common.Parameters: IpParam accepts RemoteDevice objects
add example python_recipe.py script
lnst-slave | 20 +-
lnst/Common/Config.py | 152 +---
lnst/Common/DeviceError.py | 22 +
lnst/Common/DeviceRef.py | 19 +
lnst/Common/ExecCmd.py | 3 +-
lnst/Common/InterfaceManagerError.py | 16 +
lnst/Common/IpAddress.py | 98 +++
lnst/Common/JobError.py | 22 +
lnst/Common/LnstError.py | 18 +
lnst/Common/NetTestCommand.py | 5 +-
lnst/Common/Parameters.py | 120 +++
lnst/Common/ResourceCache.py | 128 ++--
lnst/Common/SecureSocket.py | 3 +-
lnst/Common/ShellProcess.py | 3 +-
lnst/Common/TestModule.py | 67 ++
lnst/Common/TestsCommon.py | 3 +-
lnst/Common/Utils.py | 11 +
lnst/Controller/Common.py | 19 +
lnst/Controller/Config.py | 99 +++
lnst/Controller/Controller.py | 220 ++++++
lnst/Controller/CtlSecSocket.py | 1 -
lnst/Controller/Host.py | 143 ++++
lnst/Controller/Job.py | 197 +++++
lnst/Controller/Machine.py | 1348 +++++++--------------------------
lnst/Controller/MachineMapper.py | 323 ++++++++
lnst/Controller/MessageDispatcher.py | 188 +++++
lnst/Controller/NetTestController.py | 620 ---------------
lnst/Controller/Recipe.py | 98 +++
lnst/Controller/RecipeParser.py | 572 --------------
lnst/Controller/Requirements.py | 113 +++
lnst/Controller/SlaveMachineParser.py | 144 +++-
lnst/Controller/SlavePool.py | 648 ----------------
lnst/Controller/SlavePoolManager.py | 273 +++++++
lnst/Controller/Task.py | 4 +-
lnst/Controller/VirtDomainCtl.py | 98 +++
lnst/Controller/VirtUtils.py | 268 -------
lnst/Controller/XmlParser.py | 188 -----
lnst/Controller/XmlProcessing.py | 235 ------
lnst/Controller/XmlTemplates.py | 438 -----------
lnst/Controller/__init__.py | 3 +
lnst/Devices/BondDevice.py | 48 ++
lnst/Devices/BridgeDevice.py | 49 ++
lnst/Devices/Device.py | 368 +++++++++
lnst/Devices/MacvlanDevice.py | 41 +
lnst/Devices/OvsBridgeDevice.py | 116 +++
lnst/Devices/RemoteDevice.py | 90 +++
lnst/Devices/SoftDevice.py | 51 ++
lnst/Devices/TeamDevice.py | 64 ++
lnst/Devices/VethDevice.py | 59 ++
lnst/Devices/VethPair.py | 24 +
lnst/Devices/VirtNetCtl.py | 85 +++
lnst/Devices/VirtualDevice.py | 99 +++
lnst/Devices/VlanDevice.py | 38 +
lnst/Devices/VtiDevice.py | 71 ++
lnst/Devices/VxlanDevice.py | 66 ++
lnst/Devices/__init__.py | 45 ++
lnst/RecipeCommon/ModuleWrap.py | 33 +-
lnst/Slave/Config.py | 73 ++
lnst/Slave/InterfaceManager.py | 648 ++--------------
lnst/Slave/Job.py | 251 ++++++
lnst/Slave/NetTestSlave.py | 832 ++++++++++----------
lnst/Tests/IcmpPing.py | 76 ++
lnst/Tests/__init__.py | 1 +
lnst/__init__.py | 1 -
recipes/examples/python_recipe.py | 31 +
setup.py | 2 +-
66 files changed, 4919 insertions(+), 5293 deletions(-)
create mode 100644 lnst/Common/DeviceError.py
create mode 100644 lnst/Common/DeviceRef.py
create mode 100644 lnst/Common/InterfaceManagerError.py
create mode 100644 lnst/Common/IpAddress.py
create mode 100644 lnst/Common/JobError.py
create mode 100644 lnst/Common/LnstError.py
create mode 100644 lnst/Common/Parameters.py
create mode 100644 lnst/Common/TestModule.py
create mode 100644 lnst/Controller/Common.py
create mode 100644 lnst/Controller/Config.py
create mode 100644 lnst/Controller/Controller.py
create mode 100644 lnst/Controller/Host.py
create mode 100644 lnst/Controller/Job.py
create mode 100644 lnst/Controller/MachineMapper.py
create mode 100644 lnst/Controller/MessageDispatcher.py
delete mode 100644 lnst/Controller/NetTestController.py
create mode 100644 lnst/Controller/Recipe.py
delete mode 100644 lnst/Controller/RecipeParser.py
create mode 100644 lnst/Controller/Requirements.py
delete mode 100644 lnst/Controller/SlavePool.py
create mode 100644 lnst/Controller/SlavePoolManager.py
create mode 100644 lnst/Controller/VirtDomainCtl.py
delete mode 100644 lnst/Controller/VirtUtils.py
delete mode 100644 lnst/Controller/XmlParser.py
delete mode 100644 lnst/Controller/XmlProcessing.py
delete mode 100644 lnst/Controller/XmlTemplates.py
create mode 100644 lnst/Devices/BondDevice.py
create mode 100644 lnst/Devices/BridgeDevice.py
create mode 100644 lnst/Devices/Device.py
create mode 100644 lnst/Devices/MacvlanDevice.py
create mode 100644 lnst/Devices/OvsBridgeDevice.py
create mode 100644 lnst/Devices/RemoteDevice.py
create mode 100644 lnst/Devices/SoftDevice.py
create mode 100644 lnst/Devices/TeamDevice.py
create mode 100644 lnst/Devices/VethDevice.py
create mode 100644 lnst/Devices/VethPair.py
create mode 100644 lnst/Devices/VirtNetCtl.py
create mode 100644 lnst/Devices/VirtualDevice.py
create mode 100644 lnst/Devices/VlanDevice.py
create mode 100644 lnst/Devices/VtiDevice.py
create mode 100644 lnst/Devices/VxlanDevice.py
create mode 100644 lnst/Devices/__init__.py
create mode 100644 lnst/Slave/Config.py
create mode 100644 lnst/Slave/Job.py
create mode 100644 lnst/Tests/IcmpPing.py
create mode 100644 lnst/Tests/__init__.py
create mode 100755 recipes/examples/python_recipe.py
--
2.12.2
6 years, 10 months
[PATCH 0/2] recipes: switchdev: span: Some fixes
by Yotam Gigi
Fix some problems that arose in our nightly regression runs.
The first patch removes the tc command output parsing, as a recent change
in the command output format caused the test to fail. The second patch
adds ipv6 support to the test.
Yotam Gigi (2):
recipes: switchdev: span: Remove tc-matchall parsing
recipes: switchdev: span: Add ipv6 support
recipes/switchdev/l2-021-span.py | 61 ++++++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 24 deletions(-)
--
2.4.11
6 years, 10 months
[PATCH lnst 0/2] Support addresses on ovs bridge interface
by Roi Dayan
Hi,
The first patch is a fix to set device down when cleaning it instead of up.
The second patch is adding support to set addresses on the bridge interface.
Thanks,
Roi
Roi Dayan (2):
NetConfigDeviceOvsBridge: set interface down in address cleanup
NetConfigDeviceOvsBridge: support set addresses on the bridge
interface
lnst/Slave/NetConfigDevice.py | 4 +++-
schema-recipe.rng | 3 +++
2 files changed, 6 insertions(+), 1 deletions(-)
6 years, 10 months
[PATCH v2 0/4] Netperf minor refactorization and support for RR tests
by Jiri Prochazka
Changes in v2:
- discarded patch split _pretty_rate method in two and add support for RR tests
- added patch fix non omni output_parsing
- added patch print actual supported tests in warning message
Jiri Prochazka (4):
test_modules/netperf: use bit/s in STREAM tests and parse RR tests
test_modules/netperf: add TCP_CRR to supported and omni tests
test_modules/netperf: print actual supported tests in warning message
test_modules/netperf: fix non omni output parsing
test_modules/Netperf.py | 55 ++++++++++++++++++++++++++++++++++---------------
1 file changed, 38 insertions(+), 17 deletions(-)
--
2.9.3
6 years, 10 months
[PATCH lnst] Add basic OVS offload tests
by Roi Dayan
We currently only do minimal testing.
OVS offload is done by adding rules to TC which then offloaded to supported
hardware. so the tests start traffic and then look for matching TC rules.
Testing east-west traffic, north-source traffic, VLAN, VXLAN, VAXLN IPv6.
Signed-off-by: Roi Dayan <roid(a)mellanox.com>
---
Hi,
This commit is adding initial basic tests for OVS offload.
The series adding offloading support to OVS is still being discussed
on the ovs-dev mailing list.
The series is also available in github here:
https://github.com/roidayan/ovs/tree/hw-offload-fixes-for-v5
Thanks,
Roi
recipes/ovs_offload/01-basic.README | 21 ++++++
recipes/ovs_offload/01-basic.py | 84 +++++++++++++++++++++++
recipes/ovs_offload/01-basic.xml | 54 +++++++++++++++
recipes/ovs_offload/03-vlan_in_host.README | 33 +++++++++
recipes/ovs_offload/03-vlan_in_host.py | 72 ++++++++++++++++++++
recipes/ovs_offload/03-vlan_in_host.xml | 67 ++++++++++++++++++
recipes/ovs_offload/04-vlan_in_guest.README | 31 +++++++++
recipes/ovs_offload/04-vlan_in_guest.py | 48 +++++++++++++
recipes/ovs_offload/04-vlan_in_guest.xml | 67 ++++++++++++++++++
recipes/ovs_offload/1_virt_ovs_vxlan.README | 41 +++++++++++
recipes/ovs_offload/1_virt_ovs_vxlan.py | 71 +++++++++++++++++++
recipes/ovs_offload/1_virt_ovs_vxlan.xml | 88 ++++++++++++++++++++++++
recipes/ovs_offload/1_virt_ovs_vxlan_ipv6.xml | 89 ++++++++++++++++++++++++
recipes/ovs_offload/Testlib.py | 90 +++++++++++++++++++++++++
14 files changed, 856 insertions(+), 0 deletions(-)
create mode 100644 recipes/ovs_offload/01-basic.README
create mode 100644 recipes/ovs_offload/01-basic.py
create mode 100644 recipes/ovs_offload/01-basic.xml
create mode 100644 recipes/ovs_offload/03-vlan_in_host.README
create mode 100644 recipes/ovs_offload/03-vlan_in_host.py
create mode 100644 recipes/ovs_offload/03-vlan_in_host.xml
create mode 100644 recipes/ovs_offload/04-vlan_in_guest.README
create mode 100644 recipes/ovs_offload/04-vlan_in_guest.py
create mode 100644 recipes/ovs_offload/04-vlan_in_guest.xml
create mode 100644 recipes/ovs_offload/1_virt_ovs_vxlan.README
create mode 100644 recipes/ovs_offload/1_virt_ovs_vxlan.py
create mode 100644 recipes/ovs_offload/1_virt_ovs_vxlan.xml
create mode 100644 recipes/ovs_offload/1_virt_ovs_vxlan_ipv6.xml
create mode 100644 recipes/ovs_offload/Testlib.py
diff --git a/recipes/ovs_offload/01-basic.README b/recipes/ovs_offload/01-basic.README
new file mode 100644
index 0000000..e13c4fe
--- /dev/null
+++ b/recipes/ovs_offload/01-basic.README
@@ -0,0 +1,21 @@
+Topology:
+
++----------------------+
+| |
+| +-----------------+ |
+| | ovs_bridge | |
+| +-+-------------+-+ |
+| | | |
+| +-+-+ +-+-+ |
++-|tap|---------|tap|--+
+ +-+-+ +-+-+
+ | |
+ | |
+ | |
+ +-+-+ +-+-+
++-|nic|--+ +-|nic|--+
+| +---+ | | +---+ |
+| guest1 | | guest2 |
+| | | |
++--------+ +--------+
+
diff --git a/recipes/ovs_offload/01-basic.py b/recipes/ovs_offload/01-basic.py
new file mode 100644
index 0000000..1bbf5a0
--- /dev/null
+++ b/recipes/ovs_offload/01-basic.py
@@ -0,0 +1,84 @@
+from lnst.Controller.Task import ctl
+from Testlib import Testlib
+
+# ------
+# SETUP
+# ------
+
+tl = Testlib(ctl)
+
+h1 = ctl.get_host("host1")
+g1 = ctl.get_host("guest1")
+g2 = ctl.get_host("guest2")
+
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Iperf"])
+g2.sync_resources(modules=["Iperf"])
+
+# ------
+# TESTS
+# ------
+
+ipv = ctl.get_alias("ipv")
+do_iperf = ctl.get_alias("iperf")
+
+g1_guestnic = g1.get_interface("if1")
+g1_mac = g1_guestnic.get_hwaddr()
+g2_guestnic = g2.get_interface("if1")
+g2_mac = g2_guestnic.get_hwaddr()
+
+ping_count = 30
+ping_interval = 0.2
+ping_timeout = 10
+
+def ping(options={}):
+ options = dict(options)
+ options.update({
+ "addr": g2_guestnic.get_ip(0),
+ "count": ping_count,
+ "iface": g1_guestnic.get_devname(),
+ "interval": ping_interval
+ })
+ ping_mod = ctl.get_module("IcmpPing", options=options)
+ g1.run(ping_mod, timeout=ping_timeout)
+
+
+def ping6(options={}):
+ options = dict(options)
+ options.update({
+ "addr": g2_guestnic.get_ip(1),
+ "count": ping_count,
+ "iface": g1_guestnic.get_ip(1),
+ "interval": ping_interval
+ })
+ ping_mod6 = ctl.get_module("Icmp6Ping", options=options)
+ g1.run(ping_mod6, timeout=ping_timeout)
+
+
+def verify_tc_rules(proto):
+ m = tl.find_tc_rule(h1, 'tap1', g1_mac, g2_mac, proto, 'mirred')
+ if m:
+ tl.custom(h1, "TC rule %s vm1->vm2" % proto, opts=m)
+ else:
+ tl.custom(h1, "TC rule %s vm1->vm2" % proto, 'ERROR: cannot find tc rule')
+
+ m = tl.find_tc_rule(h1, 'tap2', g2_mac, g1_mac, proto, 'mirred')
+ if m:
+ tl.custom(h1, "TC rule %s vm2->vm1" % proto, opts=m)
+ else:
+ tl.custom(h1, "TC rule %s vm2->vm1" % proto, 'ERROR: cannot find tc rule')
+
+
+if ipv in ('ipv4', 'both'):
+ ping()
+ verify_tc_rules('ip')
+ for size in (200, 400, 1000):
+ ping({'size': size})
+
+if ipv in ('ipv6', 'both'):
+ ping6()
+ verify_tc_rules('ipv6')
+ for size in (200, 400, 1000):
+ ping6({'size': size})
+
+if do_iperf:
+ tl.iperf(g1_guestnic, g2_guestnic, 30, 'vm1->vm2')
diff --git a/recipes/ovs_offload/01-basic.xml b/recipes/ovs_offload/01-basic.xml
new file mode 100644
index 0000000..b020781
--- /dev/null
+++ b/recipes/ovs_offload/01-basic.xml
@@ -0,0 +1,54 @@
+<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ <alias name="iperf" value="yes" />
+ <alias name="net" value="1.1.1"/>
+ <alias name="net6" value="fc00:0:0:0"/>
+ </define>
+ <network>
+ <host id="guest1">
+ <params>
+ <param name="machine_type" value="guest"/>
+ </params>
+ <interfaces>
+ <eth id="if1" label="A">
+ <addresses>
+ <address>{$net}.10/24</address>
+ <address>{$net6}::10/64</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="guest2">
+ <params>
+ <param name="machine_type" value="guest"/>
+ </params>
+ <interfaces>
+ <eth id="if1" label="B">
+ <addresses>
+ <address>{$net}.11/24</address>
+ <address>{$net6}::11/64</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="host1">
+ <params>
+ <param name="ovs_support" value="true"/>
+ <param name="order" value="1"/>
+ </params>
+ <interfaces>
+ <eth id="tap1" label="A"/>
+ <eth id="tap2" label="B"/>
+ <ovs_bridge id="ovs1">
+ <slaves>
+ <slave id="tap1"/>
+ <slave id="tap2"/>
+ </slaves>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ </network>
+
+ <task python="01-basic.py" />
+</lnstrecipe>
diff --git a/recipes/ovs_offload/03-vlan_in_host.README b/recipes/ovs_offload/03-vlan_in_host.README
new file mode 100644
index 0000000..3b25b7d
--- /dev/null
+++ b/recipes/ovs_offload/03-vlan_in_host.README
@@ -0,0 +1,33 @@
+Topology:
+
+ +----------+
+ | | VLAN10
+ +-----------------+ switch +--------------------+
+ | | | |
+ | +----------+ |
+ | |
+ +-+-+ |
++------|nic|---------+ +-+-+
+| +-+-+ | +------|nic|------+
+| | | | +---+ |
+| | | | |
+| +------+-------+ | | |
+| | vlan10 | | | host2 |
+| | | | | |
+| | ovs_bridge | | | |
+| | | | | |
+| +-+------------+ | +-----------------+
+| | |
+| +-+-+ |
++-|tap|--------------+
+ +-+-+
+ |
+ |
+ |
+ +-+-+
++-|nic|--+
+| +---+ |
+| guest1 |
+| |
++--------+
+
diff --git a/recipes/ovs_offload/03-vlan_in_host.py b/recipes/ovs_offload/03-vlan_in_host.py
new file mode 100644
index 0000000..3a2c19e
--- /dev/null
+++ b/recipes/ovs_offload/03-vlan_in_host.py
@@ -0,0 +1,72 @@
+from lnst.Controller.Task import ctl
+from Testlib import Testlib
+
+# ------
+# SETUP
+# ------
+
+tl = Testlib(ctl)
+
+h1 = ctl.get_host("host1")
+g1 = ctl.get_host("guest1")
+h2 = ctl.get_host("host2")
+
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Iperf"])
+h2.sync_resources(modules=["Iperf"])
+
+# ------
+# TESTS
+# ------
+
+ipv = ctl.get_alias("ipv")
+do_iperf = ctl.get_alias("iperf")
+
+h2_vlan10 = h2.get_interface("vlan10")
+h2_mac = h2_vlan10.get_hwaddr()
+g1_guestnic = g1.get_interface("guestnic")
+g1_mac = g1_guestnic.get_hwaddr()
+
+ping_count = 100
+ping_interval = 0.2
+
+ping_mod = ctl.get_module("IcmpPing",
+ options={
+ "addr": h2_vlan10.get_ip(0),
+ "count": ping_count,
+ "iface": g1_guestnic.get_devname(),
+ "interval": ping_interval
+ })
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr": h2_vlan10.get_ip(1),
+ "count": ping_count,
+ "iface": g1_guestnic.get_ip(1),
+ "interval": ping_interval
+ })
+
+
+def verify_tc_rules(proto):
+ m = tl.find_tc_rule(h1, 'tap', g1_mac, h2_mac, proto, 'vlan push')
+ if m:
+ tl.custom(h1, "TC rule %s vlan push" % proto)
+ else:
+ tl.custom(h1, "TC rule %s vlan push" % proto, 'ERROR: cannot find tc rule')
+
+ m = tl.find_tc_rule(h1, 'nic', h2_mac, g1_mac, '802.1Q', 'vlan pop')
+ if m:
+ tl.custom(h1, "TC rule %s vlan pop" % proto)
+ else:
+ tl.custom(h1, "TC rule %s vlan pop" % proto, 'ERROR: cannot find tc rule')
+
+
+if ipv in ('ipv4', 'both'):
+ g1.run(ping_mod)
+ verify_tc_rules('ip')
+
+if ipv in ('ipv6', 'both'):
+ g1.run(ping_mod6)
+ verify_tc_rules('ipv6')
+
+if do_iperf:
+ tl.iperf(g1_guestnic, h2_vlan10, 100, 'vm1->h2')
diff --git a/recipes/ovs_offload/03-vlan_in_host.xml b/recipes/ovs_offload/03-vlan_in_host.xml
new file mode 100644
index 0000000..5f5c8c1
--- /dev/null
+++ b/recipes/ovs_offload/03-vlan_in_host.xml
@@ -0,0 +1,67 @@
+<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ <alias name="iperf" value="yes" />
+ <alias name="vlan10_net" value="1.1.1"/>
+ <alias name="vlan10_net6" value="fc00:0:0:0"/>
+ <alias name="vlan10_tag" value="10"/>
+ </define>
+ <network>
+ <host id="host1">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ <param name="order" value="1"/>
+ </params>
+ <interfaces>
+ <eth id="nic" label="to_switch"/>
+ <eth id="tap" label="to_guest"/>
+ <ovs_bridge id="ovs_br">
+ <slaves>
+ <slave id="tap" />
+ <slave id="nic" />
+ </slaves>
+ <vlan tag="{$vlan10_tag}">
+ <slaves>
+ <slave id="tap"/>
+ </slaves>
+ </vlan>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ <host id="guest1">
+ <params>
+ <param name="machine_type" value="guest"/>
+ </params>
+ <interfaces>
+ <eth id="guestnic" label="to_guest">
+ <addresses>
+ <address>{$vlan10_net}.10/24</address>
+ <address>{$vlan10_net6}::10/64</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="host2">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ </params>
+ <interfaces>
+ <eth id="nic" label="to_switch"/>
+ <vlan id="vlan10">
+ <options>
+ <option name="vlan_tci" value="{$vlan10_tag}" />
+ </options>
+ <slaves>
+ <slave id="nic" />
+ </slaves>
+ <addresses>
+ <address>{$vlan10_net}.11/24</address>
+ <address>{$vlan10_net6}::11/64</address>
+ </addresses>
+ </vlan>
+ </interfaces>
+ </host>
+ </network>
+
+ <task python="03-vlan_in_host.py" />
+</lnstrecipe>
diff --git a/recipes/ovs_offload/04-vlan_in_guest.README b/recipes/ovs_offload/04-vlan_in_guest.README
new file mode 100644
index 0000000..a4bf384
--- /dev/null
+++ b/recipes/ovs_offload/04-vlan_in_guest.README
@@ -0,0 +1,31 @@
+Topology:
+
+ +----------+
+ | | VLAN10
+ +-----------------+ switch +-----------------+
+ | | | |
+ | +----------+ |
+ | |
+ +-+-+ |
++------|nic|------+ +-+-+
+| +-+-+ | +------|nic|------+
+| | | | +---+ |
+| +----+ | | |
+| | | | |
+| +-+---------+ | | |
+| | ovs_bridge| | | host2 |
+| +-+---------+ | | |
+| | host1 | | |
+| +-+-+ | | |
++-|tap|-----------+ | |
+ +-+-+ +-----------------+
+ |
+ |VLAN10
+ |
+ +-+-+
++-|nic|--+
+| +---+ |
+| guest1 |
+| |
++--------+
+
diff --git a/recipes/ovs_offload/04-vlan_in_guest.py b/recipes/ovs_offload/04-vlan_in_guest.py
new file mode 100644
index 0000000..fe66b9a
--- /dev/null
+++ b/recipes/ovs_offload/04-vlan_in_guest.py
@@ -0,0 +1,48 @@
+from lnst.Controller.Task import ctl
+
+# ------
+# SETUP
+# ------
+
+h1 = ctl.get_host("host1")
+g1 = ctl.get_host("guest1")
+h2 = ctl.get_host("host2")
+
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping"])
+
+# ------
+# TESTS
+# ------
+
+ipv = ctl.get_alias("ipv")
+h2_vlan10 = h2.get_interface("vlan10")
+g1_vlan10 = g1.get_interface("vlan10")
+
+ping_count = 100
+ping_interval = 0.2
+
+ping_mod = ctl.get_module("IcmpPing",
+ options={
+ "addr": h2_vlan10.get_ip(0),
+ "count": ping_count,
+ "iface": g1_vlan10.get_devname(),
+ "interval": ping_interval
+ })
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr": h2_vlan10.get_ip(1),
+ "count": ping_count,
+ "iface": g1_vlan10.get_ip(1),
+ "interval": ping_interval
+ })
+
+p_opts = "-L %s" % (h2_vlan10.get_ip(0))
+p_opts6 = "-L %s -6" % (h2_vlan10.get_ip(1))
+
+if ipv in ('ipv4', 'both'):
+ g1.run(ping_mod)
+
+if ipv in ('ipv6', 'both'):
+ g1.run(ping_mod6)
diff --git a/recipes/ovs_offload/04-vlan_in_guest.xml b/recipes/ovs_offload/04-vlan_in_guest.xml
new file mode 100644
index 0000000..8b183ec
--- /dev/null
+++ b/recipes/ovs_offload/04-vlan_in_guest.xml
@@ -0,0 +1,67 @@
+<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_net6" value="fc00:0:0:0"/>
+ <alias name="vlan10_tag" value="10"/>
+ </define>
+ <network>
+ <host id="host1">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ </params>
+ <interfaces>
+ <eth id="nic" label="to_switch" />
+ <eth id="tap" label="to_guest" />
+ <ovs_bridge id="br">
+ <slaves>
+ <slave id="tap" />
+ <slave id="nic" />
+ </slaves>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ <host id="guest1">
+ <params>
+ <param name="machine_type" value="guest"/>
+ </params>
+ <interfaces>
+ <eth id="guestnic" label="to_guest" />
+ <vlan id="vlan10">
+ <options>
+ <option name="vlan_tci" value="{$vlan10_tag}" />
+ </options>
+ <slaves>
+ <slave id="guestnic" />
+ </slaves>
+ <addresses>
+ <address>{$vlan10_net}.10/24</address>
+ <address>{$vlan10_net6}::10/64</address>
+ </addresses>
+ </vlan>
+ </interfaces>
+ </host>
+ <host id="host2">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ </params>
+ <interfaces>
+ <eth id="nic" label="to_switch"/>
+ <vlan id="vlan10">
+ <options>
+ <option name="vlan_tci" value="{$vlan10_tag}" />
+ </options>
+ <slaves>
+ <slave id="nic" />
+ </slaves>
+ <addresses>
+ <address>{$vlan10_net}.11/24</address>
+ <address>{$vlan10_net6}::11/64</address>
+ </addresses>
+ </vlan>
+ </interfaces>
+ </host>
+ </network>
+
+ <task python="04-vlan_in_guest.py" />
+</lnstrecipe>
diff --git a/recipes/ovs_offload/1_virt_ovs_vxlan.README b/recipes/ovs_offload/1_virt_ovs_vxlan.README
new file mode 100644
index 0000000..11a7061
--- /dev/null
+++ b/recipes/ovs_offload/1_virt_ovs_vxlan.README
@@ -0,0 +1,41 @@
+Topology:
+
+ switch
+ +--------+
+ | |
+ +--------------------+ +----------------------+
+ | | | |
+ | | | |
+ | | | |
+ | +--------+ |
+ | |
+ | |
+ +--+--+ +--+--+
++---------| eth |--------+ +---------| eth |--------+
+| +-----+ | | +-----+ |
+| | | |
+| +----------------------------------------------------+ |
+| | | | | |
+| +----------+---------+ | | +----------+---------+ |
+| | vxlan | | | | vxlan | |
+| | | | | | | |
+| | ovs_bridge | | | | ovs_bridge | |
+| |tun_id | | | | | |
+| | 100 | | | | +----+ | |
+| +--+-----------------+ | | +-------|int0|-------+ |
+| | host1 | | +----+ |
+| | | | |
+| | | | host2 |
+| +-+-+ | | |
++--+tap+-----------------+ +------------------------+
+ +-+-+
+ |
+ +-+-+
++--+eth+--+
+| +---+ |
+| |
+| guest1 |
+| |
+| |
++---------+
+
diff --git a/recipes/ovs_offload/1_virt_ovs_vxlan.py b/recipes/ovs_offload/1_virt_ovs_vxlan.py
new file mode 100644
index 0000000..adc4122
--- /dev/null
+++ b/recipes/ovs_offload/1_virt_ovs_vxlan.py
@@ -0,0 +1,71 @@
+from lnst.Controller.Task import ctl
+from lnst.RecipeCommon.ModuleWrap import ping, ping6
+from Testlib import Testlib
+import logging
+
+# ------
+# SETUP
+# ------
+
+tl = Testlib(ctl)
+
+# hosts
+host1 = ctl.get_host("h1")
+host2 = ctl.get_host("h2")
+
+# guest machines
+guest1 = ctl.get_host("test_host1")
+
+guest1.sync_resources(modules=["IcmpPing", "Icmp6Ping"])
+
+# ------
+# TESTS
+# ------
+
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
+
+g1_nic = guest1.get_interface("if1")
+h2_nic = host2.get_device("int0")
+
+vxlan_port = ctl.get_alias("vxlan_port")
+vxlan_dev = "vxlan_sys_%s" % vxlan_port
+
+
+def do_pings():
+ ping_opts = {"count": 100, "interval": 0.2}
+ if ipv in ['ipv4', 'both']:
+ ping((guest1, g1_nic, 0, {"scope": 0}),
+ (host2, h2_nic, 0, {"scope": 0}),
+ options=ping_opts, expect="pass")
+ verify_tc_rules('ip')
+
+ if ipv in ['ipv6', 'both']:
+ ping6((guest1, g1_nic, 1, {"scope": 0}),
+ (host2, h2_nic, 1, {"scope": 0}),
+ options=ping_opts, expect="pass")
+ verify_tc_rules('ipv6')
+
+
+def verify_tc_rules(proto):
+ g1_mac = g1_nic.get_hwaddr()
+ h2_mac = h2_nic.get_hwaddr()
+
+ # encap rule
+ m = tl.find_tc_rule(host1, 'tap1', g1_mac, h2_mac, proto, 'tunnel_key set')
+ desc = "TC rule %s tunnel_key set" % proto
+ if m:
+ tl.custom(host1, desc)
+ else:
+ tl.custom(host1, desc, 'ERROR: cannot find tc rule')
+
+ # decap rule
+ m = tl.find_tc_rule(host1, vxlan_dev, h2_mac, g1_mac, proto, 'tunnel_key unset')
+ desc = "TC rule %s tunnel_key unset" % proto
+ if m:
+ tl.custom(host1, desc)
+ else:
+ tl.custom(host1, desc, 'ERROR: cannot find tc rule')
+
+
+do_pings()
diff --git a/recipes/ovs_offload/1_virt_ovs_vxlan.xml b/recipes/ovs_offload/1_virt_ovs_vxlan.xml
new file mode 100644
index 0000000..b1e3357
--- /dev/null
+++ b/recipes/ovs_offload/1_virt_ovs_vxlan.xml
@@ -0,0 +1,88 @@
+<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ <alias name="mtu" value="1450" />
+ <alias name="net" value="77.77.77"/>
+ <alias name="vxlan_net" value="1.1.1"/>
+ <alias name="vxlan_net6" value="fc00:0:0:0"/>
+ <alias name="vxlan_key" value="100"/>
+ <alias name="vxlan_port" value="1478"/>
+ </define>
+ <network>
+ <host id="h1">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ <param name="order" value="1"/>
+ </params>
+ <interfaces>
+ <eth id="if1" label="n1">
+ <addresses>
+ <address value="{$net}.1/24"/>
+ </addresses>
+ </eth>
+ <eth id="tap1" label="to_guest1"/>
+ <ovs_bridge id="ovs1">
+ <slaves>
+ <slave id="tap1">
+ <options>
+ <option name="ofport_request" value="5"/>
+ </options>
+ </slave>
+ </slaves>
+ <tunnel id="vxlan1" type="vxlan">
+ <options>
+ <option name="option:remote_ip" value="{$net}.2"/>
+ <option name="option:key" value="{$vxlan_key}"/>
+ <option name="option:dst_port" value="{$vxlan_port}"/>
+ <option name="ofport_request" value="10"/>
+ </options>
+ </tunnel>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ <host id="test_host1">
+ <interfaces>
+ <eth id="if1" label="to_guest1">
+ <addresses>
+ <address value="{$vxlan_net}.1/24"/>
+ <address value="{$vxlan_net6}::1/64"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="h2">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ </params>
+ <interfaces>
+ <eth id="if1" label="n1">
+ <addresses>
+ <address value="{$net}.2/24"/>
+ </addresses>
+ </eth>
+ <ovs_bridge id="ovs2">
+ <internal id="int0">
+ <options>
+ <option name="ofport_request" value="5"/>
+ <option name="name" value="int0"/>
+ </options>
+ <addresses>
+ <address value="{$vxlan_net}.2/24"/>
+ <address value="{$vxlan_net6}::2/24"/>
+ </addresses>
+ </internal>
+ <tunnel id="vxlan1" type="vxlan">
+ <options>
+ <option name="option:remote_ip" value="{$net}.1"/>
+ <option name="option:key" value="{$vxlan_key}"/>
+ <option name="option:dst_port" value="{$vxlan_port}"/>
+ <option name="ofport_request" value="10"/>
+ </options>
+ </tunnel>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ </network>
+
+ <task python="1_virt_ovs_vxlan.py"/>
+</lnstrecipe>
diff --git a/recipes/ovs_offload/1_virt_ovs_vxlan_ipv6.xml b/recipes/ovs_offload/1_virt_ovs_vxlan_ipv6.xml
new file mode 100644
index 0000000..ede7d66
--- /dev/null
+++ b/recipes/ovs_offload/1_virt_ovs_vxlan_ipv6.xml
@@ -0,0 +1,89 @@
+<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ <alias name="mtu" value="1450" />
+ <alias name="net" value="2002:0db8:0:f101"/>
+ <alias name="vxlan_net" value="1.1.1"/>
+ <alias name="vxlan_net6" value="fc00:0:0:0"/>
+ <alias name="vxlan_key" value="100"/>
+ <alias name="vxlan_port2" value="4789"/>
+ <alias name="vxlan_port" value="1478"/>
+ </define>
+ <network>
+ <host id="h1">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ <param name="order" value="1"/>
+ </params>
+ <interfaces>
+ <eth id="if1" label="n1">
+ <addresses>
+ <address value="{$net}::1/64"/>
+ </addresses>
+ </eth>
+ <eth id="tap1" label="to_guest1"/>
+ <ovs_bridge id="ovs1">
+ <slaves>
+ <slave id="tap1">
+ <options>
+ <option name="ofport_request" value="5"/>
+ </options>
+ </slave>
+ </slaves>
+ <tunnel id="vxlan1" type="vxlan">
+ <options>
+ <option name="option:remote_ip" value="{$net}::2"/>
+ <option name="option:key" value="{$vxlan_key}"/>
+ <option name="option:dst_port" value="{$vxlan_port}"/>
+ <option name="ofport_request" value="10"/>
+ </options>
+ </tunnel>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ <host id="test_host1">
+ <interfaces>
+ <eth id="if1" label="to_guest1">
+ <addresses>
+ <address value="{$vxlan_net}.1/24"/>
+ <address value="{$vxlan_net6}::1/64"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="h2">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ </params>
+ <interfaces>
+ <eth id="if1" label="n1">
+ <addresses>
+ <address value="{$net}::2/64"/>
+ </addresses>
+ </eth>
+ <ovs_bridge id="ovs2">
+ <internal id="int0">
+ <options>
+ <option name="ofport_request" value="5"/>
+ <option name="name" value="int0"/>
+ </options>
+ <addresses>
+ <address value="{$vxlan_net}.2/24"/>
+ <address value="{$vxlan_net6}::2/24"/>
+ </addresses>
+ </internal>
+ <tunnel id="vxlan1" type="vxlan">
+ <options>
+ <option name="option:remote_ip" value="{$net}::1"/>
+ <option name="option:key" value="{$vxlan_key}"/>
+ <option name="option:dst_port" value="{$vxlan_port}"/>
+ <option name="ofport_request" value="10"/>
+ </options>
+ </tunnel>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ </network>
+
+ <task python="1_virt_ovs_vxlan.py"/>
+</lnstrecipe>
diff --git a/recipes/ovs_offload/Testlib.py b/recipes/ovs_offload/Testlib.py
new file mode 100644
index 0000000..e14bae7
--- /dev/null
+++ b/recipes/ovs_offload/Testlib.py
@@ -0,0 +1,90 @@
+import re
+import logging
+
+
+class Testlib:
+ def __init__(self, ctl):
+ self._ctl = ctl
+
+ def set_hw_offload(self, host, nics, state):
+ cmd = "ethtool -K {nic} hw-tc-offload %s" % state
+ for nic in nics:
+ logging.info("Set hw-tc-offload=%s for %s" % (state, nic))
+ host.run(cmd.format(nic=nic))
+
+ def enable_hw_offload(self, host, nics):
+ self.set_hw_offload(host, nics, 'on')
+
+ def disable_hw_offload(self, host, nics):
+ self.set_hw_offload(host, nics, 'off')
+
+ def custom(self, host, desc, err_msg=None, opts=None):
+ host.sync_resources(modules=["Custom"])
+ options = {}
+ if opts:
+ options.update(opts)
+ if err_msg:
+ options["fail"] = "yes"
+ options["msg"] = err_msg
+ custom_mod = self._ctl.get_module("Custom", options=options)
+ host.run(custom_mod, desc=desc)
+
+ def find_tc_rule(self, host, nic, src_mac, dst_mac, proto='.*', action='.*', tunnel=''):
+ # find dev. i.e. ens5f0
+ try:
+ if1 = host.get_interface(nic)
+ dev = if1.get_devname()
+ except KeyError:
+ dev = nic
+
+ # tc output
+ cmd = host.run("tc -s filter show dev %s parent ffff:" % dev)
+ out = cmd.out().strip()
+
+ if not out:
+ return None
+
+ # find rule
+ pat_filter = r"^protocol %s pref .* dst_mac %s\n\s*src_mac %s\n.*\n\s*action order \s*\d+\s*:\s* %s" % (
+ proto, str(dst_mac).lower(), str(src_mac).lower(), action)
+ pat_action = r".*\n\s*action order .* %s.*\n\s*Sent (?P<bytes>\d+) bytes (?P<pkts>\d+) pkt \(dropped (?P<drop>\d+), overlimits \d+ requeues \d+\)" % action
+
+ logging.debug("device %s pattern '%s' action '%s'", dev, pat_filter, pat_action)
+
+ for f in re.split('\n\s*filter\s*', out):
+ if re.match(pat_filter, f, re.S + re.M):
+ logging.debug("matched filter")
+ m = re.match(pat_action, f, re.S + re.M)
+ if m:
+ logging.debug("matched action")
+ return m.groupdict()
+ return None
+ return None
+
+ def _get_iperf_srv_mod(self):
+ modules_options = {
+ "role": "server",
+ }
+ return self._ctl.get_module("Iperf", options=modules_options)
+
+ def _get_iperf_cli_mod(self, server, duration):
+ modules_options = {
+ "role": "client",
+ "iperf_server": server,
+ "duration": duration,
+ "iperf_opts": "-l 1024k -w 512k -P 12"
+ }
+ return self._ctl.get_module("Iperf", options=modules_options)
+
+ def iperf(self, cli_if, srv_if, duration, desc):
+ srv_ip = srv_if.get_ip(0)
+ srv_m = self._get_iperf_srv_mod()
+ cli_m = self._get_iperf_cli_mod(srv_ip, duration)
+
+ cli_host = cli_if.get_host()
+ srv_host = srv_if.get_host()
+
+ srv_proc = srv_host.run(srv_m, bg=True)
+ self._ctl.wait(2)
+ cli_host.run(cli_m, timeout=duration + 15, desc=desc)
+ srv_proc.intr()
--
1.7.1
6 years, 10 months