From patchwork Wed Jun 1 10:03:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 112209 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6FE2A054F; Wed, 1 Jun 2022 12:03:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70BB2427F9; Wed, 1 Jun 2022 12:03:52 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 4B67740689 for ; Wed, 1 Jun 2022 12:03:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654077830; x=1685613830; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1eA1RCaFnJuQvEypd9ialuau5fyh0g8DsHB2m5ekAWE=; b=PjAZNMRRsKJNmm1einb7fBd41Hu1Nc3QIZsbubGfGHe7f4h+e/AkAHj1 1PpFfZmTwo3+3y6YEKIBTnAUafbMBR7Rd6BCBy50Cemfbowq6FR9tYVJy RVPkqvN+EacEfrdQj4//Bb9TUz11XURh5YH+WMkuYSBfsVHgqARaUrNNI kPLArhxURIB0KunL2r7OraZHfCwM97QUig22CxxoYUgeTx9MWTN1nfvxD pr5UwFpuEkXUwf6wC3D3uU6+52QH+IosBh2QKMSQVR09nHs6JX1iI03IH dmFv+okLL2wUuy6TVECcGCLP8JQwLejeav3T0PxInAeGPs6QfmF83snuz w==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="256015047" X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="256015047" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 03:03:49 -0700 X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="576861745" Received: from shwdenpg560.ccr.corp.intel.com ([10.239.251.200]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 03:03:47 -0700 From: "Li, WeiyuanX" To: dts@dpdk.org, yuan.peng@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V1 2/2] tests/vf_vlan: modify script VLAN filter enable requires a port VLAN is assigned Date: Wed, 1 Jun 2022 18:03:31 +0800 Message-Id: <20220601100331.66-2-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220601100331.66-1-weiyuanx.li@intel.com> References: <20220601100331.66-1-weiyuanx.li@intel.com> MIME-Version: 1.0 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 From: Weiyuan Li Modify script VLAN filter enable requires a port VLAN is assigned. Signed-off-by: Weiyuan Li --- v2: -Add comment restart testpmd after remove VLAN from PF devcie according to test plan modification. -Modify error command 'vx_vlan' to 'rx_vlan'. tests/TestSuite_vf_vlan.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_vf_vlan.py b/tests/TestSuite_vf_vlan.py index e73ad479..2a4fbeae 100644 --- a/tests/TestSuite_vf_vlan.py +++ b/tests/TestSuite_vf_vlan.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2020 Intel Corporation +# Copyright(c) 2022 Intel Corporation # import random @@ -222,14 +222,20 @@ class TestVfVlan(TestCase): # remove vlan self.vm0_testpmd.execute_cmd("stop") - self.vm0_testpmd.execute_cmd("port stop all") + # self.vm0_testpmd.execute_cmd("port stop all") + self.vm0_testpmd.quit() + self.dut.send_expect("ip link set %s vf 0 vlan 0" % self.host_intf0, "# ") out = self.dut.send_expect("ip link show %s" % self.host_intf0, "# ") self.verify("vlan %d" % random_vlan not in out, "Failed to remove pvid on VF0") # send packet with vlan - self.vm0_testpmd.execute_cmd("port reset 0", "testpmd> ", 120) - self.vm0_testpmd.execute_cmd("port start all") + self.vm0_testpmd.start_testpmd("all") + self.vm0_testpmd.execute_cmd("set fwd mac") + self.vm0_testpmd.execute_cmd("set verbose 1") + self.vm0_testpmd.execute_cmd("vlan set filter on 0") + self.vm0_testpmd.execute_cmd("vlan set strip on 0") + self.vm0_testpmd.execute_cmd("rx_vlan add 10 0") self.vm0_testpmd.execute_cmd("start") out = self.send_and_getout(vlan=random_vlan, pkt_type="VLAN_UDP") @@ -305,6 +311,7 @@ class TestVfVlan(TestCase): self.vm0_testpmd.execute_cmd("vlan set strip on 0") self.vm0_testpmd.execute_cmd("vlan set filter on 0") self.vm0_testpmd.execute_cmd("set promisc all off") + self.vm0_testpmd.execute_cmd("rx_vlan add 10 0") self.vm0_testpmd.execute_cmd("start") # send packet without vlan @@ -340,7 +347,7 @@ class TestVfVlan(TestCase): for rx_vlan in rx_vlans: self.vm0_testpmd.execute_cmd("rx_vlan rm %d 0" % rx_vlan) - + self.vm0_testpmd.execute_cmd("rx_vlan add 10 0") # send packet with vlan 0 out = self.send_and_getout(vlan=0, pkt_type="VLAN_UDP") self.verify("VLAN tci=0x0" in out, "Not received vlan 0 packet as default!!!")