test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1 0/1] power_branch_ratio: fix port release issue
@ 2020-07-07  5:38 yufengmx
  2020-07-07  5:38 ` [dts] [PATCH V1 1/1] " yufengmx
  0 siblings, 1 reply; 3+ messages in thread
From: yufengmx @ 2020-07-07  5:38 UTC (permalink / raw)
  To: dts, lei.a.yao; +Cc: yufengmx


. fix port release issue. 

yufengmx (1):
  power_branch_ratio: fix port release issue

 tests/TestSuite_power_branch_ratio.py | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

-- 
2.21.0


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

* [dts] [PATCH V1 1/1] power_branch_ratio: fix port release issue
  2020-07-07  5:38 [dts] [PATCH V1 0/1] power_branch_ratio: fix port release issue yufengmx
@ 2020-07-07  5:38 ` yufengmx
  2020-07-20  7:01   ` Tu, Lijuan
  0 siblings, 1 reply; 3+ messages in thread
From: yufengmx @ 2020-07-07  5:38 UTC (permalink / raw)
  To: dts, lei.a.yao; +Cc: yufengmx


#. fix port release issue.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 tests/TestSuite_power_branch_ratio.py | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_power_branch_ratio.py b/tests/TestSuite_power_branch_ratio.py
index 8bd82d4..b45ebcb 100644
--- a/tests/TestSuite_power_branch_ratio.py
+++ b/tests/TestSuite_power_branch_ratio.py
@@ -303,10 +303,12 @@ class TestPowerBranchRatio(TestCase):
         self.dut.build_install_dpdk(self.target)
 
     @contextmanager
-    def restore_compilation(self):
+    def restore_environment(self):
         try:
             yield
         finally:
+            time.sleep(10)
+            self.restore_port_drv()
             sw_table = [
                 "CONFIG_RTE_LIBRTE_POWER",
                 "CONFIG_RTE_LIBRTE_POWER_DEBUG",
@@ -319,6 +321,17 @@ class TestPowerBranchRatio(TestCase):
             # re-compile dpdk source code
             self.dut.build_install_dpdk(self.target)
 
+    def restore_port_drv(self):
+        driver = self.drivername
+        for port in self.dut.ports_info:
+            netdev = port.get('port')
+            if not netdev:
+                continue
+            cur_drv = netdev.get_nic_driver()
+            if cur_drv == driver:
+                continue
+            netdev.bind_driver(driver)
+
     def init_vm_power_mgr(self):
         self.vm_power_mgr = self.prepare_binary('vm_power_manager')
 
@@ -652,7 +665,7 @@ class TestPowerBranchRatio(TestCase):
         """
         Run after each test suite.
         """
-        with self.restore_compilation():
+        with self.restore_environment():
             self.close_vm()
 
     def set_up(self):
-- 
2.21.0


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

* Re: [dts] [PATCH V1 1/1] power_branch_ratio: fix port release issue
  2020-07-07  5:38 ` [dts] [PATCH V1 1/1] " yufengmx
@ 2020-07-20  7:01   ` Tu, Lijuan
  0 siblings, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-07-20  7:01 UTC (permalink / raw)
  To: Mo, YufengX, dts, Yao, Lei A; +Cc: Mo, YufengX

Applied, thanks

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of yufengmx
> Sent: 2020年7月7日 13:39
> To: dts@dpdk.org; Yao, Lei A <lei.a.yao@intel.com>
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V1 1/1] power_branch_ratio: fix port release issue
> 
> 
> #. fix port release issue.
> 
> Signed-off-by: yufengmx <yufengx.mo@intel.com>
> ---
>  tests/TestSuite_power_branch_ratio.py | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/TestSuite_power_branch_ratio.py
> b/tests/TestSuite_power_branch_ratio.py
> index 8bd82d4..b45ebcb 100644
> --- a/tests/TestSuite_power_branch_ratio.py
> +++ b/tests/TestSuite_power_branch_ratio.py
> @@ -303,10 +303,12 @@ class TestPowerBranchRatio(TestCase):
>          self.dut.build_install_dpdk(self.target)
> 
>      @contextmanager
> -    def restore_compilation(self):
> +    def restore_environment(self):
>          try:
>              yield
>          finally:
> +            time.sleep(10)
> +            self.restore_port_drv()
>              sw_table = [
>                  "CONFIG_RTE_LIBRTE_POWER",
>                  "CONFIG_RTE_LIBRTE_POWER_DEBUG", @@ -319,6 +321,17 @@
> class TestPowerBranchRatio(TestCase):
>              # re-compile dpdk source code
>              self.dut.build_install_dpdk(self.target)
> 
> +    def restore_port_drv(self):
> +        driver = self.drivername
> +        for port in self.dut.ports_info:
> +            netdev = port.get('port')
> +            if not netdev:
> +                continue
> +            cur_drv = netdev.get_nic_driver()
> +            if cur_drv == driver:
> +                continue
> +            netdev.bind_driver(driver)
> +
>      def init_vm_power_mgr(self):
>          self.vm_power_mgr = self.prepare_binary('vm_power_manager')
> 
> @@ -652,7 +665,7 @@ class TestPowerBranchRatio(TestCase):
>          """
>          Run after each test suite.
>          """
> -        with self.restore_compilation():
> +        with self.restore_environment():
>              self.close_vm()
> 
>      def set_up(self):
> --
> 2.21.0


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

end of thread, other threads:[~2020-07-20  7:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07  5:38 [dts] [PATCH V1 0/1] power_branch_ratio: fix port release issue yufengmx
2020-07-07  5:38 ` [dts] [PATCH V1 1/1] " yufengmx
2020-07-20  7:01   ` Tu, Lijuan

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