test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH] tests/TestSuite_qos_meter: srTCM changed CBS-EBS
@ 2022-07-11 14:06 Marcin Danilewicz
  2022-09-02  1:32 ` lijuan.tu
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Danilewicz @ 2022-07-11 14:06 UTC (permalink / raw)
  To: dts, yuan.peng

Adding test cased for "srTCM blind changed CBS and EBS" from
test_plans/qos_meter_test_plan.rst

Signed-off-by: Marcin Danilewicz <marcinx.danilewicz@intel.com>
---
 tests/TestSuite_qos_meter.py | 163 ++++++++++++++++++++++++++++++++---
 1 file changed, 153 insertions(+), 10 deletions(-)

diff --git a/tests/TestSuite_qos_meter.py b/tests/TestSuite_qos_meter.py
index b1d13a32..24cadbcc 100644
--- a/tests/TestSuite_qos_meter.py
+++ b/tests/TestSuite_qos_meter.py
@@ -41,12 +41,14 @@ class TestQosMeter(TestCase):
         """
         pass
 
-    def build_app_and_send_package(self):
+    def build_app_and_send_package(self, payload_size_block):
         """
         Build app and send pkt
         return bps and pps
         """
-        self.dut.send_expect("rm -rf ./examples/qos_meter/build", "#")
+        self.dut.send_expect("rm -rf ./examples/qos_meter/build",
+        "#",
+        )
         out = self.dut.build_dpdk_apps("./examples/qos_meter")
         self.verify("Error" not in out, "Compilation error")
         self.verify("No such" not in out, "Compilation error")
@@ -56,9 +58,9 @@ class TestQosMeter(TestCase):
         app_name = self.dut.apps_name["qos_meter"]
         cmd = app_name + eal_params + "-- -p 0x3"
         self.dut.send_expect(cmd, "TX = 1")
-        payload_size = 64 - HEADER_SIZE["eth"] - HEADER_SIZE["ip"]
+        payload_size = payload_size_block - HEADER_SIZE["eth"] - HEADER_SIZE["ip"]
         dts_mac = self.dut.get_mac_address(self.dut_ports[self.rx_port])
-        pkt = Packet(pkt_type="IP_RAW")
+        pkt = Packet(pkt_type="IP_RAW", pkt_len=payload_size)
         pkt.save_pcapfile(self.tester, "%s/tester.pcap" % self.tester.tmp_file)
         stream_option = {
             "pcap": "%s/tester.pcap" % self.tester.tmp_file,
@@ -79,7 +81,11 @@ class TestQosMeter(TestCase):
         )
         self.tester.pktgen.config_stream(stream_id, stream_option)
         stream_ids.append(stream_id)
-        traffic_opt = {"method": "throughput", "rate": 100, "duration": 20}
+        traffic_opt = {
+            "method": "throughput",
+            "rate": 100,
+            "duration": 20
+        }
         bps, pps = self.tester.pktgen.measure(stream_ids, traffic_opt)
         return bps, pps
 
@@ -102,7 +108,7 @@ class TestQosMeter(TestCase):
             r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_SRTCM_COLOR_BLIND/2' ./examples/qos_meter/main.c",
             "#",
         )
-        bps, pps = self.build_app_and_send_package()
+        bps, pps = self.build_app_and_send_package(64)
         self.verify_throughput(pps, self.aware_pps)
 
     def test_perf_srTCM_blind_GREEN(self):
@@ -117,7 +123,7 @@ class TestQosMeter(TestCase):
             r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_SRTCM_COLOR_BLIND/2' ./examples/qos_meter/main.c",
             "#",
         )
-        bps, pps = self.build_app_and_send_package()
+        bps, pps = self.build_app_and_send_package(64)
         self.verify_throughput(pps, self.blind_pps)
 
     def test_perf_srTCM_aware_RED(self):
@@ -132,7 +138,7 @@ class TestQosMeter(TestCase):
             r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_SRTCM_COLOR_AWARE/2' ./examples/qos_meter/main.c",
             "#",
         )
-        bps, pps = self.build_app_and_send_package()
+        bps, pps = self.build_app_and_send_package(64)
         self.verify_throughput(pps, self.blind_pps)
 
     def test_perf_trTCM_blind(self):
@@ -147,7 +153,7 @@ class TestQosMeter(TestCase):
             r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_TRTCM_COLOR_BLIND/2' ./examples/qos_meter/main.c",
             "#",
         )
-        bps, pps = self.build_app_and_send_package()
+        bps, pps = self.build_app_and_send_package(64)
         self.verify_throughput(pps, self.aware_pps)
 
     def test_perf_trTCM_aware(self):
@@ -162,9 +168,146 @@ class TestQosMeter(TestCase):
             r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_TRTCM_COLOR_AWARE/2' ./examples/qos_meter/main.c",
             "#",
         )
-        bps, pps = self.build_app_and_send_package()
+        bps, pps = self.build_app_and_send_package(64)
+        self.verify_throughput(pps, self.blind_pps)
+
+    def test_perf_trTCM_blind_changed_CBS_EBS_64B_frame(self):
+        """
+        trTCM blind changed CBS and EBS
+        """
+        self.dut.send_expect(
+            r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_TRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        bps, pps = self.build_app_and_send_package(64)
+        self.verify_throughput(pps, self.blind_pps)
+
+    def test_perf_trTCM_blind_changed_CBS_EBS_82B_frame(self):
+        """
+        trTCM blind changed CBS and EBS
+        """
+        self.dut.send_expect(
+            r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_SRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        bps, pps = self.build_app_and_send_package(82)
+        self.verify_throughput(pps, self.blind_pps)
+
+    def test_perf_trTCM_blind_changed_CBS_EBS_83B_frame(self):
+        """
+        trTCM blind changed CBS and EBS
+        """
+        self.dut.send_expect(
+            r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_SRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        bps, pps = self.build_app_and_send_package(83)
         self.verify_throughput(pps, self.blind_pps)
 
+    def test_perf_trTCM_blind_changed_CBS_EBS_146B_frame(self):
+        """
+        trTCM blind changed CBS and EBS
+        """
+        tc_pps = 10000000
+        self.dut.send_expect(
+            r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_SRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        bps, pps = self.build_app_and_send_package(146)
+        self.verify_throughput(pps, tc_pps)
+
+    def test_perf_trTCM_blind_changed_CBS_EBS_530B_frame(self):
+        """
+        trTCM blind changed CBS and EBS
+        """
+        tc_pps = 2500000
+        self.dut.send_expect(
+            r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_SRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        self.dut.send_expect(
+            r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c",
+            "#",
+        )
+        bps, pps = self.build_app_and_send_package(530)
+        self.verify_throughput(pps, tc_pps)
+
     def tear_down(self):
         """
         Run after each test case.
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-02  1:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11 14:06 [PATCH] tests/TestSuite_qos_meter: srTCM changed CBS-EBS Marcin Danilewicz
2022-09-02  1:32 ` lijuan.tu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).