From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4949A0542; Tue, 13 Dec 2022 08:16:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB4A040395; Tue, 13 Dec 2022 08:16:02 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id E731B40146 for ; Tue, 13 Dec 2022 08:16:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670915761; x=1702451761; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xSdswGfTIO8taWh9AneOgMpESD0CRPaono/qCuufTiM=; b=LzqaYAknpBtw2vNIUVIJW5UGkANjdfqMYu7E4EhXfKJfLT0KRy2n9aFN yvxHptEOF6IxvPEXdaV1iJdO+VA7DSpT+oWEwcHoEqZX6Wm8X7Morfmw6 CenHlayY9GZnDL0Ex+0cBWf9u8uS1eqOVNjop8OjIUCYthqphVgUtXiIC svUejJxz4E7WDg/FLDbHWLGNQMMb3AmwHftFYybv58DOww34YjmxCNDXH 8oghaJ4ShdAm2ovhEpYzp0RaNEJCIu83bLvVMPWLZibtlSZ6TaCEcyhAE GHJedYyWqTTn8zibYDrJSZP9g21nZjIr077yvQ5h/L4gEmaqWpAy/u5Qx g==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="404321513" X-IronPort-AV: E=Sophos;i="5.96,240,1665471600"; d="scan'208";a="404321513" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 23:16:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="650636883" X-IronPort-AV: E=Sophos;i="5.96,240,1665471600"; d="scan'208";a="650636883" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by fmsmga007.fm.intel.com with ESMTP; 12 Dec 2022 23:15:58 -0800 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, lijuan.tu@intel.com, qi.fu@intel.com Subject: [DTS][PATCH V1 4/4] tests/ice_dcf_switch_filter: update existing negative cases to validate represented port action and port representor action Date: Tue, 13 Dec 2022 15:14:31 +0800 Message-Id: <20221213071431.158185-5-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221213071431.158185-1-ke1.xu@intel.com> References: <20221213071431.158185-1-ke1.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 1. Add second PF with VFs for following cases 2. Add a subcase to validate creating 'represented port' action on a representor 3. Add a subcase to validate creating 'represented port' action on a VF 4. Add a subcase to validate creating 'represented port' action to a VF 5. Add two subcases to validate creating 'represented port' action to DCFs 6. Add a subcase to validate creating 'represented port' action to a representor of another DCF 7. Add a subcase to validate creating 'port representor' action on a representor 8. Add a subcase to validate creating 'port representor' action on a VF 9. Add a subcase to validate creating 'port representor' action to a VF 10. Add a subcase to validate creating 'port representor' action to a representor 11. Add a subcase to validate creating 'port representor' action to another DCF 12. Add a subcase to validate deprecated action 13. Add a subcase to validate using an invalid port id Signed-off-by: Ke Xu --- tests/TestSuite_ice_dcf_switch_filter.py | 109 +++++++++++++++++++++-- 1 file changed, 100 insertions(+), 9 deletions(-) diff --git a/tests/TestSuite_ice_dcf_switch_filter.py b/tests/TestSuite_ice_dcf_switch_filter.py index 4a7d7abb..23f9800b 100644 --- a/tests/TestSuite_ice_dcf_switch_filter.py +++ b/tests/TestSuite_ice_dcf_switch_filter.py @@ -2559,22 +2559,113 @@ class ICEDCFSwitchFilterTest(TestCase): # launch testpmd self.launch_testpmd() rules = { - "cannot create rule on vf 1": "flow create 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end", - "unsupported input set": "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 2 / eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.1.2 dst is 192.168.1.3 tos is 4 / end actions represented_port ethdev_port_id 1 / end", - "invalid vf id": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / tcp src is 25 dst is 23 / end actions represented_port ethdev_port_id 5 / end", + "cannot create to vf rule on a representor": "flow create 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end", + "cannot create to vf rule on a vf": "flow create 3 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end", + "cannot create to vf rule to a vf": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 3 / end", + "cannot create to vf rule to another dcf": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 4 / end", + "cannot create to vf rule to a representor of another pf": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 5 / end", + "cannot create vf original rule on a representor": "flow create 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end", + "cannot create vf original rule on a vf": "flow create 3 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end", + "cannot create vf original rule to a vf": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 3 / end", + "cannot create vf original rule to a representor": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end", + "cannot create vf original rule to another dcf": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 4 / end", + "unsupported input set": "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 2 / eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.1.2 dst is 192.168.1.3 tos is 4 / end actions port_representor port_id 1 / end", + "invalid port id": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / tcp src is 25 dst is 23 / end actions represented_port ethdev_port_id 20 / end", "void action": "flow create 0 ingress pattern eth / ipv4 / udp src is 25 dst is 23 / end actions end", "void input set value": "flow create 0 ingress pattern eth / ipv4 / end actions represented_port ethdev_port_id 1 end", } - # cannot create rule on vf 1 + # cannot create to vf rule on a representor self.validate_switch_filter_rule( - rules["cannot create rule on vf 1"], check_stats=False + rules["cannot create to vf rule on a representor"], check_stats=False ) self.check_switch_filter_rule_list(1, []) self.create_switch_filter_rule( - rules["cannot create rule on vf 1"], check_stats=False + rules["cannot create to vf rule on a representor"], check_stats=False ) self.check_switch_filter_rule_list(1, []) + # cannot create to vf rule on a vf + self.validate_switch_filter_rule( + rules["cannot create to vf rule on a vf"], check_stats=False + ) + self.check_switch_filter_rule_list(3, []) + self.create_switch_filter_rule( + rules["cannot create to vf rule on a vf"], check_stats=False + ) + self.check_switch_filter_rule_list(3, []) + + # cannot create to vf rule to a vf + self.validate_switch_filter_rule( + rules["cannot create to vf rule to a vf"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + self.create_switch_filter_rule( + rules["cannot create to vf rule to a vf"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + + # cannot create to vf rule to another dcf + self.validate_switch_filter_rule( + rules["cannot create to vf rule to another dcf"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + self.create_switch_filter_rule( + rules["cannot create to vf rule to another dcf"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + + # cannot create to vf rule to a representor of another pf + self.validate_switch_filter_rule( + rules["cannot create to vf rule to a representor of another pf"], + check_stats=False, + ) + self.check_switch_filter_rule_list(0, []) + self.create_switch_filter_rule( + rules["cannot create to vf rule to a representor of another pf"], + check_stats=False, + ) + self.check_switch_filter_rule_list(0, []) + + # cannot create vf original rule on a representor + self.validate_switch_filter_rule( + rules["cannot create vf original rule on a representor"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + self.create_switch_filter_rule( + rules["cannot create vf original rule on a representor"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + + # cannot create vf original rule on a vf + self.validate_switch_filter_rule( + rules["cannot create vf original rule on a vf"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + self.create_switch_filter_rule( + rules["cannot create vf original rule on a vf"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + + # cannot create vf original rule to a vf + self.validate_switch_filter_rule( + rules["cannot create vf original rule to a vf"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + self.create_switch_filter_rule( + rules["cannot create vf original rule to a vf"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + + # cannot create vf original rule to a representor + self.validate_switch_filter_rule( + rules["cannot create vf original rule to a representor"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + self.create_switch_filter_rule( + rules["cannot create vf original rule to a representor"], check_stats=False + ) + self.check_switch_filter_rule_list(0, []) + # unsupported input set self.validate_switch_filter_rule( rules["unsupported input set"], check_stats=False @@ -2607,10 +2698,10 @@ class ICEDCFSwitchFilterTest(TestCase): self.create_switch_filter_rule(rules["void input set value"], check_stats=False) self.check_switch_filter_rule_list(0, []) - # invalid vf id - # self.validate_switch_filter_rule(rules["invalid vf id"], check_stats=False) + # invalid port id + # self.validate_switch_filter_rule(rules["invalid port id"], check_stats=False) # self.check_switch_filter_rule_list(0, []) - self.create_switch_filter_rule(rules["invalid vf id"], check_stats=False) + self.create_switch_filter_rule(rules["invalid port id"], check_stats=False) self.check_switch_filter_rule_list(0, []) # delete non-existing rule -- 2.25.1