test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests/vhost_user_live_migration: Optimize for multi-platform.
@ 2018-01-05 10:29 Phil Yang
  2018-01-09  6:14 ` [dts] [PATCH v2] " Phil Yang
  2018-01-09 13:10 ` [dts] [PATCH] " Liu, Yong
  0 siblings, 2 replies; 6+ messages in thread
From: Phil Yang @ 2018-01-05 10:29 UTC (permalink / raw)
  To: dts; +Cc: nd, phil.yang, yong.liu

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..75e7ca4 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")
+
+        dirct_pat = re.compile(r"(\s+)\[ (\S+) in\|out\|inout \]")
+        vm_dut.send_expect("tcpdump -h", "# ")
+        out = vm_dut.get_session_output(timeout=1)
+        m = dirct_pat.search(out)
+        if m:
+            dirct_para = "-" + m.group(2)[1] + " in"
+        else:
+            dirct_para = ""
+
+        vm_dut.send_expect("tcpdump -i %s %s -v" % (vm_intf, dirct_para), "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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dts] [PATCH v2] tests/vhost_user_live_migration: Optimize for multi-platform.
  2018-01-05 10:29 [dts] [PATCH] tests/vhost_user_live_migration: Optimize for multi-platform Phil Yang
@ 2018-01-09  6:14 ` Phil Yang
  2018-01-09 14:32   ` Liu, Yong
  2018-01-09 13:10 ` [dts] [PATCH] " Liu, Yong
  1 sibling, 1 reply; 6+ messages in thread
From: Phil Yang @ 2018-01-09  6:14 UTC (permalink / raw)
  To: dts; +Cc: nd, yong.liu, phil.yang

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dts] [PATCH] tests/vhost_user_live_migration: Optimize for multi-platform.
  2018-01-09 13:10 ` [dts] [PATCH] " Liu, Yong
@ 2018-01-09  6:15   ` Phil Yang
  2018-01-09  6:43     ` Liu, Yong
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Yang @ 2018-01-09  6:15 UTC (permalink / raw)
  To: Liu, Yong, dts; +Cc: nd

Hi Marvin

Thanks for your comments. Updated.

Thanks,
Phil Yang

> -----Original Message-----
> From: Liu, Yong [mailto:yong.liu@intel.com]
> Sent: Tuesday, January 9, 2018 9:10 PM
> To: Phil Yang <Phil.Yang@arm.com>; dts@dpdk.org
> Cc: nd <nd@arm.com>
> Subject: Re: [PATCH] tests/vhost_user_live_migration: Optimize for multi-
> platform.
> 
> Phil,
> There's one comment as below.
> 
> On 01/05/2018 06:29 PM, Phil Yang wrote:
> > +
> > +        dirct_pat = re.compile(r"(\s+)\[ (\S+) in\|out\|inout \]")
> > +        vm_dut.send_expect("tcpdump -h", "# ")
> > +        out = vm_dut.get_session_output(timeout=1)
> > +        m = dirct_pat.search(out)
> > +        if m:
> > +            dirct_para = "-" + m.group(2)[1] + " in"
> > +        else:
> > +            dirct_para = ""
> > +
> 
> Please change variable name to more meaning full name "direct_param".
> 
> Thanks,
> Marvin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dts] [PATCH] tests/vhost_user_live_migration: Optimize for multi-platform.
  2018-01-09  6:15   ` Phil Yang
@ 2018-01-09  6:43     ` Liu, Yong
  0 siblings, 0 replies; 6+ messages in thread
From: Liu, Yong @ 2018-01-09  6:43 UTC (permalink / raw)
  To: Phil Yang, dts; +Cc: nd

You're welcome, Phil.

> -----Original Message-----
> From: Phil Yang [mailto:Phil.Yang@arm.com]
> Sent: Tuesday, January 09, 2018 2:16 PM
> To: Liu, Yong <yong.liu@intel.com>; dts@dpdk.org
> Cc: nd <nd@arm.com>
> Subject: RE: [PATCH] tests/vhost_user_live_migration: Optimize for multi-
> platform.
> 
> Hi Marvin
> 
> Thanks for your comments. Updated.
> 
> Thanks,
> Phil Yang
> 
> > -----Original Message-----
> > From: Liu, Yong [mailto:yong.liu@intel.com]
> > Sent: Tuesday, January 9, 2018 9:10 PM
> > To: Phil Yang <Phil.Yang@arm.com>; dts@dpdk.org
> > Cc: nd <nd@arm.com>
> > Subject: Re: [PATCH] tests/vhost_user_live_migration: Optimize for
> multi-
> > platform.
> >
> > Phil,
> > There's one comment as below.
> >
> > On 01/05/2018 06:29 PM, Phil Yang wrote:
> > > +
> > > +        dirct_pat = re.compile(r"(\s+)\[ (\S+) in\|out\|inout \]")
> > > +        vm_dut.send_expect("tcpdump -h", "# ")
> > > +        out = vm_dut.get_session_output(timeout=1)
> > > +        m = dirct_pat.search(out)
> > > +        if m:
> > > +            dirct_para = "-" + m.group(2)[1] + " in"
> > > +        else:
> > > +            dirct_para = ""
> > > +
> >
> > Please change variable name to more meaning full name "direct_param".
> >
> > Thanks,
> > Marvin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dts] [PATCH] tests/vhost_user_live_migration: Optimize for multi-platform.
  2018-01-05 10:29 [dts] [PATCH] tests/vhost_user_live_migration: Optimize for multi-platform Phil Yang
  2018-01-09  6:14 ` [dts] [PATCH v2] " Phil Yang
@ 2018-01-09 13:10 ` Liu, Yong
  2018-01-09  6:15   ` Phil Yang
  1 sibling, 1 reply; 6+ messages in thread
From: Liu, Yong @ 2018-01-09 13:10 UTC (permalink / raw)
  To: Phil Yang, dts; +Cc: nd

Phil,
There's one comment as below.

On 01/05/2018 06:29 PM, Phil Yang wrote:
> +
> +        dirct_pat = re.compile(r"(\s+)\[ (\S+) in\|out\|inout \]")
> +        vm_dut.send_expect("tcpdump -h", "# ")
> +        out = vm_dut.get_session_output(timeout=1)
> +        m = dirct_pat.search(out)
> +        if m:
> +            dirct_para = "-" + m.group(2)[1] + " in"
> +        else:
> +            dirct_para = ""
> +

Please change variable name to more meaning full name "direct_param".

Thanks,
Marvin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dts] [PATCH v2] tests/vhost_user_live_migration: Optimize for multi-platform.
  2018-01-09  6:14 ` [dts] [PATCH v2] " Phil Yang
@ 2018-01-09 14:32   ` Liu, Yong
  0 siblings, 0 replies; 6+ messages in thread
From: Liu, Yong @ 2018-01-09 14:32 UTC (permalink / raw)
  To: Phil Yang, dts; +Cc: nd

Thanks Phil. Applied.

On 01/09/2018 02:14 PM, Phil Yang wrote:
> 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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-09  6:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05 10:29 [dts] [PATCH] tests/vhost_user_live_migration: Optimize for multi-platform Phil Yang
2018-01-09  6:14 ` [dts] [PATCH v2] " Phil Yang
2018-01-09 14:32   ` 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

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).