From 13972b9f73f084e6dff0f39bd2132d1439ec946c Mon Sep 17 00:00:00 2001 From: Sunidhi-Gaonkar1 Date: Wed, 24 Jan 2024 12:24:32 +0530 Subject: [PATCH] Fix pytests and update build.sh to add ppc64le support. Signed-off-by: Sunidhi-Gaonkar1 --- scripts/components/OpenSearch/build.sh | 7 +++++++ src/system/os.py | 2 ++ tests/tests_system/test_os.py | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/components/OpenSearch/build.sh b/scripts/components/OpenSearch/build.sh index 8ae7ae0d4a..e9e4bf8167 100755 --- a/scripts/components/OpenSearch/build.sh +++ b/scripts/components/OpenSearch/build.sh @@ -107,6 +107,13 @@ case $PLATFORM-$DISTRIBUTION-$ARCHITECTURE in TARGET="$PLATFORM-arm64-$PACKAGE" SUFFIX="$PLATFORM-arm64" ;; + linux-tar-ppc64le) + PACKAGE="tar" + EXT="tar.gz" + TYPE="archives" + TARGET="$PLATFORM-ppc64le-$PACKAGE" + SUFFIX="$PLATFORM-ppc64le" + ;; linux-deb-x64) PACKAGE="deb" EXT="deb" diff --git a/src/system/os.py b/src/system/os.py index fbc6c3ece4..7a73b890af 100644 --- a/src/system/os.py +++ b/src/system/os.py @@ -15,6 +15,8 @@ def current_architecture() -> str: return "x64" elif architecture == "aarch64" or architecture == "arm64": return "arm64" + elif architecture == "ppc64le": + return "ppc64le" else: raise ValueError(f"Unsupported architecture: {architecture}") diff --git a/tests/tests_system/test_os.py b/tests/tests_system/test_os.py index 36a7533cee..5a4b1c5ab2 100644 --- a/tests/tests_system/test_os.py +++ b/tests/tests_system/test_os.py @@ -14,7 +14,7 @@ class TestOs(unittest.TestCase): # current_architecture def test_current_architecture(self) -> None: - self.assertTrue(current_architecture() in ["x64", "arm64"]) + self.assertTrue(current_architecture() in ["x64", "arm64", "ppc64le"]) @patch("subprocess.check_output", return_value="x86_64".encode()) def test_x86_64_return_x64_architecture(self, mock_subprocess: MagicMock) -> None: