For ICMP/ICMP6 ping tests between different vlans that are deemed to fail,
we don't need to iterate over offload turning on and off. This is also to
speed up the regression tests.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/3_vlans.py | 26 +++++++------------
.../regression_tests/phase1/3_vlans_over_bond.py | 28 +++++++--------------
.../regression_tests/phase2/3_vlans_over_team.py | 29 +++++++---------------
3 files changed, 27 insertions(+), 56 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans.py
b/recipes/regression_tests/phase1/3_vlans.py
index a52a829..7e79a9f 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -108,10 +108,10 @@ for vlan1 in vlans:
"-L %s -6" % m2.get_ip(vlan1,
1)
})
- for offload in offloads:
+ if vlan1 == vlan2:
# These tests should pass
# Ping between same VLANs
- if vlan1 == vlan2:
+ for offload in offloads:
for state in ["off", "on"]:
# Offload setup
m1.run("ethtool -K %s %s %s" %
(m1.get_devname("eth1"),
@@ -140,19 +140,11 @@ for vlan1 in vlans:
m2.run(netperf_cli_udp6, timeout=70)
srv_proc.intr()
- # These tests should fail
- # Ping across different VLAN
- elif vlan1 != vlan2:
- for state in ["off", "on"]:
- # Offload setup
- m1.run("ethtool -K %s %s %s" %
(m1.get_devname("eth1"),
- offload, state))
- m2.run("ethtool -K %s %s %s" %
(m2.get_devname("eth1"),
- offload, state))
+ # These tests should fail
+ # Ping across different VLAN
+ else:
+ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod, expect="fail")
- if ipv in [ 'ipv4', 'both' ]:
- # Ping test
- m1.run(ping_mod, expect="fail")
-
- if ipv in [ 'ipv6', 'both' ]:
- m1.run(ping_mod6, expect="fail")
+ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6, expect="fail")
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py
b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index 7fcd80a..dde2359 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -108,10 +108,10 @@ for vlan1 in vlans:
"-L %s -6" % m2.get_ip(vlan1,
1)
})
- for offload in offloads:
+ if vlan1 == vlan2:
# These tests should pass
# Ping between same VLANs
- if vlan1 == vlan2:
+ for offload in offloads:
for state in ["off", "on"]:
# Offload setup
m1.run("ethtool -K %s %s %s" %
(m1.get_devname("eth1"),
@@ -142,21 +142,11 @@ for vlan1 in vlans:
m2.run(netperf_cli_udp6, timeout=70)
srv_proc.intr()
- # These tests should fail
- # Ping across different VLAN
- elif vlan1 != vlan2:
- for state in ["off", "on"]:
- # 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))
- m2.run("ethtool -K %s %s %s" %
(m2.get_devname("eth1"),
- offload, state))
+ # These tests should fail
+ # Ping across different VLAN
+ else:
+ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod, expect="fail")
- if ipv in [ 'ipv4', 'both' ]:
- # Ping test
- m1.run(ping_mod, expect="fail")
-
- if ipv in [ 'ipv6', 'both' ]:
- m1.run(ping_mod6, expect="fail")
+ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6, expect="fail")
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py
b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 91160f7..74b5a5a 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -108,10 +108,10 @@ for vlan1 in vlans:
"-L %s -6" % m2.get_ip(vlan1, 1)
})
- for offload in offloads:
+ if vlan1 == vlan2:
# These tests should pass
# Ping between same VLANs
- if vlan1 == vlan2:
+ for offload in offloads:
for state in ["off", "on"]:
# Offload setup
m1.run("ethtool -K %s %s %s" %
(m1.get_devname("eth1"),
@@ -144,22 +144,11 @@ for vlan1 in vlans:
m2.run(netperf_cli_udp6, timeout=70)
srv_proc.intr()
- # These tests should fail
- # Ping across different VLAN
- elif vlan1 != vlan2:
- for state in ["off", "on"]:
- # 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
- if ipv in [ 'ipv4', 'both' ]:
- m1.run(ping_mod, expect="fail")
+ # These tests should fail
+ # Ping across different VLAN
+ else:
+ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod, expect="fail")
- if ipv in [ 'ipv6', 'both' ]:
- m1.run(ping_mod6, expect="fail")
+ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6, expect="fail")
--
1.9.3