aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-11 04:27:05 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-11 04:27:05 +0300
commitf30ffce538a0d33c1d64f01e2237c60599d97da1 (patch)
tree015dd5326df097d85be34ed006e0c13273f7e780 /test
parenttest: 800-38a.py -> nist-sp-800-38a.py (diff)
downloadaes-tools-f30ffce538a0d33c1d64f01e2237c60599d97da1.tar.gz
aes-tools-f30ffce538a0d33c1d64f01e2237c60599d97da1.zip
test: bugfix
Diffstat (limited to 'test')
-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)