Skip to content

Commit

Permalink
Wrap test_linux_network_stacksmash_64 in a flaky rerunner (3 runs) (#…
Browse files Browse the repository at this point in the history
…103)

* Add a wrapper for flakey tests to re-run

* use flakey for tests

* typo
  • Loading branch information
mahaloz authored Sep 11, 2023
1 parent e7248a2 commit 3658278
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'povsim',
'compilerex',
'pwntools',
'flaky',
],
package_data={
'rex.scripter.templates': ['*.j2']
Expand Down
4 changes: 4 additions & 0 deletions tests/test_rex.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=line-too-long
import os
import random
import subprocess
Expand All @@ -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__)))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3658278

Please sign in to comment.