Skip to content

Commit

Permalink
more verbose output for failing exploit tests (closes #20) (#24)
Browse files Browse the repository at this point in the history
* more verbose output for failing exploit tests (closes #20)

* bump version to 0.7.0
  • Loading branch information
ldruschk authored Jun 29, 2021
1 parent 21b255f commit af5fca7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
33 changes: 17 additions & 16 deletions enochecker_test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,32 +556,33 @@ def _do_exploit_run(round_id, exploit_id, flag_id, service_address, checker_url)
checker_url,
)
print(found_flag)
return found_flag == flag
except:
pass
return False
return found_flag == flag, None
except Exception as e:
return False, e


def test_exploit_per_exploit_id(
round_id, exploit_id, flag_variants, service_address, checker_url
):
assert any(
[
_do_exploit_run(round_id, exploit_id, flag_id, service_address, checker_url)
for flag_id in range(flag_variants)
]
)
results = [
_do_exploit_run(round_id, exploit_id, flag_id, service_address, checker_url)
for flag_id in range(flag_variants)
]
if any(r[0] for r in results):
return
raise Exception([r[1] for r in results])


def test_exploit_per_flag_id(
round_id, exploit_variants, flag_id, service_address, checker_url
):
assert any(
[
_do_exploit_run(round_id, exploit_id, flag_id, service_address, checker_url)
for exploit_id in range(exploit_variants)
]
)
results = [
_do_exploit_run(round_id, exploit_id, flag_id, service_address, checker_url)
for exploit_id in range(exploit_variants)
]
if any(r[0] for r in results):
return
raise Exception([r[1] for r in results])


def test_exploit_invalid_variant(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setuptools.setup(
name="enochecker_test",
version="0.6.1",
version="0.7.0",
author="ldruschk",
author_email="ldruschk@posteo.de",
description="Library to help testing checker scripts based on enochecker",
Expand Down

0 comments on commit af5fca7

Please sign in to comment.