diff --git a/tests/api/gef_memory.py b/tests/api/gef_memory.py index 19d2d350b..e5cb60e56 100644 --- a/tests/api/gef_memory.py +++ b/tests/api/gef_memory.py @@ -9,6 +9,7 @@ from tests.base import RemoteGefUnitTestGeneric from tests.utils import ( + ARCH, debug_target, gdbserver_session, qemuuser_session, @@ -135,6 +136,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}") 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` diff --git a/tests/api/gef_session.py b/tests/api/gef_session.py index 0a0e2ce7b..a24c04370 100644 --- a/tests/api/gef_session.py +++ b/tests/api/gef_session.py @@ -6,10 +6,12 @@ import pathlib import random import re +import pytest from tests.base import RemoteGefUnitTestGeneric from tests.utils import ( + ARCH, debug_target, gdbserver_session, qemuuser_session, @@ -72,6 +74,7 @@ def test_root_dir_remote(self): expected.st_ino == result.st_ino ) + @pytest.mark.skipif(ARCH not in ("x86_64",), reason=f"Skipped for {ARCH}") def test_root_dir_qemu(self): gdb, gef = self._gdb, self._gef diff --git a/tests/commands/canary.py b/tests/commands/canary.py index 840664658..5e76deb4b 100644 --- a/tests/commands/canary.py +++ b/tests/commands/canary.py @@ -13,7 +13,6 @@ def setUp(self) -> None: self._target = debug_target("canary") return super().setUp() - def test_cmd_canary(self): assert ERROR_INACTIVE_SESSION_MESSAGE == self._gdb.execute("canary", to_string=True) self._gdb.execute("start") @@ -21,14 +20,14 @@ def test_cmd_canary(self): assert "The canary of process" in res assert self._gef.session.canary[0] == self._gef.session.original_canary[0] - def test_overwrite_canary(self): gdb, gef = self._gdb, self._gef gdb.execute("start") + _, canary_address = gef.session.canary if is_64b(): - gef.memory.write(gef.arch.canary_address(), p64(0xdeadbeef)) + gef.memory.write(canary_address, p64(0xDEADBEEF)) else: - gef.memory.write(gef.arch.canary_address(), p32(0xdeadbeef)) - res = u32(gef.memory.read(gef.arch.canary_address(), gef.arch.ptrsize)) + gef.memory.write(canary_address, p32(0xDEADBEEF)) + res = u32(gef.memory.read(canary_address, gef.arch.ptrsize)) assert 0xdeadbeef == res diff --git a/tests/commands/gef_remote.py b/tests/commands/gef_remote.py index b5c980667..578547f8b 100644 --- a/tests/commands/gef_remote.py +++ b/tests/commands/gef_remote.py @@ -8,6 +8,7 @@ from tests.base import RemoteGefUnitTestGeneric from tests.utils import ( + ARCH, debug_target, gdbserver_session, qemuuser_session, @@ -39,6 +40,7 @@ def test_cmd_gef_remote_gdbserver(self): assert res.endswith(f"pid={gef.session.pid}, mode={gdbserver_mode})") @pytest.mark.slow + @pytest.mark.skipif(ARCH not in ("x86_64",), reason=f"Skipped for {ARCH}") def test_cmd_gef_remote_qemu_user(self): gdb = self._gdb gef = self._gef diff --git a/tests/commands/scan.py b/tests/commands/scan.py index b32c636d7..18372463d 100644 --- a/tests/commands/scan.py +++ b/tests/commands/scan.py @@ -11,7 +11,7 @@ class ScanCommand(RemoteGefUnitTestGeneric): """`scan` command test module""" def setUp(self) -> None: - self._target = debug_target("checksec-no-pie") + self._target = debug_target("default") return super().setUp() def test_cmd_scan(self): diff --git a/tests/commands/vmmap.py b/tests/commands/vmmap.py index 591d3b387..1ac0c5a2e 100644 --- a/tests/commands/vmmap.py +++ b/tests/commands/vmmap.py @@ -22,5 +22,5 @@ def test_cmd_vmmap(self): res = gdb.execute("vmmap stack", to_string=True) self.assertGreater(len(res.splitlines()), 1) - res = gdb.execute("vmmap $rip", to_string=True) + res = gdb.execute("vmmap $pc", to_string=True) self.assertEqual(len(res.splitlines()), 2)