diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 416626e93..dd052dd56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,11 @@ jobs: strategy: fail-fast: false matrix: - runner: [ubuntu-24.04, ubuntu-22.04] + runner: + - ubuntu-24.04 + - ubuntu-22.04 + - ubuntu-24.04-arm + - ubuntu-22.04-arm name: "Run Unit tests on ${{ matrix.runner }}" runs-on: ${{ matrix.runner }} @@ -37,12 +41,12 @@ jobs: sudo apt-get install -y gdb-multiarch python3-dev python3-pip python3-wheel python3-setuptools git cmake gcc g++ pkg-config libglib2.0-dev gdbserver qemu-user - name: Install python and toolchain - if: matrix.runner == 'ubuntu-24.04' + if: startsWith(matrix.runner, 'ubuntu-24.04') run: | sudo apt-get install -y python3-full - name: Install python and toolchain - if: matrix.runner != 'ubuntu-24.04' + if: startsWith(matrix.runner, 'ubuntu-24.04') == false run: | python3 -m pip install pip -U @@ -68,14 +72,14 @@ jobs: ${{ matrix.runner }}- - name: Install python and toolchain - if: matrix.runner != 'ubuntu-24.04' + if: startsWith(matrix.runner, 'ubuntu-24.04') == false run: | test "${{ env.PY_VER }}" == "0" && exit 1 mkdir -p ${{ env.GEF_CI_CACHE_DIR }} python${{ env.PY_VER }} -m pip install --user --upgrade -r tests/requirements.txt - name: Install Python Requirements - if: matrix.runner == 'ubuntu-24.04' + if: startsWith(matrix.runner, 'ubuntu-24.04') run: | test "${{ env.PY_VER }}" == "0" && exit 1 mkdir -p ${{ env.GEF_CI_CACHE_DIR }} diff --git a/tests/api/gef_memory.py b/tests/api/gef_memory.py index 6b0b6760d..673ad9981 100644 --- a/tests/api/gef_memory.py +++ b/tests/api/gef_memory.py @@ -10,6 +10,7 @@ from tests.utils import ( ARCH, + IN_GITHUB_ACTIONS, debug_target, gdbserver_session, qemuuser_session, @@ -136,7 +137,7 @@ def test_func_parse_maps_remote_gdbserver(self): sections = gef.memory.maps assert len(sections) > 0 - @pytest.mark.skipif(ARCH not in ("x86_64",), reason=f"Skipped for {ARCH}") + @pytest.mark.skipif(ARCH == "aarch64" and IN_GITHUB_ACTIONS, reason=f"Skipped for {ARCH} on CI") def test_func_parse_maps_remote_qemu(self): gdb, gef = self._gdb, self._gef # When in a gef-remote qemu-user session `parse_gdb_info_proc_maps` @@ -152,6 +153,7 @@ def test_func_parse_maps_remote_qemu(self): sections = gef.memory.maps assert len(sections) > 0 + @pytest.mark.skipif(ARCH == "aarch64" and IN_GITHUB_ACTIONS, reason=f"Skipped for {ARCH}") def test_func_parse_maps_realpath(self): gef, gdb = self._gef, self._gdb # When in a gef-remote session `parse_gdb_info_proc_maps` should work to diff --git a/tests/commands/heap.py b/tests/commands/heap.py index b3bce6f23..6073c22d4 100644 --- a/tests/commands/heap.py +++ b/tests/commands/heap.py @@ -2,6 +2,7 @@ Heap commands test module """ +import pytest from tests.base import RemoteGefUnitTestGeneric from tests.utils import ( ARCH, @@ -179,6 +180,7 @@ def test_cmd_heap_bins_non_main(self): res = gdb.execute(cmd, to_string=True) self.assertIn("size=0x20", res) + @pytest.mark.skipif(ARCH not in ("i686", "x86_64",), reason=f"Skipped for {ARCH}") def test_cmd_heap_bins_tcache(self): gdb = self._gdb gdb.execute("run") @@ -292,6 +294,7 @@ def setUp(self) -> None: self.expected_tcache_bin_size = 0x20 if ARCH == "i686" or is_64b() else 0x18 return super().setUp() + @pytest.mark.skipif(ARCH not in ("i686", "x86_64"), reason=f"Skipped for {ARCH}") def test_cmd_heap_bins_tcache_all(self): gdb = self._gdb gdb.execute("run") diff --git a/tests/regressions/gdbserver_connection.py b/tests/regressions/gdbserver_connection.py index 6c46d9659..1c6fd3a18 100644 --- a/tests/regressions/gdbserver_connection.py +++ b/tests/regressions/gdbserver_connection.py @@ -1,10 +1,14 @@ +import pytest from tests.base import RemoteGefUnitTestGeneric from tests.utils import ( + ARCH, + IN_GITHUB_ACTIONS, gdbserver_session, ) class RegressionGdbserverConnection(RemoteGefUnitTestGeneric): + @pytest.mark.skipif(ARCH == "aarch64" and IN_GITHUB_ACTIONS, reason=f"Skipped for {ARCH} on CI") def test_can_establish_connection_to_gdbserver_again_after_disconnect(self): """Ensure that gdb can connect to a gdbserver again after disconnecting (PR #896).""" gdb = self._gdb diff --git a/tests/utils.py b/tests/utils.py index a0c6ea0ef..12d1d1abf 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -55,6 +55,7 @@ def which(program: str) -> pathlib.Path: ERROR_INACTIVE_SESSION_MESSAGE = "[*] No debugging session active\n" WARNING_DEPRECATION_MESSAGE = "is deprecated and will be removed in a feature release." +IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" class Color(enum.Enum): """Used to colorify terminal output."""