From: Marcin Danilewicz <marcinx.danilewicz@intel.com>
To: dts@dpdk.org, yuan.peng@intel.com
Subject: [PATCH] tests/TestSuite_qos_meter: srTCM changed CBS-EBS
Date: Mon, 11 Jul 2022 14:06:49 +0000 [thread overview]
Message-ID: <20220711140649.303957-1-marcinx.danilewicz@intel.com> (raw)
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
next reply other threads:[~2022-07-11 14:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 14:06 Marcin Danilewicz [this message]
2022-09-02 1:32 ` lijuan.tu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220711140649.303957-1-marcinx.danilewicz@intel.com \
--to=marcinx.danilewicz@intel.com \
--cc=dts@dpdk.org \
--cc=yuan.peng@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).