diff --git a/tests/scripts/generate_tls13_compat_tests.py b/tests/scripts/generate_tls13_compat_tests.py index 28f82bde1..2e34ebb8b 100755 --- a/tests/scripts/generate_tls13_compat_tests.py +++ b/tests/scripts/generate_tls13_compat_tests.py @@ -25,6 +25,7 @@ Generate TLSv1.3 Compat test cases import sys import abc import argparse +import itertools # pylint: disable=useless-super-delegation @@ -373,6 +374,9 @@ def generate_compat_test(server=None, client=None, cipher=None, # pylint: disab def main(): parser = argparse.ArgumentParser() + parser.add_argument('-a', '--generate-all-tls13-compat-tests', action='store_true', + default=False, help='Generate all available tls13 compat tests') + parser.add_argument('--list-ciphers', action='store_true', default=False, help='List supported ciphersuites') @@ -405,6 +409,15 @@ def main(): help='Choose cipher suite for test') args = parser.parse_args() + if args.generate_all_tls13_compat_tests: + for i in itertools.product(CIPHER_SUITE_IANA_VALUE.keys(), SIG_ALG_IANA_VALUE.keys(), + NAMED_GROUP_IANA_VALUE.keys(), SERVER_CLS.keys(), + CLIENT_CLS.keys()): + generate_compat_test( + **dict(zip(['cipher', 'sig_alg', 'named_group', 'server', 'client'], i))) + print() + return 0 + if args.list_ciphers or args.list_sig_algs or args.list_named_groups \ or args.list_servers or args.list_clients: if args.list_ciphers: diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index a51b49f11..1e1030c83 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -1291,22 +1291,7 @@ run_tests_memory_after_hanshake() run_test_tls13_compat() { - for server in $(scripts/generate_tls13_compat_tests.py --list-servers) - do - for client in $(scripts/generate_tls13_compat_tests.py --list-clients) - do - for cipher in $(scripts/generate_tls13_compat_tests.py --list-ciphers) - do - for sig_alg in $(scripts/generate_tls13_compat_tests.py --list-sig-algs) - do - for named_group in $(scripts/generate_tls13_compat_tests.py --list-named-groups) - do - eval "$(scripts/generate_tls13_compat_tests.py $server $client $cipher $sig_alg $named_group)" - done - done - done - done - done + eval "$(scripts/generate_tls13_compat_tests.py -a)" } cleanup() {