test suite reviews and discussions
 help / color / mirror / Atom feed
From: Wei Ling <weix.ling@intel.com>
To: dts@dpdk.org
Cc: Wei Ling <weix.ling@intel.com>
Subject: [dts][PATCH V1] tests/vhost_user_live_migration: add 2 testcase sync with testplan
Date: Fri, 31 Mar 2023 11:36:36 +0800	[thread overview]
Message-ID: <20230331033636.1373154-1-weix.ling@intel.com> (raw)

Add testcase 2 and testcase 6 sync with testplan.

Signed-off-by: Wei Ling <weix.ling@intel.com>
---
 tests/TestSuite_vhost_user_live_migration.py | 56 ++++++++++++++++----
 1 file changed, 46 insertions(+), 10 deletions(-)

diff --git a/tests/TestSuite_vhost_user_live_migration.py b/tests/TestSuite_vhost_user_live_migration.py
index b566374f..d0e2889e 100644
--- a/tests/TestSuite_vhost_user_live_migration.py
+++ b/tests/TestSuite_vhost_user_live_migration.py
@@ -6,7 +6,6 @@ import os.path
 import re
 import time
 
-import framework.utils as utils
 from framework.config import UserConf
 from framework.exception import VirtDutInitException
 from framework.settings import CONFIG_ROOT_PATH
@@ -71,6 +70,10 @@ class TestVhostUserLiveMigration(TestCase):
         self.testpmd_name = self.testpmd_path.split("/")[-1]
 
     def set_up(self):
+        self.duts[0].send_expect("killall -s INT %s" % self.testpmd_name, "#")
+        self.duts[1].send_expect("killall -s INT %s" % self.testpmd_name, "#")
+        self.duts[0].send_expect("killall -s INT qemu-system-x86_64", "#")
+        self.duts[1].send_expect("killall -s INT qemu-system-x86_64", "#")
         self.host_dut.send_expect("rm ./vhost-net*", "# ", 30)
         self.backup_dut.send_expect("rm ./vhost-net*", "# ", 30)
         self.migration_done = False
@@ -337,6 +340,8 @@ class TestVhostUserLiveMigration(TestCase):
         vm_dut.send_expect("screen -S %s" % self.screen_name, "# ", 120)
         # get host interface
         vm_intf = vm_dut.ports_info[0]["port"].get_interface_name()
+        # sometimes return '\rens4', need replace '\r' to ''
+        vm_intf = vm_intf.replace("\r", "")
         # start tcpdump the interface
         vm_dut.send_expect("ifconfig %s up" % vm_intf, "# ")
         direct_pat = re.compile(r"(\s+)\[ (\S+) in\|out\|inout \]")
@@ -394,10 +399,31 @@ class TestVhostUserLiveMigration(TestCase):
         # make sure still can receive packets
         verify_fun(self.vm_dut_backup)
 
+    def test_migrate_with_split_ring_virtio_pmd(self):
+        """
+        Test Case 1: migrate with split ring virtio-pmd
+        """
+        self.queue_number = 1
+        self.launch_testpmd_as_vhost_on_both_dut()
+        self.start_testpmd_with_fwd_mode_on_both_dut()
+        self.setup_vm_env_on_both_dut()
+        self.start_testpmd_on_vm(self.vm_dut_host)
+        self.send_and_verify(self.verify_dpdk)
+
+    def test_migrate_with_split_ring_virtio_pmd_enabled(self):
+        """
+        Test Case 2: migrate with split ring virtio-pmd enabled
+        """
+        self.queue_number = 1
+        self.launch_testpmd_as_vhost_on_both_dut()
+        self.setup_vm_env_on_both_dut()
+        self.start_testpmd_on_vm(self.vm_dut_host)
+        self.start_testpmd_with_fwd_mode_on_both_dut()
+        self.send_and_verify(self.verify_dpdk)
+
     def test_migrate_with_split_ring_virtio_net(self):
         """
-        Verify migrate virtIO device from host to backup host,
-        Verify before/in/after migration, device with kernel driver can receive packets
+        Test Case 3: migrate with split ring virtio-net
         """
         self.queue_number = 1
         self.launch_testpmd_as_vhost_on_both_dut()
@@ -412,6 +438,9 @@ class TestVhostUserLiveMigration(TestCase):
     def test_adjust_split_ring_virtio_net_queue_numbers_while_migreting_with_virtio_net(
         self,
     ):
+        """
+        Test Case 4: adjust split ring virtio-net queue numbers while migrating with virtio-net
+        """
         self.queue_number = 4
         self.launch_testpmd_as_vhost_on_both_dut()
         self.start_testpmd_with_fwd_mode_on_both_dut()
@@ -419,29 +448,33 @@ class TestVhostUserLiveMigration(TestCase):
         # bind virtio-net back to virtio-pci
         self.bind_nic_driver_of_vm(self.vm_dut_host, driver="")
         self.start_tcpdump_on_vm(self.vm_dut_host)
-
         self.send_and_verify(self.verify_kernel, True)
 
-    def test_migrate_with_split_ring_virtio_pmd(self):
+    def test_migrate_with_packed_ring_virtio_pmd(self):
+        """
+        Test Case 5: migrate with packed ring virtio-pmd
+        """
         self.queue_number = 1
         self.launch_testpmd_as_vhost_on_both_dut()
         self.start_testpmd_with_fwd_mode_on_both_dut()
-        self.setup_vm_env_on_both_dut()
+        self.setup_vm_env_on_both_dut(packed=True)
         self.start_testpmd_on_vm(self.vm_dut_host)
         self.send_and_verify(self.verify_dpdk)
 
-    def test_migrate_with_packed_ring_virtio_pmd(self):
+    def test_migrate_with_packed_ring_virtio_pmd_enabled(self):
+        """
+        Test Case 6: migrate with packed ring virtio-pmd enabled
+        """
         self.queue_number = 1
         self.launch_testpmd_as_vhost_on_both_dut()
-        self.start_testpmd_with_fwd_mode_on_both_dut()
         self.setup_vm_env_on_both_dut(packed=True)
         self.start_testpmd_on_vm(self.vm_dut_host)
+        self.start_testpmd_with_fwd_mode_on_both_dut()
         self.send_and_verify(self.verify_dpdk)
 
     def test_migrate_with_packed_ring_virtio_net(self):
         """
-        Verify migrate virtIO device from host to backup host,
-        Verify before/in/after migration, device with kernel driver can receive packets
+        Test Case 7: migrate with packed ring virtio-net
         """
         self.queue_number = 1
         self.launch_testpmd_as_vhost_on_both_dut()
@@ -456,6 +489,9 @@ class TestVhostUserLiveMigration(TestCase):
     def test_adjust_packed_ring_virtio_net_queue_numbers_while_migreting_with_virtio_net(
         self,
     ):
+        """
+        Test Case 8: adjust packed ring virtio-net queue numbers while migrating with virtio-net
+        """
         self.queue_number = 4
         self.launch_testpmd_as_vhost_on_both_dut()
         self.start_testpmd_with_fwd_mode_on_both_dut()
-- 
2.25.1


             reply	other threads:[~2023-03-31  3:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31  3:36 Wei Ling [this message]
2023-04-11  8:58 ` lijuan.tu

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=20230331033636.1373154-1-weix.ling@intel.com \
    --to=weix.ling@intel.com \
    --cc=dts@dpdk.org \
    /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).