aboutsummaryrefslogtreecommitdiff
path: root/unit_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'unit_tests.py')
-rw-r--r--unit_tests.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/unit_tests.py b/unit_tests.py
index 02863c8..f9bff67 100644
--- a/unit_tests.py
+++ b/unit_tests.py
@@ -50,8 +50,6 @@ def parse_arguments(argv = ()):
parser.add_argument("--slot", default = 0, type = int, help = "slot number")
parser.add_argument("--libpkcs11", default = libpkcs11_default, help = "PKCS #11 library")
parser.add_argument("--all-tests", action = "store_true", help = "enable tests usually skipped")
- parser.add_argument("--sql-file", default = "unit_tests.db", help = "SQLite3 database")
- parser.add_argument("--ks-client", default = "unit_tests.ks-client", help = "client keystore (ks_mmap only)")
parser.add_argument("--only-test", default = [], nargs = "+", help = "only run tests named here")
return parser.parse_args(argv)
@@ -59,36 +57,14 @@ args = parse_arguments()
p11 = None
def setUpModule():
- from os import unlink, environ
- from os.path import abspath, isfile
global p11
- def new_file(fn):
- fn = abspath(fn)
- if isfile(fn):
- unlink(fn)
- return fn
-
- environ["PKCS11_DATABASE"] = new_file(args.sql_file)
- environ["CRYPTECH_KEYSTORE"] = new_file(args.ks_client)
-
log("Loading PKCS #11 library {}".format(args.libpkcs11))
p11 = PKCS11(args.libpkcs11)
log("Setup complete")
-def tearDownModule():
- from os import unlink
- from os.path import isfile
-
- if isfile(args.sql_file):
- unlink(args.sql_file)
-
- if isfile(args.ks_client):
- unlink(args.ks_client)
-
-
# Subclass a few bits of unittest to add timing reports for individual tests.
class TestCase(unittest.TestCase):