summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test
diff options
context:
space:
mode:
authorBogumil Zebek <bogumil.zebek@nokia.com>2019-03-15 10:43:42 +0100
committerZebek Bogumil <bogumil.zebek@nokia.com>2019-03-18 08:02:39 +0100
commit0d4544eb82a2ca79d7724e5c1da70d3943db76eb (patch)
tree3d18b7a0f8ee1edf20476c60828b0e80042e9b9e /csarvalidation/src/test
parentcb83eef8ba8f479576a07d08cf9b5c48b737778c (diff)
Update manifest parser
Change-Id: I420fd9fb97450cbcc2afc15632717182e18f0333 Issue-ID: VNFSDK-384 Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com>
Diffstat (limited to 'csarvalidation/src/test')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/PnfCSARArchiveTest.java23
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java19
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/PnfMetadataParserTest.java37
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java9
-rw-r--r--csarvalidation/src/test/resources/pnf/MainServiceTemplate.mf35
-rw-r--r--csarvalidation/src/test/resources/pnf/dummyPnfv2.csarbin3889 -> 4039 bytes
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
index cc48435..778f45c 100644
--- a/csarvalidation/src/test/resources/pnf/dummyPnfv2.csar
+++ b/csarvalidation/src/test/resources/pnf/dummyPnfv2.csar
Binary files differ