From 3de820046d77332de459f0dbeee2c7a7d7c0b8d3 Mon Sep 17 00:00:00 2001 From: hakril Date: Thu, 24 Oct 2024 17:32:20 +0200 Subject: [PATCH] Fix or improv test resilience --- tests/test_symbol.py | 2 +- tests/test_token.py | 2 +- tests/test_wmi.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_symbol.py b/tests/test_symbol.py index b993367..bfc936c 100644 --- a/tests/test_symbol.py +++ b/tests/test_symbol.py @@ -29,7 +29,7 @@ def test_symbols_module_info(symctx): def test_symbols_search(symctx): mod = symctx.load_file(path=u"c:\\windows\\system32\\ntdll.dll", addr=0x42000) res = symctx.search(u"ntdll!*CreateFile") - assert set(s.name for s in res) == {"NtCreateFile", "ZwCreateFile"} + assert set(s.name for s in res) >= {"NtCreateFile", "ZwCreateFile"} # May have other names def test_symbols(symctx): diff --git a/tests/test_token.py b/tests/test_token.py index 346512e..2a57a9b 100644 --- a/tests/test_token.py +++ b/tests/test_token.py @@ -36,7 +36,7 @@ def test_token_user(curtok): user_sid = curtok.user assert user_sid computername, username = windows.utils.lookup_sid(user_sid) - assert computername == windows.system.computer_name + assert computername.upper() == windows.system.computer_name.upper() assert username == os.environ["USERNAME"] def test_token_id(curtok): diff --git a/tests/test_wmi.py b/tests/test_wmi.py index aca003f..a65a3f5 100644 --- a/tests/test_wmi.py +++ b/tests/test_wmi.py @@ -75,7 +75,7 @@ def test_get_object(name, cls): # Todo: test # - put_instance -@pytest.mark.parametrize("cmdline", [r"c:\windows\notepad.exe trolol.exe"]) +@pytest.mark.parametrize("cmdline", [r"winver.exe test_string_pfw"]) def test_exec_method_Win32_Process_create(cmdline): namespace = windows.system.wmi["root\\cimv2"] win32_process_cls = namespace.get_object("Win32_Process")