[V1] tests/metrics: fix start wrong dpdk-proc-info path issue

Message ID 20230112075004.1325372-1-weix.ling@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/metrics: fix start wrong dpdk-proc-info path issue |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test warning SKIPPED

Commit Message

Ling, WeiX Jan. 12, 2023, 7:50 a.m. UTC
  When using self.dut.alt_session.send_expect() API to create new seesion,
the current directory is /root, not the DPDK base directory, so add
swith to the DPDK base directory step before exectue the dpdk-proc-info
command to start the dpdk-proc-info APP.

Signed-off-by: Wei Ling <weix.ling@intel.com>
---
 tests/TestSuite_metrics.py | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Tu, Lijuan Jan. 13, 2023, 2:45 a.m. UTC | #1
On Thu, 12 Jan 2023 15:50:04 +0800, Wei Ling <weix.ling@intel.com> wrote:
> When using self.dut.alt_session.send_expect() API to create new seesion,
> the current directory is /root, not the DPDK base directory, so add
> swith to the DPDK base directory step before exectue the dpdk-proc-info
> command to start the dpdk-proc-info APP.
> 
> Signed-off-by: Wei Ling <weix.ling@intel.com>


Applied, thanks
  

Patch

diff --git a/tests/TestSuite_metrics.py b/tests/TestSuite_metrics.py
index f3111ec6..d7262011 100644
--- a/tests/TestSuite_metrics.py
+++ b/tests/TestSuite_metrics.py
@@ -42,6 +42,7 @@  class TestMetrics(TestCase):
 
     def d_a_con(self, cmd):
         _cmd = [cmd, "# ", 10] if isinstance(cmd, str) else cmd
+        self.dut.alt_session.send_expect("cd %s" % self.dut.base_dir, "# ", 10)
         output = self.dut.alt_session.send_expect(*_cmd)
         output2 = self.dut.alt_session.session.get_session_before(2)
         return output + os.linesep + output2