This patch modifies testcases/oc-digest/digest_test.sh as needed to run as part of the automated tests and adds it to the list of tests to run in ock_tests.sh.in.
Changes to digest_test.sh: o respect the -nostop flag on the command line o use the path to the oc-digest executable as needed by make installcheck o couple of formatting chages (sorry) Changes to ock_tests.sh.in: o add oc-digest/digest_tests.sh to the list of test to run o use 'ls -U' to preserve test ordering in the list Thanks, Kent Signed-off-by: Kent Yoder <[email protected]> diff --git a/testcases/oc-digest/digest_tests.sh b/testcases/oc-digest/digest_tests.sh index d0ef632..ec5551d 100755 --- a/testcases/oc-digest/digest_tests.sh +++ b/testcases/oc-digest/digest_tests.sh @@ -83,9 +83,9 @@ GLOBAL_RC=0 function run_test { if test "x$3" == "x"; then - ./oc-digest -slot $SLOT_ID -t $1 $2 + ./oc-digest/oc-digest -slot $SLOT_ID -t $1 $2 else - ./oc-digest -slot $SLOT_ID -t $1 $2 | $3 + ./oc-digest/oc-digest -slot $SLOT_ID -t $1 $2 | $3 fi return $? @@ -149,8 +149,13 @@ function run_tests do FILE_NAME="${FILE_SIZE}_byte_file" run_test ${digest_types[$INDEX]} ${FILE_NAME} "${validators[$INDEX]}" + RC=$? if test $RC -ne 0; then echo "error testing ${digest_types[$INDEX]} $FILE_NAME" + if test $NOSTOP -eq 0; then + GLOBAL_RC=$RC + return + fi fi done } @@ -169,7 +174,7 @@ function cleanup_testfiles function usage { - echo "usage: $1 [-slot <slot id>]" + echo "usage: $1 [-slot <slot id>] [-nostop]" exit -1 } @@ -178,7 +183,7 @@ function usage # # -# Check for -slot param +# Check for -slot, -nostop params # while test "x$1" != "x"; do if test "x$1" == "x-slot"; then @@ -190,6 +195,9 @@ while test "x$1" != "x"; do else usage $0 fi + elif test "x$1" == "x-nostop"; then + shift + NOSTOP=1 else usage $0 fi @@ -204,13 +212,11 @@ do echo "Testing if slot $SLOT_ID supports ${digest_types[$i]}..." run_test ${digest_types[$i]} /bin/ls RC=$? - if test $RC -eq $CKR_MECHANISM_INVALID - then + if test $RC -eq $CKR_MECHANISM_INVALID; then # this alg isn't supported on this token, test the next alg echo "nope." continue - elif test $RC -eq $CKR_OK - then + elif test $RC -eq $CKR_OK; then # this alg is supported, add it to the list to test echo "yes. ${digest_types[$i]} will be tested." digest_types_to_test="$digest_types_to_test $i" @@ -227,8 +233,7 @@ do echo "Testing ${digest_types[$i]}..." generate_testfiles ${digest_sizes[$i]} RC=$? - if test $RC -ne 0 - then + if test $RC -ne 0; then GLOBAL_RC=$RC cleanup_testfiles else diff --git a/testcases/ock_tests.sh.in b/testcases/ock_tests.sh.in index 7052d35..ff0fe3c 100755 --- a/testcases/ock_tests.sh.in +++ b/testcases/ock_tests.sh.in @@ -58,7 +58,7 @@ CONFSTART="@sbindir@/pkcs11_startup" # # v2.11/login MUST come last if it appears in this list # -OCK_TESTS="driver/*tests" +OCK_TESTS="oc-digest/digest_tests.sh driver/*tests" usage() { @@ -197,8 +197,13 @@ run_tests() then ./init_token.sh $i RC=$? - if test $RC -ne 0;then exit $RC;fi - for j in $( ls $OCK_TESTS ) + if test $RC -ne 0; + then + exit $RC + fi + + echo "running tests: $(ls -U $OCK_TESTS)" + for j in $( ls -U $OCK_TESTS ) do echo "=====Now executing '$j'======" $j -slot $i $NO_STOP 2>&1 ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Opencryptoki-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech
