From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id BEDB98E7F for ; Thu, 21 Jan 2016 07:43:04 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 20 Jan 2016 22:43:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,324,1449561600"; d="scan'208";a="731530177" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 20 Jan 2016 22:43:03 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id u0L6h0Q1003630; Thu, 21 Jan 2016 14:43:00 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u0L6gwkI030358; Thu, 21 Jan 2016 14:43:00 +0800 Received: (from jingguox@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id u0L6gw78030354; Thu, 21 Jan 2016 14:42:58 +0800 From: Jingguo Fu To: dts@dpdk.org Date: Thu, 21 Jan 2016 14:42:52 +0800 Message-Id: <1453358572-30310-3-git-send-email-jingguox.fu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1453358572-30310-1-git-send-email-jingguox.fu@intel.com> References: <1453358572-30310-1-git-send-email-jingguox.fu@intel.com> Cc: Jingguo Fu Subject: [dts] [DTS][PATCH 3/3] virtio: update vhost cuse and user one vm cases 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: Thu, 21 Jan 2016 06:43:05 -0000 1. fix get rx stat function 2. add stream 3. update notice info Signed-off-by: Jingguo Fu --- tests/TestSuite_vhost_cuse_one_copy_one_vm.py | 34 +++++++++++++++++---------- tests/TestSuite_vhost_user_one_copy_one_vm.py | 34 +++++++++++++++++---------- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/tests/TestSuite_vhost_cuse_one_copy_one_vm.py b/tests/TestSuite_vhost_cuse_one_copy_one_vm.py index bff5760..22d531c 100644 --- a/tests/TestSuite_vhost_cuse_one_copy_one_vm.py +++ b/tests/TestSuite_vhost_cuse_one_copy_one_vm.py @@ -162,13 +162,15 @@ class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): self.dut.send_expect(self.vhostapp_testcmd, "# ", 40) time.sleep(30) try: - print "Launch vhost sample\n" + print "Launch vhost sample:" self.dut.session.copy_file_from("/root/dpdk/vhost.out") fp = open('./vhost.out', 'r') out = fp.read() fp.close() if "Error" in out: raise Exception("Launch vhost sample failed") + else: + print "Launch vhost sample finished" except Exception as e: print dts.RED("Failed to launch vhost sample: %s" % str(e)) @@ -252,8 +254,8 @@ class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): self.virtio1 = intf if self.virtio2_mac in out_mac: self.virtio2 = intf - print "\nvirtio1's intf is %s" % self.virtio1 - print "\nvirtio2's intf is %s" % self.virtio2 + print "Virtio1's intf is %s" % self.virtio1 + print "Virtio2's intf is %s" % self.virtio2 # Set the MTU for jumboframe enabled case if self.jumbo == 1: self.vm_dut.send_expect( @@ -309,22 +311,29 @@ class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): recvbpsRate += int(out.strip()) self.logger.info("Port %s: RX %f Mbps" % (port, (recvbpsRate * 1.0 / 1000000))) + self.hook_transmissoin_func() + self.send_expect("ixStopTransmit portList", "%", 30) + return (txRate,recvRate) - def send_verify(self, case, frame_sizes, vlan_id1=0): + def send_verify(self, case, frame_sizes, vlan_id1=0, vlan_id2=0): dts.results_table_add_header(self.header_row) for frame_size in frame_sizes: - info = "Running test %s, and %d frame size.\n" % (case, frame_size) + info = "Running test %s, and %d frame size." % (case, frame_size) self.logger.info(info) payload = frame_size - HEADER_SIZE['eth'] - HEADER_SIZE['ip'] - flow = '[Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="%s",dst="%s")/("X"*%d)]' % ( + flow1 = '[Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="%s",dst="%s")/("X"*%d)]' % ( self.virtio1_mac, vlan_id1, self.src1, self.dst1, payload) - self.tester.scapy_append('wrpcap("flow.pcap", %s)' % flow) + flow2 = '[Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="%s",dst="%s")/("X"*%d)]' % ( + self.virtio2_mac, vlan_id2, self.src2, self.dst2, payload) + self.tester.scapy_append('wrpcap("flow1.pcap", %s)' % flow1) + self.tester.scapy_append('wrpcap("flow2.pcap", %s)' % flow2) self.tester.scapy_execute() tgenInput = [] port = self.tester.get_local_port(self.pf) - tgenInput.append((port, port, "flow.pcap")) + tgenInput.append((port, port, "flow1.pcap")) + tgenInput.append((port, port, "flow2.pcap")) recvpkt, sendpkt = self.tester.traffic_generator_throughput( tgenInput, delay=15) @@ -353,7 +362,7 @@ class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): out = fp.read() fp.close() # Get the VLAN ID for virtio - print "Check the vlan info: \n" + print "Check the vlan info: " l1 = re.findall( 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % (str(self.virtio1_mac)), out) @@ -367,7 +376,7 @@ class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): vlan_id2 = l2[0] print "vlan_id2 is ", vlan_id2 - self.send_verify(self.running_case, self.frame_sizes, vlan_id1) + self.send_verify(self.running_case, self.frame_sizes, vlan_id1, vlan_id2) # Stop the Vhost sample self.dut.send_expect("killall -s INT vhost-switch", "#", 20) @@ -386,7 +395,7 @@ class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): out = fp.read() fp.close() # Get the VLAN ID for virtio - print "\ncheck the vlan info: \n" + print "Check the vlan info: " l1 = re.findall( 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % (str(self.virtio1_mac)), out) @@ -400,8 +409,7 @@ class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): vlan_id2 = l2[0] print vlan_id2 - self.send_verify(self.running_case, self.frame_sizes, vlan_id1) - + self.send_verify(self.running_case, self.frame_sizes, vlan_id1, vlan_id2) # Stop testpmd self.vm_dut.send_expect("stop", "testpmd>") time.sleep(1) diff --git a/tests/TestSuite_vhost_user_one_copy_one_vm.py b/tests/TestSuite_vhost_user_one_copy_one_vm.py index 971d9c2..e06d8e9 100644 --- a/tests/TestSuite_vhost_user_one_copy_one_vm.py +++ b/tests/TestSuite_vhost_user_one_copy_one_vm.py @@ -145,13 +145,15 @@ class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): self.dut.send_expect(self.vhostapp_testcmd, "# ", 40) time.sleep(30) try: - print "Launch vhost sample\n" + print "Launch vhost sample:" self.dut.session.copy_file_from("/root/dpdk/vhost.out") fp = open('./vhost.out', 'r') out = fp.read() fp.close() if "Error" in out: raise Exception("Launch vhost sample failed") + else: + print "Launch vhost sample finished" except Exception as e: print dts.RED("Failed to launch vhost sample: %s" % str(e)) @@ -234,8 +236,8 @@ class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): self.virtio1 = intf if self.virtio2_mac in out_mac: self.virtio2 = intf - print "\nvirtio1's intf is %s" % self.virtio1 - print "\nvirtio2's intf is %s" % self.virtio2 + print "Virtio1's intf is %s" % self.virtio1 + print "Virtio2's intf is %s" % self.virtio2 # Set the mtu 9000 if jumboframe is enabled. if self.jumbo == 1: self.vm_dut.send_expect( @@ -291,22 +293,29 @@ class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): recvbpsRate += int(out.strip()) self.logger.info("Port %s: RX %f Mbps" % (port, (recvbpsRate * 1.0 / 1000000))) + self.hook_transmissoin_func() + self.send_expect("ixStopTransmit portList", "%", 30) + return (txRate,recvRate) - def send_verify(self, case, frame_sizes, vlan_id1=0): + def send_verify(self, case, frame_sizes, vlan_id1=0, vlan_id2=0): dts.results_table_add_header(self.header_row) for frame_size in frame_sizes: - info = "Running test %s, and %d frame size.\n" % (case, frame_size) + info = "Running test %s, and %d frame size." % (case, frame_size) self.logger.info(info) payload = frame_size - HEADER_SIZE['eth'] - HEADER_SIZE['ip'] - flow = '[Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="%s",dst="%s")/("X"*%d)]' % ( + flow1 = '[Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="%s",dst="%s")/("X"*%d)]' % ( self.virtio1_mac, vlan_id1, self.src1, self.dst1, payload) - self.tester.scapy_append('wrpcap("flow.pcap", %s)' % flow) + flow2 = '[Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="%s",dst="%s")/("X"*%d)]' % ( + self.virtio2_mac, vlan_id2, self.src2, self.dst2, payload) + self.tester.scapy_append('wrpcap("flow1.pcap", %s)' % flow1) + self.tester.scapy_append('wrpcap("flow2.pcap", %s)' % flow2) self.tester.scapy_execute() tgenInput = [] port = self.tester.get_local_port(self.pf) - tgenInput.append((port, port, "flow.pcap")) + tgenInput.append((port, port, "flow1.pcap")) + tgenInput.append((port, port, "flow2.pcap")) recvpkt, sendpkt = self.tester.traffic_generator_throughput( tgenInput, delay=15) @@ -335,7 +344,7 @@ class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): out = fp.read() fp.close() # Get the VLAN ID for virtio - print "Check the vlan info: \n" + print "Check the vlan info: " l1 = re.findall( 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % (str(self.virtio1_mac)), out) @@ -349,7 +358,7 @@ class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): vlan_id2 = l2[0] print "vlan_id2 is ", vlan_id2 - self.send_verify(self.running_case, self.frame_sizes, vlan_id1) + self.send_verify(self.running_case, self.frame_sizes, vlan_id1, vlan_id2) # Stop the Vhost sample self.dut.send_expect("killall -s INT vhost-switch", "#", 20) @@ -368,7 +377,7 @@ class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): out = fp.read() fp.close() # Get the VLAN ID for virtio - print "Check the vlan info: \n" + print "Check the vlan info: " l1 = re.findall( 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % (str(self.virtio1_mac)), out) @@ -381,7 +390,8 @@ class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): if len(l2) > 0: vlan_id2 = l2[0] print vlan_id2 - self.send_verify(self.running_case, self.frame_sizes, vlan_id1) + + self.send_verify(self.running_case, self.frame_sizes, vlan_id1, vlan_id2) # Stop testpmd self.vm_dut.send_expect("stop", "testpmd>") time.sleep(1) -- 2.1.0