If we fail to create a session, invalidade the session
handler and check that when closing sessions.
Trying to C_CloseSession() on an invalid handle may
segfault the caller.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
Introduce testcase_[pass|fail|skip|error] macros to be used
across the testsuite and thus standardize testcases format and
output.
The macros will also try to time the operation execution, now
with microsecond resolution.
I've also provided testcase_*_f alternatives for cases where
we need to manually identify the test (instead of just using
__func__).
This patch also "converts" obj_mgmt.c tests to use the new
macros.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
Opencryptoki has a number of places which use misc pkcs#11 utility
functions.
This patch creates p11util.c which to start consolidating those
functions in one place.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
This patch makes the show_error() function used by the testcases a macro, then adds printing of a file and line number wherever its called. This patch also changes the file descriptor these strings print to from stdout to stderr. This will make finding errors in automated test runs easier.
Thanks,
Kent
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
- Now testcases inside testcases/driver can be run separatedly
- ock-tests.sh now calls individual tests instead of testcases/driver/driver binary
- since all usage() were the same inside testcases/driver, this is now located at testcases/common.c. To avoid namespace conflict, the other usage() ones were renamed to <testcase_binary_name>_usage()
- skip_token_obj, no_stop and no_init are now declared in testcases/include/regress,h