From b812f004656c053e5d0686820747f4845cd752c9 Mon Sep 17 00:00:00 2001 From: Aleksandra Maciaga Date: Tue, 30 Jun 2020 13:39:00 +0200 Subject: Make rule 130206 less restrictive Signed-off-by: Aleksandra Maciaga Issue-ID: VNFSDK-595 Change-Id: I39beb48d958b0589837f4d960ca7edded0e1e22e --- .../VTPValidateCSARR130206IntegrationTest.java | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004') diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR130206IntegrationTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR130206IntegrationTest.java index feabe7f..0147c90 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR130206IntegrationTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR130206IntegrationTest.java @@ -80,6 +80,22 @@ public class VTPValidateCSARR130206IntegrationTest { assertThat(errors.size()).isEqualTo(0); } + @Test + public void shouldReportWarningForMissingCMSAndHashCodes() throws Exception{ + // given + configureTestCase(testCase, "pnf/r130206/csar-option1-warning.csar", "vtp-validate-csar-r130206.yaml", IS_PNF); + + // when + testCase.execute(); + + // then + List errors = testCase.getErrors(); + assertThat(errors.size()).isEqualTo(1); + assertThat(convertToMessagesList(errors)).contains( + "Warning. Consider adding security options (CMS and hash codes for sources) in manifest file." + ); + } + @Test public void shouldReportThatOnlySignatureIsInvalid() throws Exception { @@ -135,14 +151,14 @@ public class VTPValidateCSARR130206IntegrationTest { List errors = testCase.getErrors(); assertThat(convertToMessagesList(errors)).contains( "Unable to find cert file defined by Entry-Certificate!", - "Unable to find CMS section in manifest!", + "Warning. Consider adding security options (CMS and hash codes for sources) in manifest file.", "Missing. Entry [tosca_definitions_version]" ); } @Test - public void shouldReportThanInVnfPackageETSIFileIsMissingAndNoCertificateInCMS() throws Exception { + public void shouldReportThanInVnfPackageETSIFileIsMissing() throws Exception { // given configureTestCase(testCase, "pnf/r130206/csar-with-no-certificate.csar", "vtp-validate-csar-r130206.yaml", IS_PNF); @@ -154,7 +170,7 @@ public class VTPValidateCSARR130206IntegrationTest { List errors = testCase.getErrors(); assertThat(convertToMessagesList(errors)).contains( "Unable to find cert file defined by ETSI-Entry-Certificate!", - "Unable to find CMS section in manifest!" + "Warning. Consider adding security options (CMS and hash codes for sources) in manifest file." ); } -- cgit 1.2.3-korg