aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/cavp.py6
-rw-r--r--test/nist-sp-800-38a.py6
2 files changed, 12 insertions, 0 deletions
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)