test suite reviews and discussions
 help / color / mirror / Atom feed
From: Phil Yang <phil.yang@arm.com>
To: dts@dpdk.org
Cc: nd@arm.com, yong.liu@intel.com, phil.yang@arm.com
Subject: [dts] [PATCH v2] tests/vhost_user_live_migration: Optimize for multi-platform.
Date: Tue,  9 Jan 2018 14:14:47 +0800	[thread overview]
Message-ID: <1515478487-5446-1-git-send-email-phil.yang@arm.com> (raw)
In-Reply-To: <1515148140-28422-1-git-send-email-phil.yang@arm.com>

1. Optimize for multi platform;
2. Setting a longer timeout for vm communication to avoid unexpected error.
3. Support multi version of tcpdump direction parameter(-Q or -P).

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 tests/TestSuite_vhost_user_live_migration.py | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_vhost_user_live_migration.py b/tests/TestSuite_vhost_user_live_migration.py
index 3f64244..9bd3237 100644
--- a/tests/TestSuite_vhost_user_live_migration.py
+++ b/tests/TestSuite_vhost_user_live_migration.py
@@ -32,11 +32,10 @@ class TestVhostUserLiveMigration(TestCase):
         self.backup_tport = self.tester.get_local_port_bydut(self.backup_port, self.backup_dutip)
         self.backup_tintf = self.tester.get_interface(self.backup_tport)
 
-        # Use testpmd as vhost-user application on host/backup server 
-        self.vhost = "./x86_64-native-linuxapp-gcc/app/testpmd"
+        # Use testpmd as vhost-user application on host/backup server
+        self.vhost = "./%s/app/testpmd" % self.target
         self.vm_testpmd = "./%s/app/testpmd -c 0x3 -n 4 -- -i" % self.target
         self.virio_mac = "52:54:00:00:00:01"
-        
 
         # flag for environment
         self.env_done = False
@@ -222,7 +221,17 @@ class TestVhostUserLiveMigration(TestCase):
         vm_intf = vm_dut.ports_info[0]['port'].get_interface_name()
         # start tcpdump the interface
         vm_dut.send_expect("ifconfig %s up" % vm_intf, "# ")
-        vm_dut.send_expect("tcpdump -i %s -P in -v" % vm_intf, "listening on")
+
+        direct_pat = re.compile(r"(\s+)\[ (\S+) in\|out\|inout \]")
+        vm_dut.send_expect("tcpdump -h", "# ")
+        out = vm_dut.get_session_output(timeout=1)
+        m = direct_pat.search(out)
+        if m:
+            direct_param = "-" + m.group(2)[1] + " in"
+        else:
+            direct_param = ""
+
+        vm_dut.send_expect("tcpdump -i %s %s -v" % (vm_intf, direct_param), "listening on", 120)
         # wait for promisc on
         time.sleep(3)
         # send packets from tester
@@ -277,17 +286,17 @@ class TestVhostUserLiveMigration(TestCase):
         # start testpmd on host vm
         base_dir = self.vm_host.base_dir.replace('~', '/root')
         self.host_serial.send_expect('cd %s' % base_dir, "# ")
-        self.host_serial.send_expect(self.vm_testpmd, "testpmd> ")
+        self.host_serial.send_expect(self.vm_testpmd, "testpmd> ", 120)
 
         # verify testpmd receive packets
         self.verify_dpdk(self.host_tport, self.host_serial)
 
         self.logger.info("Migrate host VM to backup host")
         # start live migration
-        
+
         ret = self.host_vm.start_migration(self.backup_dutip, self.backup_vm.migrate_port)
         self.verify(ret, "Failed to migration, please check VM and qemu version")
-       
+
         # make sure still can receive packets in migration process
         self.verify_dpdk(self.host_tport, self.host_serial)
 
-- 
2.7.4

  reply	other threads:[~2018-01-09  6:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05 10:29 [dts] [PATCH] " Phil Yang
2018-01-09  6:14 ` Phil Yang [this message]
2018-01-09 14:32   ` [dts] [PATCH v2] " Liu, Yong
2018-01-09 13:10 ` [dts] [PATCH] " Liu, Yong
2018-01-09  6:15   ` Phil Yang
2018-01-09  6:43     ` Liu, Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515478487-5446-1-git-send-email-phil.yang@arm.com \
    --to=phil.yang@arm.com \
    --cc=dts@dpdk.org \
    --cc=nd@arm.com \
    --cc=yong.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).