Remove check for the number of flows in UP4 and QOS test cases
We can't really trust that check, we should implement a more refined check
to verify UP4 state is replicated on all leaves by filtering only UP4 ralated
flows if required.
Change-Id: I94a49840e72604d7f328d42e07925d3ffb85ca1d
diff --git a/TestON/tests/USECASE/SegmentRouting/UP4/UP4.py b/TestON/tests/USECASE/SegmentRouting/UP4/UP4.py
index f0d7fa5..1b4b88e 100644
--- a/TestON/tests/USECASE/SegmentRouting/UP4/UP4.py
+++ b/TestON/tests/USECASE/SegmentRouting/UP4/UP4.py
@@ -16,8 +16,7 @@
Verify removed UPF entities
"""
try:
- from tests.USECASE.SegmentRouting.dependencies.up4 import UP4, \
- N_FLOWS_PER_UE
+ from tests.USECASE.SegmentRouting.dependencies.up4 import UP4
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
except ImportError as e:
@@ -34,7 +33,6 @@
main.step("Start scapy and p4rt client")
# Use the first available ONOS instance CLI
onos_cli = main.Cluster.active(0).CLI
- initial_flow_count = onos_cli.checkFlowCount()
up4 = UP4()
# Get the P4RT client connected to UP4 in the first available ONOS instance
up4.setup(main.Cluster.active(0).p4rtUp4)
@@ -43,12 +41,6 @@
up4.attachUes()
up4.verifyUp4Flow(onos_cli)
- run.checkFlows(
- main,
- minFlowCount=initial_flow_count + (
- len(up4.emulated_ues) * N_FLOWS_PER_UE * n_switches)
- )
-
# ------- Test Upstream traffic (enb->pdn)
for app_filter_name in up4.app_filters:
main.step("Test upstream traffic %s" % app_filter_name)
@@ -63,8 +55,6 @@
up4.detachUes()
up4.verifyNoUesFlow(onos_cli)
- run.checkFlows(main, minFlowCount=initial_flow_count)
-
main.step("Stop scapy and p4rt client")
up4.teardown()
@@ -87,8 +77,7 @@
UE_PORT = 400
PDN_PORT = 800
try:
- from tests.USECASE.SegmentRouting.dependencies.up4 import UP4, \
- N_FLOWS_PER_UE
+ from tests.USECASE.SegmentRouting.dependencies.up4 import UP4
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
except ImportError as e:
@@ -105,7 +94,6 @@
main.step("Start scapy and p4rt client + Scapy on BESS Host")
# Use the first available ONOS instance CLI
onos_cli = main.Cluster.active(0).CLI
- initial_flow_count = onos_cli.checkFlowCount()
up4 = UP4()
# Get the P4RT client connected to UP4 in the first available ONOS instance
up4.setup(main.Cluster.active(0).p4rtUp4)
@@ -126,12 +114,6 @@
up4.attachUes()
up4.verifyUp4Flow(onos_cli)
- run.checkFlows(
- main,
- minFlowCount=initial_flow_count + (
- len(up4.emulated_ues) * N_FLOWS_PER_UE * n_switches)
- )
-
# ------------------- UPSTREAM -------------------
# ------- eNB -> fabric -> BESS (encapped)
main.step("Test upstream eNB -> fabric -> BESS")
@@ -261,8 +243,6 @@
up4.detachUes()
up4.verifyNoUesFlow(onos_cli)
- run.checkFlows(main, minFlowCount=initial_flow_count)
-
main.step("Stop scapy and p4rt client")
up4.teardown()
bess_host.stopScapy()
@@ -282,8 +262,7 @@
Disconnect P4RT client
"""
try:
- from tests.USECASE.SegmentRouting.dependencies.up4 import UP4, \
- N_FLOWS_PER_UE
+ from tests.USECASE.SegmentRouting.dependencies.up4 import UP4
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
except ImportError as e:
@@ -303,7 +282,6 @@
up4_0 = UP4()
up4_1 = UP4()
up4_2 = UP4()
- initial_flow_count = onos_cli_0.checkFlowCount()
main.step("Program and Verify UPF entities via UP4 on ONOS 0")
up4_0.setup(main.Cluster.active(0).p4rtUp4, no_host=True)
@@ -311,12 +289,6 @@
up4_0.verifyUp4Flow(onos_cli_0)
up4_0.teardown()
- run.checkFlows(
- main,
- minFlowCount=initial_flow_count + (
- len(up4_0.emulated_ues) * N_FLOWS_PER_UE * n_switches)
- )
-
main.step("Verify UPF entities number via UP4 P4RT on ONOS 1")
up4_1.setup(main.Cluster.active(1).p4rtUp4, no_host=True)
utilities.assert_equal(
@@ -352,8 +324,6 @@
up4_2.detachUes()
up4_2.verifyNoUesFlow(onos_cli_2)
- run.checkFlows(main, minFlowCount=initial_flow_count)
-
main.step("Verify no UPF entities via UP4 P4RT on ONOS 2")
utilities.assert_equal(
expect=True,
@@ -411,8 +381,7 @@
Remove UPF entities (cleanup)
"""
try:
- from tests.USECASE.SegmentRouting.dependencies.up4 import UP4, \
- N_FLOWS_PER_UE
+ from tests.USECASE.SegmentRouting.dependencies.up4 import UP4
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
from tests.USECASE.SegmentRouting.SRStaging.dependencies.SRStagingTest import \
@@ -437,20 +406,12 @@
up4_1 = UP4()
up4_2 = UP4()
- initial_flow_count = onos_cli_0.checkFlowCount()
-
main.step("Program and Verify UPF entities via UP4 on ONOS 0")
up4_0.setup(main.Cluster.active(0).p4rtUp4, no_host=True)
up4_0.attachUes()
up4_0.verifyUp4Flow(onos_cli_0)
up4_0.teardown()
- run.checkFlows(
- main,
- minFlowCount=initial_flow_count + (
- len(up4_0.emulated_ues) * N_FLOWS_PER_UE * n_switches)
- )
-
onosPod = main.params["UP4_delete_pod"]
# Save ONOS diags of the POD we are killing otherwise we lose ONOS logs
@@ -521,19 +482,11 @@
onfail="Stale UPF entities"
)
- run.checkFlows(main, minFlowCount=initial_flow_count)
-
main.step("Re-program UPF entities via UP4 on ONOS 0 after restart")
up4_0.attachUes()
up4_0.verifyUp4Flow(onos_cli_0)
up4_0.teardown()
- run.checkFlows(
- main,
- minFlowCount=initial_flow_count + (
- len(up4_0.emulated_ues) * N_FLOWS_PER_UE * n_switches)
- )
-
main.step("Verify UPF entities via UP4 on ONOS 1")
up4_1.setup(main.Cluster.active(1).p4rtUp4, no_host=True)
up4_1.verifyUp4Flow(onos_cli_1)
@@ -555,8 +508,6 @@
up4_1.verifyNoUesFlow(onos_cli_1)
up4_1.teardown()
- run.checkFlows(main, minFlowCount=initial_flow_count)
-
run.cleanup(main)
def CASE5(self, main):
@@ -572,8 +523,7 @@
Remove UPF entities (cleanup)
"""
try:
- from tests.USECASE.SegmentRouting.dependencies.up4 import UP4, \
- N_FLOWS_PER_UE
+ from tests.USECASE.SegmentRouting.dependencies.up4 import UP4
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
from tests.USECASE.SegmentRouting.SRStaging.dependencies.SRStagingTest import \
@@ -603,18 +553,11 @@
up4 = UP4()
- initial_flow_count = onos_cli.checkFlowCount()
-
main.step("Program and Verify UPF entities via UP4")
up4.setup(main.Cluster.active(0).p4rtUp4)
up4.attachUes()
up4.verifyUp4Flow(onos_cli)
- run.checkFlows(
- main,
- minFlowCount=initial_flow_count+(len(up4.emulated_ues)*4*n_switches)
- )
-
main.step("Set label to switch k8s node and kill switch")
# K8s node name correspond to the switch name in lowercase
utilities.assert_equal(
@@ -751,8 +694,6 @@
up4.verifyNoUesFlow(onos_cli)
up4.teardown()
- run.checkFlows(main, minFlowCount=initial_flow_count)
-
# Teardown
run.cleanup(main)