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 A1CF1A04A2; Wed, 6 Nov 2019 09:02:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7121D1C025; Wed, 6 Nov 2019 09:02:32 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 6322A1C01E for ; Wed, 6 Nov 2019 09:02:30 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 00:02:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,274,1569308400"; d="scan'208";a="232775709" Received: from ubuntu.sh.intel.com ([10.239.250.27]) by fmsmga002.fm.intel.com with ESMTP; 06 Nov 2019 00:02:28 -0800 From: Peng Zhihong To: dts@dpdk.org Cc: Peng Zhihong Date: Wed, 6 Nov 2019 15:54:30 +0800 Message-Id: <20191106075430.15566-1-zhihongx.peng@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit. 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" An abnormal exit needs to execute the same command as a normal exit. Signed-off-by: Peng Zhihong --- tests/TestSuite_kernelpf_iavf.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index 668eb28..89c22d3 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -47,6 +47,7 @@ from pmd_output import PmdOutput from settings import HEADER_SIZE from packet import Packet from utils import RED +from exception import VerifyFailure VM_CORES_MASK = 'all' MAX_VLAN = 4095 @@ -336,18 +337,27 @@ class TestKernelpfIavf(TestCase): self.vm_testpmd.execute_cmd("start") self.send_random_pkt(self.vf_mac, count=1) out = self.vm_dut.get_session_output() - self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac') + if self.vf_mac not in out: + self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ") + raise VerifyFailure('allmulti all off vf receive pkt fail with current mac') self.send_random_pkt(multicast_mac, count=1) out = self.vm_dut.get_session_output() - self.verify(multicast_mac not in out, 'vf receive pkt with multicast mac') + if multicast_mac in out: + self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ") + raise VerifyFailure('allmulti all off vf receive pkt with multicast mac') self.vm_testpmd.execute_cmd("set allmulti all on") self.send_random_pkt(self.vf_mac, count=1) out = self.vm_dut.get_session_output() - self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac') + if self.vf_mac not in out: + self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ") + raise VerifyFailure('allmulti all on vf receive pkt fail with current mac') self.send_random_pkt(multicast_mac, count=1) out = self.vm_dut.get_session_output() - self.verify(multicast_mac in out, 'vf receive pkt fail with multicast mac') + if multicast_mac not in out: + self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ") + raise VerifyFailure('allmulti all on vf receive pkt fail with multicast mac') + self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ") def test_vf_broadcast(self): -- 2.17.1