aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_backend_corstone_install.py39
-rw-r--r--tests/test_backend_registry.py18
2 files changed, 46 insertions, 11 deletions
diff --git a/tests/test_backend_corstone_install.py b/tests/test_backend_corstone_install.py
index b9e6569..496e378 100644
--- a/tests/test_backend_corstone_install.py
+++ b/tests/test_backend_corstone_install.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2024, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Tests for Corstone related installation functions.."""
from __future__ import annotations
@@ -10,7 +10,7 @@ from unittest.mock import MagicMock
import pytest
-from mlia.backend.corstone.install import Corstone300Installer
+from mlia.backend.corstone.install import CorstoneInstaller
from mlia.backend.corstone.install import get_corstone_installations
from mlia.backend.install import Installation
@@ -24,10 +24,15 @@ def test_get_corstone_installations() -> None:
@pytest.mark.parametrize(
- "eula_agreement, expected_calls",
+ "corstone_name, eula_agreement, expected_calls",
[
- [True, [call(["./FVP_Corstone_SSE-300.sh", "-q", "-d", "corstone-300"])]],
[
+ "corstone-300",
+ True,
+ [call(["./FVP_Corstone_SSE-300.sh", "-q", "-d", "corstone-300"])],
+ ],
+ [
+ "corstone-300",
False,
[
call(
@@ -42,22 +47,44 @@ def test_get_corstone_installations() -> None:
)
],
],
+ [
+ "corstone-310",
+ True,
+ [call(["./FVP_Corstone_SSE-310.sh", "-q", "-d", "corstone-310"])],
+ ],
+ [
+ "corstone-310",
+ False,
+ [
+ call(
+ [
+ "./FVP_Corstone_SSE-310.sh",
+ "-q",
+ "-d",
+ "corstone-310",
+ "--nointeractive",
+ "--i-agree-to-the-contained-eula",
+ ]
+ )
+ ],
+ ],
],
)
def test_corstone_installer(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,
+ corstone_name: str,
eula_agreement: bool,
expected_calls: Any,
) -> None:
- """Test Corstone 300 installer."""
+ """Test Corstone installer."""
mock_check_call = MagicMock()
monkeypatch.setattr(
"mlia.backend.corstone.install.subprocess.check_call", mock_check_call
)
- installer = Corstone300Installer()
+ installer = CorstoneInstaller(name=corstone_name)
installer(eula_agreement, tmp_path)
assert mock_check_call.mock_calls == expected_calls
diff --git a/tests/test_backend_registry.py b/tests/test_backend_registry.py
index cc05632..1f729b6 100644
--- a/tests/test_backend_registry.py
+++ b/tests/test_backend_registry.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2024, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Tests for the backend registry module."""
from __future__ import annotations
@@ -26,14 +26,22 @@ from mlia.core.common import AdviceCategory
),
(
"corstone-300",
- [AdviceCategory.PERFORMANCE, AdviceCategory.OPTIMIZATION],
- [System.LINUX_AMD64],
+ [
+ AdviceCategory.COMPATIBILITY,
+ AdviceCategory.PERFORMANCE,
+ AdviceCategory.OPTIMIZATION,
+ ],
+ [System.LINUX_AMD64, System.LINUX_AARCH64],
BackendType.CUSTOM,
),
(
"corstone-310",
- [AdviceCategory.PERFORMANCE, AdviceCategory.OPTIMIZATION],
- [System.LINUX_AMD64],
+ [
+ AdviceCategory.COMPATIBILITY,
+ AdviceCategory.PERFORMANCE,
+ AdviceCategory.OPTIMIZATION,
+ ],
+ [System.LINUX_AMD64, System.LINUX_AARCH64],
BackendType.CUSTOM,
),
(