From patchwork Mon Sep 5 14:48:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 115942 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 265ABA0551; Mon, 5 Sep 2022 16:48:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20BC44069C; Mon, 5 Sep 2022 16:48:44 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id C5AA840041 for ; Mon, 5 Sep 2022 16:48:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662389322; x=1693925322; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jRSQycqzjO2jOQNHh9Bp76VlLQ6mSn/kanBpIwRmisQ=; b=KxtlCx02fd27lZXSnM6y0/mXkGw2bDgaItGkN30x1tFsdwN+mq0AnJVM KtppcC9Mk5LJz0cWXIHyOJ/HKV2+M+9eJh+ZT+3mZ7KTRPZ+Dnb9kxu7J IRxeR7QEAlA4/NRv9ITaNkYjI8RN7dlkST8wn4wJEWb4tK06XdF/q9N8S wR+6iny8eKwoHXZVyKyBNqEsLqAOHbC4cJU59jIy2NgC0cSAS2vFRBiNC FwDHgfp+VizGailgOTOScqo71HKIWOObjkph/xvtEe5DVg5Fu5bdJKbsZ 7Vajg0MjKomlJq8Nw5WwXHPWiW1uv2Ij9xu8VhjAn28Q+TG9WbelghK5C A==; X-IronPort-AV: E=McAfee;i="6500,9779,10461"; a="382701679" X-IronPort-AV: E=Sophos;i="5.93,291,1654585200"; d="scan'208";a="382701679" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 07:48:41 -0700 X-IronPort-AV: E=Sophos;i="5.93,291,1654585200"; d="scan'208";a="643832338" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 07:48:39 -0700 From: Weiyuan Li To: dts@dpdk.org, qi.fu@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V3 2/3] tests/vlan: modify script to match the test plan Date: Mon, 5 Sep 2022 22:48:51 +0800 Message-Id: <20220905144852.5158-2-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220905144852.5158-1-weiyuanx.li@intel.com> References: <20220905144852.5158-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 Modify script use tx_first to send pkts match the test plan. Signed-off-by: Weiyuan Li --- tests/TestSuite_vlan.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py index b2889ae2..27e9a30c 100644 --- a/tests/TestSuite_vlan.py +++ b/tests/TestSuite_vlan.py @@ -31,6 +31,10 @@ class TestVlan(TestCase): # Based on h/w type, choose how many ports to use ports = self.dut.get_ports() + self.dut_ports = self.dut.get_ports(self.nic) + self.used_dut_port_0 = self.dut_ports[0] + self.tester_intf_0 = self.tester.get_interface(self.used_dut_port_0) + # Verify that enough ports are available self.verify(len(ports) >= 1, "Insufficient ports") @@ -159,11 +163,19 @@ class TestVlan(TestCase): ) self.dut.send_expect("port start all", "testpmd> ") - self.dut.send_expect("start", "testpmd> ") - self.vlan_send_packet(-1) - - out = self.get_tcpdump_package() - self.verify(self.vlan in out, "Vlan not found:" + str(out)) + filter = [{"layer": "ether", "config": {"dst": "not ff:ff:ff:ff:ff:ff"}}] + inst = self.tester.tcpdump_sniff_packets( + intf=self.tester_intf_0, + filters=filter, + ) + self.dut.send_expect("set nbport 1", "testpmd> ") + self.dut.send_expect("start tx_first", "testpmd> ") + pkts = self.tester.load_tcpdump_sniff_packets(inst) + self.verify(len(pkts) > 0, f"no packets received.") + self.verify( + self.vlan == pkts[0].vlan, + f"Vlan id {self.vlan} is not found in the packet.", + ) self.dut.send_expect("stop", "testpmd> ") self.dut.send_expect("port stop all", "testpmd> ") self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd> ", 30)