Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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

Expand All @@ -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 }}
Expand Down
4 changes: 3 additions & 1 deletion tests/api/gef_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from tests.utils import (
ARCH,
IN_GITHUB_ACTIONS,
debug_target,
gdbserver_session,
qemuuser_session,
Expand Down Expand Up @@ -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`
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/commands/heap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Heap commands test module
"""

import pytest
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import (
ARCH,
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still arch specific? Do you have an arm machine to test on? would be nice if it at least passed locally.

I am setting up a raspberry pi in the next few days for something related, I should be able to test if you can wait.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, it can wait but I'm happy to re-test on my devices too

def test_cmd_heap_bins_tcache_all(self):
gdb = self._gdb
gdb.execute("run")
Expand Down
4 changes: 4 additions & 0 deletions tests/regressions/gdbserver_connection.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down