From 3658278074691eac47a3a2554435cffdb096b3da Mon Sep 17 00:00:00 2001 From: Zion Leonahenahe Basque Date: Mon, 11 Sep 2023 13:37:32 -0700 Subject: [PATCH] Wrap `test_linux_network_stacksmash_64` in a flaky rerunner (3 runs) (#103) * Add a wrapper for flakey tests to re-run * use flakey for tests * typo --- setup.py | 1 + tests/test_rex.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/setup.py b/setup.py index 0ccdc3e..27cc053 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ 'povsim', 'compilerex', 'pwntools', + 'flaky', ], package_data={ 'rex.scripter.templates': ['*.j2'] diff --git a/tests/test_rex.py b/tests/test_rex.py index ae8634c..63a0ca0 100644 --- a/tests/test_rex.py +++ b/tests/test_rex.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long import os import random import subprocess @@ -14,6 +15,8 @@ from angr.state_plugins.trace_additions import FormatInfoStrToInt, FormatInfoDontConstrain from rex.exploit.cgc.type1.cgc_type1_shellcode_exploit import CGCType1ShellcodeExploit +from flaky import flaky + bin_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries')) cache_location = str(os.path.join(bin_location, 'tests_data/rop_gadgets_cache')) tests_dir = str(os.path.dirname(os.path.realpath(__file__))) @@ -231,6 +234,7 @@ def test_linux_stacksmash_32(): _check_arsenal_has_send(exploit.arsenal) +@flaky(max_runs=3, min_passes=1) def test_linux_network_stacksmash_64(): # Test exploiting a simple network server with a stack-based buffer overflow. inp = b'\x00' * 500