From 8d92a864cfbcdf7f77646f75476cb27de7f28ba0 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Wed, 6 Oct 2021 22:42:08 +0100 Subject: [PATCH] Some minor improvements to the checksum feature file. --- .../features/checksum_verification.feature | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/test/resources/features/checksum_verification.feature b/src/test/resources/features/checksum_verification.feature index 3e1246df..a51f1b24 100644 --- a/src/test/resources/features/checksum_verification.feature +++ b/src/test/resources/features/checksum_verification.feature @@ -31,7 +31,7 @@ Feature: Verify checksums And the response headers file is created for candidate "grails" and version "1.3.9" And the exit code is 0 - Scenario: If an unknown algorithm is used it should not fail + Scenario: Do not fail if an unknown algorithm is used Given the system is bootstrapped And the candidate "grails" version "1.3.9" is available for download with checksum "abc-checksum-00000" using algorithm "ABC" When I enter "sdk install grails 1.3.9" @@ -40,7 +40,17 @@ Feature: Verify checksums And the response headers file is created for candidate "grails" and version "1.3.9" And the exit code is 0 - Scenario: Abort installation on download of a corrupt Candidate with invalid SHA + Scenario: Do not fail if no algorithm is detected + Given the system is bootstrapped + And the candidate "grails" version "1.3.9" is available for download + When I enter "sdk install grails 1.3.9" + Then I see "Done installing!" + And I do not see "Stop! An invalid checksum was detected and the archive removed! Please try re-installing." + And the candidate "grails" version "1.3.9" is installed + And the response headers file is created for candidate "grails" and version "1.3.9" + And the exit code is 0 + + Scenario: Abort installation after download of a binary with invalid SHA checksum Given the system is bootstrapped And the candidate "grails" version "1.3.9" is available for download with checksum "c68e386a6deec9fc4c1e18df21f927000000000e" using algorithm "SHA-256" When I enter "sdk install grails 1.3.9" @@ -48,3 +58,12 @@ Feature: Verify checksums And the candidate "grails" version "1.3.9" is not installed And the archive for candidate "grails" version "1.3.9" is removed And the exit code is 1 + + Scenario: Abort installation after download of a binary with invalid MD5 checksum + Given the system is bootstrapped + And the candidate "grails" version "1.3.9" is available for download with checksum "1e87a7d982a2f41da96fdec289908552" using algorithm "MD5" + When I enter "sdk install grails 1.3.9" + Then I see "Stop! An invalid checksum was detected and the archive removed! Please try re-installing." + And the candidate "grails" version "1.3.9" is not installed + And the archive for candidate "grails" version "1.3.9" is removed + And the exit code is 1