CI(full),CI(release): Python bindings: (#2100)

- Switched to the ubuntu-24.04-arm runner
- Bumped Windows runner to windows-2022 and Visual Studio 17 2022 GENERATORS
- Minor changes about checks in workflow jobs
- Fixed the pagefile job (even though should not be really needed)
- Refreshed the TO BE CHECKED regress tests to either update or remove the skip conditions
- Added a test to check if the created sdist archive is ok
This commit is contained in:
@Antelox
2025-02-13 11:24:04 +01:00
committed by GitHub
parent bf87b9a86d
commit dea3c376d0
6 changed files with 43 additions and 40 deletions

View File

@@ -1,13 +1,11 @@
import platform
import regress
import unittest
from unicorn import *
from unicorn.arm_const import *
class MovHang(regress.RegressTest):
@unittest.skipIf(platform.machine().lower() == 'aarch64', reason='TO BE CHECKED!')
# NOTE: This test was failing when workflow was using ubuntu-latest + qemu. Fixed once switched to native arm runner
def runTest(self):
uc = Uc(UC_ARCH_ARM, UC_MODE_ARM)
uc.mem_map(0x1000, 0x1000)

View File

@@ -44,7 +44,7 @@ class TestCtl(regress.RegressTest):
self.assertEqual(UC_CPU_ARM_CORTEX_M0, uc.ctl_get_cpu_model())
@unittest.skipIf(sys.version_info < (3, 7), reason="requires python3.7 or higher")
@unittest.skipIf(sys.platform == 'win32' or platform.machine().lower() not in ('x86_64', 'arm64'), 'TO BE CHECKED!')
@unittest.skip('TO BE CHECKED!')
def test_page_size(self):
SIZE_4KB = 4 * 1024 ** 1
SIZE_2MB = 2 * 1024 ** 2
@@ -78,7 +78,6 @@ class TestCtl(regress.RegressTest):
# are we still with the valid value?
self.assertEqual(SIZE_2MB, uc.ctl_get_page_size())
@unittest.skipIf(platform.machine().lower() == 'aarch64', reason='TO BE CHECKED!')
def test_timeout(self):
MILLIS_1S = 1000

View File

@@ -14,6 +14,7 @@ class Init(regress.RegressTest):
def init_unicorn(self, ip, sp, counter):
regress.logger.debug("[+] Emulating IP: %x SP: %x - Counter: %x" % (ip, sp, counter))
self.emulator = Uc(UC_ARCH_X86, UC_MODE_64)
self.emulator.ctl_set_tlb_mode(UC_TLB_VIRTUAL)
self.emulator.mem_map(0x1000000, 2 * 1024 * 1024)
self.emulator.mem_write(0x1000000, b"\x90")
self.emulator.mem_map(0x8000000, 8 * 1024 * 1024)
@@ -55,7 +56,7 @@ class Init(regress.RegressTest):
return True
@unittest.skipIf(sys.version_info < (3, 7), reason="requires python3.7 or higher")
@unittest.skipIf(sys.platform == 'win32' or platform.machine().lower() not in ('x86_64', 'arm64'), 'TO BE CHECKED!')
@unittest.skipIf(sys.platform == 'win32', 'TO BE CHECKED!')
def runTest(self):
ips = range(0x1000000, 0x1001000)
sps = range(0x8000000, 0x8001000)

View File

@@ -16,7 +16,6 @@ ITERATIONS = 10000
class MemoryLeak(regress.RegressTest):
@unittest.skipIf(sys.platform == 'win32', reason='Test for Unix only')
@unittest.skipIf(platform.machine().lower() == 'aarch64', reason='TO BE CHECKED!')
def test(self):
if platform.system() == "Darwin":
rusage_multiplier = 1

View File

@@ -1,8 +1,8 @@
# By Mariano Graziano
import platform
import regress
import struct
import sys
import unittest
from unicorn import *
from unicorn.x86_const import *
@@ -17,6 +17,7 @@ class Emulator:
self.unicorn_stack = stack
self.mu = Uc(UC_ARCH_X86, UC_MODE_64)
self.mu.ctl_set_tlb_mode(UC_TLB_VIRTUAL)
regress.logger.debug("mapping code : %#x", __page_aligned(code))
regress.logger.debug("mapping stack : %#x", __page_aligned(stack))
@@ -75,7 +76,7 @@ class TranslatorBuffer(regress.RegressTest):
emu.emu(1)
@unittest.skipIf(platform.machine().lower() == 'aarch64', reason='TO BE CHECKED!')
@unittest.skipIf(sys.version_info < (3, 7), reason="requires python3.7 or higher")
def runTest(self):
ip_base = 0x000fffff816a0000 # was: 0xffffffff816a0000
sp_base = 0x000f88001b800000 # was: 0xffff88001b800000