[V1] tests/meson_tests: optimize script

Message ID 20230112091056.1123242-1-songx.jiale@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/meson_tests: optimize script |

Checks

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

Commit Message

Jiale, SongX Jan. 12, 2023, 9:10 a.m. UTC
  the "~/tmp" directory is not the inherent directory structure of the Linux system.
change it to "/tmp".

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 tests/TestSuite_meson_tests.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
  

Comments

Tu, Lijuan Jan. 12, 2023, 1:16 a.m. UTC | #1
On Thu, 12 Jan 2023 09:10:56 +0000, Song Jiale <songx.jiale@intel.com> wrote:
> the "~/tmp" directory is not the inherent directory structure of the Linux system.
> change it to "/tmp".
> 
> Signed-off-by: Song Jiale <songx.jiale@intel.com>


Applied, thanks
  

Patch

diff --git a/tests/TestSuite_meson_tests.py b/tests/TestSuite_meson_tests.py
index 42fd37af..738affa7 100644
--- a/tests/TestSuite_meson_tests.py
+++ b/tests/TestSuite_meson_tests.py
@@ -108,8 +108,7 @@  class TestMesonTests(TestCase):
     def copy_file_from_dut(self):
         if os.path.exists(os.path.join(self.base_output, self.dut_pathlog)):
             os.remove(os.path.join(self.base_output, self.dut_pathlog))
-
-        src_pathlog = f"~/tmp/{self.dut_pathlog}"
+        src_pathlog = f"/tmp/{self.dut_pathlog}"
         self.dut.session.copy_file_from(src_pathlog, self.base_output)
 
     def insmod_kni(self):
@@ -141,7 +140,7 @@  class TestMesonTests(TestCase):
         self.delete_exists_files()
         self.insmod_kni()
         # config test case list in conf/meson_tests.cfg
-        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:fast-tests {param} |tee ~/tmp/{self.dut_pathlog}"
+        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:fast-tests {param} |tee /tmp/{self.dut_pathlog}"
         out = self.dut.send_expect(cmds, "# ", self.execute_wait_time)
         self.logger.info(out)
         self.copy_file_from_dut()
@@ -152,7 +151,7 @@  class TestMesonTests(TestCase):
         # init file name
         self.dut_pathlog = "driver-test.log"
         self.delete_exists_files()
-        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:driver-tests {param} |tee ~/tmp/{self.dut_pathlog}"
+        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:driver-tests {param} |tee /tmp/{self.dut_pathlog}"
         out = self.dut.send_expect(cmds, "# ", self.execute_wait_time)
         self.logger.info(out)
         self.copy_file_from_dut()
@@ -163,7 +162,7 @@  class TestMesonTests(TestCase):
         self.dut_pathlog = "test-debug.log"
         # delete exists files
         self.delete_exists_files()
-        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:debug-tests {param} |tee ~/tmp/{self.dut_pathlog}"
+        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:debug-tests {param} |tee /tmp/{self.dut_pathlog}"
         out = self.dut.send_expect(cmds, "# ", self.execute_wait_time)
         self.logger.info(out)
         self.copy_file_from_dut()
@@ -174,7 +173,7 @@  class TestMesonTests(TestCase):
         self.dut_pathlog = "extra-test.log"
         # delete exists files
         self.delete_exists_files()
-        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:extra-tests {param} |tee ~/tmp/{self.dut_pathlog}"
+        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:extra-tests {param} |tee /tmp/{self.dut_pathlog}"
         out = self.dut.send_expect(cmds, "# ", self.execute_wait_time)
         self.logger.info(out)
         self.copy_file_from_dut()
@@ -189,7 +188,7 @@  class TestMesonTests(TestCase):
         self.dut_pathlog = "perf-test.log"
         # delete exists files
         self.delete_exists_files()
-        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:perf-tests {param} |tee ~/tmp/{self.dut_pathlog}"
+        cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:perf-tests {param} |tee /tmp/{self.dut_pathlog}"
         out = self.dut.send_expect(cmds, "# ", self.execute_wait_time)
         self.logger.info(out)
         self.copy_file_from_dut()