From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C5815E72 for ; Wed, 8 Jul 2015 11:26:03 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 08 Jul 2015 02:26:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,431,1432623600"; d="scan'208";a="520711888" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 08 Jul 2015 02:26:03 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t689PvCK017379; Wed, 8 Jul 2015 17:25:57 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t689Ptv8031888; Wed, 8 Jul 2015 17:25:57 +0800 Received: (from dayuqiu@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t689Ptdd031884; Wed, 8 Jul 2015 17:25:55 +0800 From: Michael Qiu To: dts@dpdk.org Date: Wed, 8 Jul 2015 16:51:05 +0800 Message-Id: <1436345466-31613-3-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1436345466-31613-1-git-send-email-michael.qiu@intel.com> References: <1436261880-22395-1-git-send-email-michael.qiu@intel.com> <1436345466-31613-1-git-send-email-michael.qiu@intel.com> Subject: [dts] [PATCH 2/3 v2] tests: Add RRC support in suite scatter 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: Wed, 08 Jul 2015 09:26:04 -0000 Add RRC support in suite scatter Signed-off-by: Michael Qiu --- v2 --> v1: mv nic tpye to setup function tests/TestSuite_scatter.py | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tests/TestSuite_scatter.py b/tests/TestSuite_scatter.py index 643fe4a..abb1a08 100644 --- a/tests/TestSuite_scatter.py +++ b/tests/TestSuite_scatter.py @@ -55,6 +55,10 @@ class TestScatter(TestCase): # Verify that enough ports are available self.verify(len(dutPorts) >= 2, "Insufficient ports") self.pmdout = PmdOutput(self.dut) + if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single", "redrockcanyou"]: + self.mbsize = 2048 + else: + self.mbsize = 1024 def scatter_pktgen_send_packet(self, sPortid, rPortid, pktsize, num=1): """ @@ -62,12 +66,12 @@ class TestScatter(TestCase): """ sport = self.tester.get_local_port(sPortid) sintf = self.tester.get_interface(sport) - smac = self.dut.get_mac_address(sPortid) + smac = self.tester.get_mac(sport) + dmac = self.dut.get_mac_address(sPortid) rport = self.tester.get_local_port(rPortid) rintf = self.tester.get_interface(rport) - if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]: - self.tester.send_expect("ifconfig %s mtu 9000" % sintf, "#") - self.tester.send_expect("ifconfig %s mtu 9000" % rintf, "#") + self.tester.send_expect("ifconfig %s mtu 9000" % sintf, "#") + self.tester.send_expect("ifconfig %s mtu 9000" % rintf, "#") self.tester.scapy_background() self.tester.scapy_append( @@ -79,12 +83,11 @@ class TestScatter(TestCase): self.tester.scapy_foreground() self.tester.scapy_append( - 'sendp([Ether(dst="%s")/IP(len=%s)/Raw(load="\x50"*%s)], iface="%s")' % (smac, pktlen, padding, sintf)) + 'sendp([Ether(src="%s",dst="%s")/IP(len=%s)/Raw(load="\x50"*%s)], iface="%s")' % (smac, dmac,pktlen, padding, sintf)) self.tester.scapy_execute() res = self.tester.scapy_get_result() - if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]: - self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#") - self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#") + self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#") + self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#") return res def set_up(self): @@ -103,25 +106,16 @@ class TestScatter(TestCase): portMask = dts.create_mask(dutPorts[:2]) # set the mbuf size to 1024 - if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]: - out = self.pmdout.start_testpmd( - "1S/2C/2T", "--mbcache=200 --mbuf-size=2048 --portmask=%s --max-pkt-len=9000" % portMask) - else: - out = self.pmdout.start_testpmd( - "1S/2C/2T", "--mbcache=200 --mbuf-size=1024 --portmask=%s" % portMask) + out = self.pmdout.start_testpmd( + "1S/2C/2T", "--mbcache=200 --mbuf-size=%d --portmask=%s --max-pkt-len=9000" % (self.mbsize, portMask)) self.verify("Error" not in out, "launch error 1") - if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]: - self.dut.send_expect("set fwd mac", "testpmd> ", 120) + self.dut.send_expect("set fwd mac", "testpmd> ", 120) self.dut.send_expect("start", "testpmd> ") for offset in [-1, 0, 1, 4, 5]: - if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]: - ret = self.scatter_pktgen_send_packet( - dutPorts[0], dutPorts[1], 2048 + offset) - else: - ret = self.scatter_pktgen_send_packet( - dutPorts[0], dutPorts[1], 1024 + offset) + ret = self.scatter_pktgen_send_packet( + dutPorts[0], dutPorts[1], self.mbsize + offset) self.verify("load='P" in ret, "packet receive error") self.dut.send_expect("stop", "testpmd> ") -- 1.9.3