Skip to content

Commit

Permalink
Add variable 'special_errors' for peculiar unit-test problems
Browse files Browse the repository at this point in the history
The reason for this variable is to catch an error which only occurs
when using the New generate_master_hash() method.

The error is a master-hash mismatch error, during unit-test cross-
pollinated Easy-TLS PKI, when disabling a client TLS-Crypt-V2 key.

The error is Not present when using the Old generate_master_hash()
method.

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Feb 24, 2022
1 parent 84ec961 commit b1323a5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions dev/easytls-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ sknown_3=42
subtot_expected_errors=0
sknown_expected_errors=62
known_expected_errors=$(( sknown_1 + sknown_2 + sknown_3 + sknown_expected_errors ))
special_errors=0

QUIT_LOOP=${QUIT_LOOP:-0}

Expand Down Expand Up @@ -933,8 +934,10 @@ DBUG_DIR="$WORK_DIR/et-tdir1/easytls/metadata"

print "------------------------------------------------------------"
print "${INVOKE_OPTS} $EASYTLS_CMD" --batch disable "$c"
${INVOKE_OPTS} "$EASYTLS_CMD" --batch disable "$c" || \
fail "${INVOKE_OPTS} $EASYTLS_CMD --batch disable $c"
${INVOKE_OPTS} "$EASYTLS_CMD" --batch disable "$c" || {
expected_errors "${INVOKE_OPTS} $EASYTLS_CMD --batch disable $c"
special_errors="$(( special_errors + 1 ))"
}

print "------------------------------------------------------------"
cp "${real_metadata_file}" "${metadata_file}"
Expand Down Expand Up @@ -1120,6 +1123,9 @@ final_end_time="$(date +%s)"
final_run_mins="$(( (final_end_time - final_start_time) / 60 ))"
final_run_secs="$(( (final_end_time - final_start_time) - ( final_run_mins * 60 ) ))"

subtot_expected_errors="$(( subtot_expected_errors - special_errors ))"
total_expected_errors="$(( total_expected_errors - special_errors ))"

print "============================================================"
print "Clean up"
clean_up
Expand All @@ -1130,7 +1136,8 @@ print "subtot_2 $subtot_2 (Expected $sknown_2 Verified)"
print "subtot_3 $subtot_3 (Expected $sknown_3 Verified)"
print "Last part cross-polinated: $subtot_expected_errors (Expected $sknown_expected_errors Verified)"

print "total_expected_errors=$total_expected_errors (Expected $known_expected_errors Verified)"
print "total_expected_errors: $total_expected_errors (Expected $known_expected_errors Verified)"
print "special_errors: $special_errors"
print "Completed successfully: $(date +%Y/%m/%d--%H:%M:%S)"
print "============================================================"

Expand Down

0 comments on commit b1323a5

Please sign in to comment.