Skip to content

Commit

Permalink
Make sure WindowsZip/LinuxTar remove correct dir when uninstall (#4023)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Sep 15, 2023
1 parent 9ff7a9e commit 6e89bdb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/test_workflow/integ_test/distribution_tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ def start_cmd(self) -> str:
return start_cmd_map[self.filename]

def uninstall(self) -> None:
logging.info(f"Cleanup {self.work_dir}/* content after the test")
subprocess.check_call(f"rm -rf {self.work_dir}/*", shell=True)
logging.info(f"Cleanup {self.install_dir} content after the test")
subprocess.check_call(f"rm -rf {self.install_dir}", shell=True)
4 changes: 2 additions & 2 deletions src/test_workflow/integ_test/distribution_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ def start_cmd(self) -> str:
return start_cmd_map[self.filename]

def uninstall(self) -> None:
logging.info(f"Cleanup {self.work_dir}/* content after the test")
subprocess.check_call(f"rm -rf {self.work_dir}/*", shell=True)
logging.info(f"Cleanup {self.install_dir} content after the test")
subprocess.check_call(f"rm -rf {self.install_dir}", shell=True)
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ def test_uninstall(self, check_call_mock: Mock) -> None:
args_list = check_call_mock.call_args_list

self.assertEqual(check_call_mock.call_count, 1)
self.assertEqual(f"rm -rf {self.work_dir}/*", args_list[0][0][0])
self.assertEqual(f"rm -rf {os.path.join(self.work_dir, 'opensearch-1.3.0')}", args_list[0][0][0])
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_uninstall(self, check_call_mock: Mock) -> None:
args_list = check_call_mock.call_args_list

self.assertEqual(check_call_mock.call_count, 1)
self.assertEqual(f"rm -rf {self.work_dir}/*", args_list[0][0][0])
self.assertEqual(f"rm -rf {os.path.join(self.work_dir, 'opensearch-2.4.0')}", args_list[0][0][0])


class TestDistributionZipOpenSearchDashboards(unittest.TestCase):
Expand Down Expand Up @@ -97,4 +97,4 @@ def test_uninstall(self, check_call_mock: Mock) -> None:
args_list = check_call_mock.call_args_list

self.assertEqual(check_call_mock.call_count, 1)
self.assertEqual(f"rm -rf {self.work_dir}/*", args_list[0][0][0])
self.assertEqual(f"rm -rf {os.path.join(self.work_dir, 'opensearch-dashboards-2.4.0')}", args_list[0][0][0])

0 comments on commit 6e89bdb

Please sign in to comment.