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 D1C119192 for ; Fri, 22 Jan 2016 09:46:08 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 22 Jan 2016 00:46:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,330,1449561600"; d="scan'208";a="895950427" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 22 Jan 2016 00:46:07 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id u0M8k5Wb003096; Fri, 22 Jan 2016 16:46:05 +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 u0M8k3tL012833; Fri, 22 Jan 2016 16:46:05 +0800 Received: (from jingguox@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id u0M8k3SG012829; Fri, 22 Jan 2016 16:46:03 +0800 From: Jingguo Fu To: dts@dpdk.org Date: Fri, 22 Jan 2016 16:45:56 +0800 Message-Id: <1453452356-12785-3-git-send-email-jingguox.fu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1453452356-12785-1-git-send-email-jingguox.fu@intel.com> References: <1453452356-12785-1-git-send-email-jingguox.fu@intel.com> Cc: Jingguo Fu Subject: [dts] [DTS][PATCH V2 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: Fri, 22 Jan 2016 08:46:09 -0000 1. fix get rx stat function 2. add stream 3. update notice info 4. "RecvPackets" ==> "Injection", 5. "SendPackets" ==> "Throughput" modified: tests/TestSuite_vhost_cuse_one_copy_one_vm.py tests/TestSuite_vhost_user_one_copy_one_vm.py Signed-off-by: Jingguo Fu --- tests/TestSuite_vhost_cuse_one_copy_one_vm.py | 36 ++++++++++++++++----------- tests/TestSuite_vhost_user_one_copy_one_vm.py | 36 +++++++++++++++++---------- 2 files changed, 45 insertions(+), 27 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..007ac37 100644 --- a/tests/TestSuite_vhost_cuse_one_copy_one_vm.py +++ b/tests/TestSuite_vhost_cuse_one_copy_one_vm.py @@ -116,7 +116,7 @@ class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): self.virtio_cmd_params = \ 'csum=off,gso=off,guest_csum=off,guest_tso4=off,guest_tso6=off,guest_ecn=off' # Define the table columns - self.header_row = ["FrameSize(B)", "RecvPackets(Mpps)", "SendPackets(Mpps)", "LineRate(%)"] + self.header_row = ["FrameSize(B)", "Injection(Mpps)", "Throughput(Mpps)", "LineRate(%)"] self.memory_channel = 4 def set_up(self): @@ -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..7352a35 100644 --- a/tests/TestSuite_vhost_user_one_copy_one_vm.py +++ b/tests/TestSuite_vhost_user_one_copy_one_vm.py @@ -108,7 +108,7 @@ class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): self.dst2 = "192.168.4.1" self.vm_dut = None - self.header_row = ["FrameSize(B)", "RecvPackets(Mpps)", "SendPackets(Mpps)", "LineRate(%)"] + self.header_row = ["FrameSize(B)", "Injection(Mpps)", "Throughput(Mpps)", "LineRate(%)"] self.memory_channel = 4 def set_up(self): @@ -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