Skip to content

Commit

Permalink
Merge pull request #771 from tlsfuzzer/lucky13-fixups
Browse files Browse the repository at this point in the history
lucky13 - run a group only if there are actual tests to execute
  • Loading branch information
tomato42 committed Aug 12, 2021
2 parents ac0a881 + 0449d39 commit cbca9ba
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/test-lucky13.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from tlsfuzzer.helpers import SIG_ALL


version = 6
version = 7


def help_msg():
Expand Down Expand Up @@ -413,15 +413,21 @@ def main():
# make sure that sanity test is run first and last
# to verify that server was running and kept running throughout
sanity_tests = [('sanity', conversations['sanity'])]
regular_tests = [(k, v) for k, v in conversations.items() if k != 'sanity']
if run_only:
if num_limit > len(run_only):
num_limit = len(run_only)
regular_tests = [(k, v) for k, v in conversations.items() if k in run_only]
else:
regular_tests = [(k, v) for k, v in conversations.items() if
(k != 'sanity') and k not in run_exclude]
sampled_tests = sample(regular_tests, min(num_limit, len(regular_tests)))
ordered_tests = chain(sanity_tests, sampled_tests, sanity_tests)
if not sampled_tests:
continue

print("Running tests for {0}".format(CipherSuite.ietfNames[cipher]))

for c_name, c_test in ordered_tests:
if run_only and c_name not in run_only or c_name in run_exclude:
continue
print("{0} ...".format(c_name))

runner = Runner(c_test)
Expand Down

0 comments on commit cbca9ba

Please sign in to comment.