summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test
diff options
context:
space:
mode:
authorAleksandra Maciaga <aleksandra.maciaga@nokia.com>2020-06-30 13:39:00 +0200
committerAleksandra Maciaga <aleksandra.maciaga@nokia.com>2020-06-30 14:48:12 +0200
commitb812f004656c053e5d0686820747f4845cd752c9 (patch)
tree52986b84f66362f0582844a932231c70cffc15f4 /csarvalidation/src/test
parent4d94d239aa4f768f5348ac11401fa63d986f963d (diff)
Make rule 130206 less restrictive
Signed-off-by: Aleksandra Maciaga <aleksandra.maciaga@nokia.com> Issue-ID: VNFSDK-595 Change-Id: I39beb48d958b0589837f4d960ca7edded0e1e22e
Diffstat (limited to 'csarvalidation/src/test')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR130206IntegrationTest.java22
-rw-r--r--csarvalidation/src/test/resources/pnf/r130206/csar-option1-warning.csarbin0 -> 5646 bytes
-rw-r--r--csarvalidation/src/test/resources/pnf/r130206/csar-with-no-certificate.csarbin116706 -> 112666 bytes
3 files changed, 19 insertions, 3 deletions
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<CSARArchive.CSARError> 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<CSARArchive.CSARError> 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<CSARArchive.CSARError> 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."
);
}
diff --git a/csarvalidation/src/test/resources/pnf/r130206/csar-option1-warning.csar b/csarvalidation/src/test/resources/pnf/r130206/csar-option1-warning.csar
new file mode 100644
index 0000000..d50d74a
--- /dev/null
+++ b/csarvalidation/src/test/resources/pnf/r130206/csar-option1-warning.csar
Binary files differ
diff --git a/csarvalidation/src/test/resources/pnf/r130206/csar-with-no-certificate.csar b/csarvalidation/src/test/resources/pnf/r130206/csar-with-no-certificate.csar
index 624f8fe..998619a 100644
--- a/csarvalidation/src/test/resources/pnf/r130206/csar-with-no-certificate.csar
+++ b/csarvalidation/src/test/resources/pnf/r130206/csar-with-no-certificate.csar
Binary files differ