From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id E8BA07CFC for ; Fri, 25 Aug 2017 09:10:23 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Aug 2017 00:10:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,424,1498546800"; d="scan'208";a="1188007868" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by fmsmga001.fm.intel.com with ESMTP; 25 Aug 2017 00:10:20 -0700 From: "xu,huilong" To: dts@dpdk.org Cc: "xu,huilong" Date: Fri, 25 Aug 2017 15:11:35 +0800 Message-Id: <1503645095-90269-1-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] fix link status interrupt failed 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: , X-List-Received-Date: Fri, 25 Aug 2017 07:10:24 -0000 update list: 1. update fortville nic test interrupt mode list 2. fix example setup failed 3. fix check port stats in example 4. fix check rx/tx packet get count number error Signed-off-by: xu,huilong --- tests/TestSuite_link_status_interrupt.py | 34 +++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tests/TestSuite_link_status_interrupt.py b/tests/TestSuite_link_status_interrupt.py index ae205cc..2249cf1 100644 --- a/tests/TestSuite_link_status_interrupt.py +++ b/tests/TestSuite_link_status_interrupt.py @@ -61,6 +61,15 @@ class TestLinkStatusInterrupt(TestCase): out = self.dut.build_dpdk_apps("./examples/link_status_interrupt") self.verify("Error" not in out, "compilation error 1") self.verify("No such file" not in out, "compilation error 2") + # fortville NIC not support legacy intr mode + if self.nic in ["fortville_eagle", "fortville_spirit", + "fortville_spirt_single", "fortville_25g"]: + self.basic_intr_mode = ["msix"] + else: + self.basic_intr_mode = ["msix", "legacy"] + # vfio support msi intr mode + if self.drivername == "vfio-pci": + self.basic_intr_mode.append("msi") def set_link_status_and_verify(self, dutPort, status): """ @@ -71,7 +80,9 @@ class TestLinkStatusInterrupt(TestCase): self.tester.send_expect("ifconfig %s %s" % (self.intf, status.lower()), "# ", 10) verify_point = "Port %s Link %s" % (dutPort, status) - self.dut.send_expect("", verify_point, 60) + + out = self.dut.get_session_output(timeout=60) + self.verify(verify_point in out,"link status update error") def set_up(self): """ @@ -86,20 +97,23 @@ class TestLinkStatusInterrupt(TestCase): if self.drivername == "igb_uio": cmdline = self.path + " -c %s -n %s -- -p %s " % ( self.coremask, self.dut.get_memory_channels(), self.portmask) - for mode in ["legacy", "msix"]: + for mode in self.basic_intr_mode: self.dut.send_expect("rmmod -f igb_uio", "#", 20) self.dut.send_expect( 'insmod %s/kmod/igb_uio.ko "intr_mode=%s"' % (self.target, mode), "# ") self.dut.bind_interfaces_linux() - self.dut.send_expect(cmdline, "Aggregate statistics", 60) + self.dut.send_expect(cmdline, "", 180) + out = self.dut.get_session_output(timeout=60) + self.verify("Port statistics" in out, "setup example error") + time.sleep(10) self.set_link_status_and_verify(self.dut_ports[0], 'Down') self.set_link_status_and_verify(self.dut_ports[0], 'Up') self.dut.send_expect("^C", "#", 60) elif self.drivername == "vfio-pci": - for mode in ["legacy", "msi", "msix"]: + for mode in self.basic_intr_mode : cmdline = self.path + " -c %s -n %s --vfio-intr=%s -- -p %s" % ( self.coremask, self.dut.get_memory_channels(), mode, self.portmask) - self.dut.send_expect(cmdline, "Aggregate statistics", 60) + self.dut.send_expect(cmdline, "statistics statistics", 120) self.set_link_status_and_verify(self.dut_ports[0], 'Down') self.set_link_status_and_verify(self.dut_ports[0], 'Up') self.dut.send_expect("^C", "#", 60) @@ -112,7 +126,7 @@ class TestLinkStatusInterrupt(TestCase): if self.drivername == "igb_uio": cmdline = self.path + " -c %s -n %s -- -p %s " % ( self.coremask, self.dut.get_memory_channels(), self.portmask) - for mode in ["legacy", "msix"]: + for mode in self.basic_intr_mode: self.dut.send_expect("rmmod -f igb_uio", "#", 20) self.dut.send_expect( 'insmod %s/kmod/igb_uio.ko "intr_mode=%s"' % (self.target, mode), "# ") @@ -129,11 +143,12 @@ class TestLinkStatusInterrupt(TestCase): pkt_send = re.findall("Total packets sent:\s*(\d*)", out) pkt_received = re.findall( "Total packets received:\s*(\d*)", out) - self.verify(pkt_send == pkt_received == '1', + # example will print rx/tx packet info by loop so only check last one + self.verify(pkt_send[-1] == pkt_received[-1] == '1', "Error: sent packets != received packets") self.dut.send_expect("^C", "#", 60) elif self.drivername == "vfio-pci": - for mode in ["legacy", "msi", "msix"]: + for mode in self.basic_intr_mode: cmdline = self.path + " -c %s -n %s --vfio-intr=%s -- -p %s" % ( self.coremask, self.dut.get_memory_channels(), mode, self.portmask) self.dut.send_expect(cmdline, "Aggregate statistics", 60) @@ -148,7 +163,8 @@ class TestLinkStatusInterrupt(TestCase): pkt_send = re.findall("Total packets sent:\s*(\d*)", out) pkt_received = re.findall( "Total packets received:\s*(\d*)", out) - self.verify(pkt_send == pkt_received == '1', + # example will print rx/tx packet info by loop so only check last one + self.verify(pkt_send[-1] == pkt_received[-1] == '1', "Error: sent packets != received packets") self.dut.send_expect("^C", "#", 60) -- 1.9.3