tls13_compat_tests:Add generate all option

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2021-11-26 11:13:58 +08:00
parent d64e20de7f
commit c4aa1520a2
2 changed files with 14 additions and 16 deletions

View file

@ -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:

View file

@ -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() {