Fix INT TestON tests
- Miss test case 4 in INT.params
- Add description of test case
- Send multiple packets to ensure DeepInsight can receive and process INT
reports correctly
Change-Id: I8c7792a520b0213b0f4108e646af5b97bb8770b2
diff --git a/TestON/tests/USECASE/SegmentRouting/INT/INT.params b/TestON/tests/USECASE/SegmentRouting/INT/INT.params
index 63ff5c7..e73c627 100644
--- a/TestON/tests/USECASE/SegmentRouting/INT/INT.params
+++ b/TestON/tests/USECASE/SegmentRouting/INT/INT.params
@@ -1,7 +1,7 @@
<!-- SPDX-FileCopyrightText: Copyright 2021-present Open Networking Foundation. -->
<!-- SPDX-License-Identifier: GPL-2.0-or-later -->
<PARAMS>
- <testcases>1,2,3</testcases>
+ <testcases>1,2,3,4</testcases>
<routerMac>00:00:0A:4C:1C:46</routerMac>
<TREX>
<flows>
diff --git a/TestON/tests/USECASE/SegmentRouting/INT/INT.py b/TestON/tests/USECASE/SegmentRouting/INT/INT.py
index 9295a29..4942d44 100644
--- a/TestON/tests/USECASE/SegmentRouting/INT/INT.py
+++ b/TestON/tests/USECASE/SegmentRouting/INT/INT.py
@@ -7,9 +7,7 @@
self.default = ""
def CASE1 (self, main):
- """
- Send ping packets from one host to another host and check flows from DeepInsight.
- """
+ main.case("Send ping packets from one host to another host and check flows from DeepInsight")
import time
import socket
from core import utilities
@@ -38,7 +36,10 @@
UDP(sport={}, dport={}) /
("A"*30)
)""".format(srcMac, dstMac, srcIp, dstIp, srcPort, dstPort)
- main.h1.sendPacket(iface=srcIfaceName, packet=pkt)
+ # Send multiple packets incase the server or DeepInsight drop the report accidently
+ # FIXME: Find the root cause, might be misconfiguration or Linux(e.g., rp_filter?) issue.
+ for _ in range(0, 5):
+ main.h1.sendPacket(iface=srcIfaceName, packet=pkt)
endTimeMs = (time.time() + 5) * 1000
main.step("Checking total number of flow reports from DeepInsight")
@@ -71,10 +72,7 @@
intTest.cleanUp(main)
def CASE2 (self, main):
- """
- Send a packet with invalid VLAN from one host to another host and check
- if DeepInsight receives drop reports.
- """
+ main.case("Send a packet with invalid VLAN from one host to another host and check if DeepInsight receives drop reports")
import time
import socket
from core import utilities
@@ -104,7 +102,10 @@
UDP(sport={}, dport={}) /
("A"*30)
)""".format(srcMac, dstMac, srcIp, dstIp, srcPort, dstPort)
- main.h1.sendPacket(iface=srcIfaceName, packet=pkt)
+ # Send multiple packets incase the server or DeepInsight drop the report accidently
+ # FIXME: Find the root cause, might be misconfiguration or Linux(e.g., rp_filter?) issue.
+ for _ in range(0, 5):
+ main.h1.sendPacket(iface=srcIfaceName, packet=pkt)
endTimeMs = (time.time() + 5) * 1000
main.step("Checking drop report from DeepInsight")
@@ -127,10 +128,10 @@
attempts=60,
)
- utilities.assert_equals(
- expect=1, actual=len(dropAnomalies),
- onpass="Got 1 drop anomaly from DeepInsight as expected.",
- onfail="Got %d drop anomaly from DeepInsight, expect 1" % (len(dropAnomalies))
+ utilities.assert_lesser(
+ expect=0, actual=len(dropAnomalies),
+ onpass="Got %d drop anomaly from DeepInsight." % (len(dropAnomalies)),
+ onfail="Got no drop anomaly from DeepInsight."
)
main.step("Checking drop reason from the report")
@@ -148,10 +149,7 @@
intTest.cleanUp(main)
def CASE3 (self, main):
- """
- Send a packet with IP TTL value 1 from one host to another host and check
- if DeepInsight receives drop reports.
- """
+ main.case("Send a packet with IP TTL value 1 from one host to another host and check if DeepInsight receives drop reports")
import time
import socket
from core import utilities
@@ -180,7 +178,10 @@
UDP(sport={}, dport={}) /
("A"*30)
)""".format(srcMac, dstMac, srcIp, dstIp, srcPort, dstPort)
- main.h1.sendPacket(iface=srcIfaceName, packet=pkt)
+ # Send multiple packets incase the server or DeepInsight drop the report accidently
+ # FIXME: Find the root cause, might be misconfiguration or Linux(e.g., rp_filter?) issue.
+ for _ in range(0, 5):
+ main.h1.sendPacket(iface=srcIfaceName, packet=pkt)
endTimeMs = (time.time() + 5) * 1000
main.step("Checking drop report from DeepInsight")
@@ -203,10 +204,10 @@
attempts=60,
)
- utilities.assert_equals(
- expect=1, actual=len(dropAnomalies),
- onpass="Got 1 drop anomaly from DeepInsight as expected.",
- onfail="Got %d drop anomaly from DeepInsight, expect '1'." % (len(dropAnomalies))
+ utilities.assert_lesser(
+ expect=0, actual=len(dropAnomalies),
+ onpass="Got %d drop anomaly from DeepInsight." % (len(dropAnomalies)),
+ onfail="Got no drop anomaly from DeepInsight."
)
main.step("Checking drop reason from report")
@@ -223,9 +224,7 @@
intTest.cleanUp(main)
def CASE4(self, main):
- """
- Generate traffic at high rate and expect queue congestion reports in DeepInsight.
- """
+ main.case("Generate traffic at high rate and expect queue congestion reports in DeepInsight")
from core import utilities
import time
from tests.USECASE.SegmentRouting.INT.dependencies.IntTest import IntTest
@@ -268,7 +267,7 @@
queueAnomalies = utilities.retry(
f=getQueueAnomaly,
retValue=[[]],
- attempts=60,
+ attempts=120,
)
# We should get at least two congestion records