From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E77ADA0521; Tue, 28 Jul 2020 06:49:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A01CF1BFF4; Tue, 28 Jul 2020 06:49:24 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 5441D2B9C for ; Tue, 28 Jul 2020 06:49:22 +0200 (CEST) IronPort-SDR: 4VYhIbCi3UtQxfsw1etOm1ZytZb9T4By3cxEKYXSKImfCXTAEl3K/iQz2VncJ6V0KcXE9N/pkm I9/aqpKo9Y8A== X-IronPort-AV: E=McAfee;i="6000,8403,9695"; a="131215051" X-IronPort-AV: E=Sophos;i="5.75,405,1589266800"; d="scan'208";a="131215051" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2020 21:49:21 -0700 IronPort-SDR: eQiducEzBtLzCVCIqAJvNH+ylRH7UCPLT/1IylMNuvM8ZlswPt1jsrsndyErq/v8gKulz5ZQEO jhOE4AhGWHkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,405,1589266800"; d="scan'208";a="364363978" Received: from dpdk-lunannan.sh.intel.com ([10.67.111.68]) by orsmga001.jf.intel.com with ESMTP; 27 Jul 2020 21:49:19 -0700 From: Nannan Lu To: dts@dpdk.org Cc: Nannan Lu Date: Tue, 28 Jul 2020 13:41:22 +0000 Message-Id: <1595943682-1510101-1-git-send-email-nannan.lu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] tests/TestSuite_cvl_dcf_switch_filter.py: modify max_rule_number test case X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Modify max_rule_number test case, since the max switch filter rule number which can be created will be changed if firmware or kernel driver changed. Signed-off-by: Nannan Lu --- tests/TestSuite_cvl_dcf_switch_filter.py | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_cvl_dcf_switch_filter.py b/tests/TestSuite_cvl_dcf_switch_filter.py index afb6a28..c15fd31 100644 --- a/tests/TestSuite_cvl_dcf_switch_filter.py +++ b/tests/TestSuite_cvl_dcf_switch_filter.py @@ -855,7 +855,7 @@ tv_add_two_rules_with_different_input_set_different_vf_id = { "expect_results":{"expect_pkts":[0, 0]}} } -class SwitchFilterTest(TestCase): +class CVLDCFSwitchFilterTest(TestCase): def bind_nics_driver(self, ports, driver=""): # modprobe vfio driver @@ -1677,10 +1677,29 @@ class SwitchFilterTest(TestCase): rule_list_num = list(range(0, 32563)) rule_list = [str(x) for x in rule_list_num] self.check_switch_filter_rule_list(0, rule_list) - #create the 32564th rule - rule = "flow create 0 ingress pattern eth / ipv4 src is 192.168.127.178 / end actions vf id 1 / end" - out = self.dut.send_expect(rule, "testpmd> ", timeout=2) - self.verify("Failed to create flow" in out, "Log not provide a friendly output to indicate that the rule failed to create.") + #create other rules to make switch filter table full + m = i + t = j + p = re.compile(r"Flow rule #(\d+) created") + switch_table_full_flag = False + count = 0 + for i in range(m,255): + for j in range(t,255): + rule = 'flow create 0 ingress pattern eth / ipv4 src is 192.168.%d.%d / end actions vf id 1 / end \n' % (i, j) + matched_packet = 'Ether(dst="68:05:ca:8d:ed:a8")/IP(src="192.168.%d.%d")/TCP(sport=25,dport=23)/Raw("X"*480)' % (i, j) + out = self.dut.send_expect(rule, "testpmd> ", timeout=2) #create a rule + m1 = p.search(out) + if m1: + rule_list.append(m1.group(1)) + tv_max_rule_number["matched"]["scapy_str"].append(matched_packet) + count += 1 + else: + self.verify("Failed to create flow" in out, "Log not provide a friendly output to indicate that the rule failed to create.") + switch_table_full_flag = True + break + if switch_table_full_flag: + break + tv_max_rule_number["matched"]["expect_results"]["expect_pkts"] += count #check the rule list self.check_switch_filter_rule_list(0, rule_list) #send matched packets and check -- 2.7.4