From f30ffce538a0d33c1d64f01e2237c60599d97da1 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 11 Jun 2015 04:27:05 +0300 Subject: test: bugfix --- test/cavp.py | 6 ++++++ test/nist-sp-800-38a.py | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'test') diff --git a/test/cavp.py b/test/cavp.py index 3599648..a94eaef 100644 --- a/test/cavp.py +++ b/test/cavp.py @@ -7,6 +7,7 @@ import configparser from datetime import datetime import logging import os.path +import sys import toolkit import zipfile @@ -164,6 +165,11 @@ def _parse_test_vectors_archive(tools, archive_path='KAT_AES.zip'): logging.info('\tError(s): {0}'.format(exit_codes.count(_TestExitCode.ERROR))) logging.info('\tSucceeded: {0}'.format(exit_codes.count(_TestExitCode.SUCCESS))) logging.info('\tFailed: {0}'.format(exit_codes.count(_TestExitCode.FAILURE))) + if (exit_codes.count(_TestExitCode.ERROR) == 0 and + exit_codes.count(_TestExitCode.FAILURE) == 0): + sys.exit() + else: + sys.exit(1) if __name__ == '__main__': import argparse diff --git a/test/nist-sp-800-38a.py b/test/nist-sp-800-38a.py index 10e78e9..df45451 100644 --- a/test/nist-sp-800-38a.py +++ b/test/nist-sp-800-38a.py @@ -5,6 +5,7 @@ from datetime import datetime import logging import toolkit +import sys _plaintexts = ['6bc1bee22e409f96e93d7e117393172a', 'ae2d8a571e03ac9c9eb76fac45af8e51', @@ -170,3 +171,8 @@ if __name__ == '__main__': logging.info('\tError(s): {0}'.format(exit_codes.count(_TestExitCode.ERROR))) logging.info('\tSucceeded: {0}'.format(exit_codes.count(_TestExitCode.SUCCESS))) logging.info('\tFailed: {0}'.format(exit_codes.count(_TestExitCode.FAILURE))) + if (exit_codes.count(_TestExitCode.ERROR) == 0 and + exit_codes.count(_TestExitCode.FAILURE) == 0): + sys.exit() + else: + sys.exit(1) -- cgit v1.2.3