diff options
Diffstat (limited to 'csarvalidation/src/test')
6 files changed, 74 insertions, 49 deletions
diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfCSARArchiveTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfCSARArchiveTest.java index 4a211a5..d7370e4 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfCSARArchiveTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfCSARArchiveTest.java @@ -50,18 +50,23 @@ public class PnfCSARArchiveTest { private void verifyThatNonManoArtifactsWereSet(PnfCSARArchive pnfCSARArchive) { Map<String, Map<String, List<String>>> nonManoArtifacts = pnfCSARArchive.getManifest().getNonMano(); - assertThat(nonManoArtifacts.get("prv.onap.ves_event").get("Source")) - .isEqualTo(Lists.newArrayList("Artifacts/Deployment/Events/RadioNode_Pnf_v1.yml") + assertThat(nonManoArtifacts.get("onap_ves_events").get("source")) + .isEqualTo(Lists.newArrayList("Artifacts/Events/VES_registration.yml") ); - assertThat(nonManoArtifacts.get("prv.onap.pm_dictionary").get("Source")) - .isEqualTo(Lists.newArrayList("Artifacts/Deployment/Measurements/PM_Dictionary.yml") + assertThat(nonManoArtifacts.get("onap_pm_dictionary").get("source")) + .isEqualTo(Lists.newArrayList("Artifacts/Measurements/PM_Dictionary.yaml") ); - assertThat(nonManoArtifacts.get("prv.onap.yang_modules").get("Source")) + assertThat(nonManoArtifacts.get("onap_yang_module").get("source")) + .isEqualTo(Lists.newArrayList("Artifacts/Yang_module/Yang_module.yaml") + ); + assertThat(nonManoArtifacts.get("onap_others").get("source")) .isEqualTo(Lists.newArrayList( - "Artifacts/Deployment/Yang_module/yang-module1.yang", - "Artifacts/Deployment/Yang_module/yang-module2.yang" - ) - ); + "Artifacts/scripts/install.sh", + "Artifacts/Informational/user_guide.txt", + "Artifacts/Other/installation_guide.txt", + "Artifacts/Other/review_log.txt" + ) + ); } private void verifyThatMetadataWasSet(PnfCSARArchive pnfCSARArchive) { diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java index 96a66c3..f680438 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java @@ -57,16 +57,21 @@ public class PnfManifestParserTest { Map<String, Map<String, List<String>>> nonManoArtifacts = mapListPair.getKey(); List<CSARArchive.CSARError> errors= mapListPair.getValue(); - assertThat(nonManoArtifacts.get("prv.onap.ves_event").get("Source")) - .isEqualTo(Lists.newArrayList("Artifacts/Deployment/Events/RadioNode_Pnf_v1.yml") + assertThat(nonManoArtifacts.get("onap_ves_events").get("source")) + .isEqualTo(Lists.newArrayList("Artifacts/Events/VES_registration.yml") ); - assertThat(nonManoArtifacts.get("prv.onap.pm_dictionary").get("Source")) - .isEqualTo(Lists.newArrayList("Artifacts/Deployment/Measurements/PM_Dictionary.yml") + assertThat(nonManoArtifacts.get("onap_pm_dictionary").get("source")) + .isEqualTo(Lists.newArrayList("Artifacts/Measurements/PM_Dictionary.yaml") ); - assertThat(nonManoArtifacts.get("prv.onap.yang_modules").get("Source")) + assertThat(nonManoArtifacts.get("onap_yang_module").get("source")) + .isEqualTo(Lists.newArrayList("Artifacts/Yang_module/Yang_module.yaml") + ); + assertThat(nonManoArtifacts.get("onap_others").get("source")) .isEqualTo(Lists.newArrayList( - "Artifacts/Deployment/Yang_module/yang-module1.yang", - "Artifacts/Deployment/Yang_module/yang-module2.yang" + "Artifacts/scripts/install.sh", + "Artifacts/Informational/user_guide.txt", + "Artifacts/Other/installation_guide.txt", + "Artifacts/Other/review_log.txt" ) ); assertThat(errors.size()).isEqualTo(0); diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfMetadataParserTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfMetadataParserTest.java index 500fdd6..3d46334 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfMetadataParserTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfMetadataParserTest.java @@ -55,10 +55,10 @@ public class PnfMetadataParserTest { // given List<String> lines = Lists.newArrayList( "metadata:", - "pnf_product_name: RadioNode", - "pnf_provider_id: Ericsson", - "pnf_package_version: 1.0", - "pnf_release_date_time: 2019-01-14T11:25:00+00:00", + "pnfd_name: RadioNode", + "pnfd_provider: Ericsson", + "pnfd_archive_version: 1.0", + "pnfd_release_date_time: 2019-01-14T11:25:00+00:00", "extra_param_1: some value", "extra_param_2: some value" ); @@ -83,10 +83,11 @@ public class PnfMetadataParserTest { // given List<String> lines = Lists.newArrayList( "metadata:", - "pnf_product_name: RadioNode", - "pnf_provider_id: Ericsson", - "pnf_package_version: 1.0", - "pnf_release_date_time: 2019-01-14T11:25:00+00:00", + "pnfd_name: RadioNode", + "pnfd_provider: Ericsson", + "pnfd_archive_version: 1.0", + "# Ignore this comment", + "pnfd_release_date_time: 2019-01-14T11:25:00+00:00", "non_mano_artifact_sets:", "param_name: some value" ); @@ -108,10 +109,10 @@ public class PnfMetadataParserTest { // given List<String> lines = Lists.newArrayList( "metadata:", - "pnf_product_name: RadioNode", - "pnf_provider_id: Ericsson", - "pnf_package_version: 1.0", - "pnf_release_date_time: 2019-01-14T11:25:00+00:00", + "pnfd_name: RadioNode", + "pnfd_provider: Ericsson", + "pnfd_archive_version: 1.0", + "pnfd_release_date_time: 2019-01-14T11:25:00+00:00", "unknown_section:", "param_name: some value" ); @@ -130,14 +131,14 @@ public class PnfMetadataParserTest { @Test - public void shouldReportAWarningWhenTokenWithOutColonWasFoundDuringMetadataProcessing() { + public void shouldReportAInvalidWhenTokenWithOutColonWasFoundDuringMetadataProcessing() { // given List<String> lines = Lists.newArrayList( "metadata:", - "pnf_product_name RadioNode", - "pnf_provider_id: Ericsson", - "pnf_package_version: 1.0", - "pnf_release_date_time: 2019-01-14T11:25:00+00:00" + "pnfd_name RadioNode", + "pnfd_provider: Ericsson", + "pnfd_archive_version: 1.0", + "pnfd_release_date_time: 2019-01-14T11:25:00+00:00" ); // when @@ -148,7 +149,7 @@ public class PnfMetadataParserTest { List<CSARArchive.CSARError> errors = data.getRight(); assertThat(errors.size()).isEqualTo(1); assertThat(errors.stream().map(CSARArchive.CSARError::getMessage).collect(Collectors.toList())).contains( - "Warning. Entry [pnf_product_name RadioNode]" + "Invalid. Entry [pnfd_name RadioNode]" ); } diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java index 95526bb..91d2648 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java @@ -56,12 +56,13 @@ public class PnfNonManoArtifactsParserTest { // given List<String> lines = Lists.newArrayList( "non_mano_artifact_sets:", - "prv.onap.ves_event: # if private else onap_ves_event if public", - "Source: Artifacts/Deployment/Events/RadioNode_Pnf_v1.yml", + "# Ignore this comment", + "onap_ves_events: # if private else onap_ves_event if public", + "source: Artifacts/Events/VES_registration.yml", "extra_param_1: some value", "extra_param_2: some value", - "prv.onap.pm_dictionary: # if private else onap_pm_dictionary if public", - "Source: Artifacts/Deployment/Measurements/PM_Dictionary.yml", + "onap_pm_dictionary: # if private else onap_pm_dictionary if public", + "source: Artifacts/Measurements/PM_Dictionary.yaml", "param name: # if private else onap_yang_modules if public", "key: value" ); diff --git a/csarvalidation/src/test/resources/pnf/MainServiceTemplate.mf b/csarvalidation/src/test/resources/pnf/MainServiceTemplate.mf index c5a498c..c0c0f97 100644 --- a/csarvalidation/src/test/resources/pnf/MainServiceTemplate.mf +++ b/csarvalidation/src/test/resources/pnf/MainServiceTemplate.mf @@ -1,14 +1,27 @@ metadata: - pnf_product_name: RadioNode - pnf_provider_id: Ericsson - pnf_package_version: 1.0 - pnf_release_date_time: 2019-01-14T11:25:00+00:00 + pnfd_name: RadioNode + pnfd_provider: Ericsson + pnfd_archive_version: 1.0 + pnfd_release_date_time: 2019-01-14T11:25:00+00:00 + +#The manifest file shall include a list of all files contained in or referenced from the VNF package with their location +#source: Definitions/MainServiceTemplate.yaml +#source: Definitions/etsi_nfv_sol001_vnfd_2_5_1_types.yaml non_mano_artifact_sets: - prv.onap.ves_event: # if private else onap_ves_event if public - Source: Artifacts/Deployment/Events/RadioNode_Pnf_v1.yml - prv.onap.pm_dictionary: # if private else onap_pm_dictionary if public - Source: Artifacts/Deployment/Measurements/PM_Dictionary.yml - prv.onap.yang_modules: # if private else onap_yang_modules if public - Source: Artifacts/Deployment/Yang_module/yang-module1.yang - Source: Artifacts/Deployment/Yang_module/yang-module2.yang
\ No newline at end of file + + onap_ves_events: + source: Artifacts/Events/VES_registration.yml + + onap_pm_dictionary: + source: Artifacts/Measurements/PM_Dictionary.yaml + + onap_yang_module: + source: Artifacts/Yang_module/Yang_module.yaml + + onap_others: + source: Artifacts/scripts/install.sh + source: Artifacts/Informational/user_guide.txt + source: Artifacts/Other/installation_guide.txt + source: Artifacts/Other/review_log.txt + diff --git a/csarvalidation/src/test/resources/pnf/dummyPnfv2.csar b/csarvalidation/src/test/resources/pnf/dummyPnfv2.csar Binary files differindex cc48435..778f45c 100644 --- a/csarvalidation/src/test/resources/pnf/dummyPnfv2.csar +++ b/csarvalidation/src/test/resources/pnf/dummyPnfv2.csar |