aboutsummaryrefslogtreecommitdiffstats
path: root/tests/so
diff options
context:
space:
mode:
authorAndrewLamb <andrew.a.lamb@est.tech>2021-02-03 15:09:53 +0000
committerAndrewLamb <andrew.a.lamb@est.tech>2021-02-03 15:10:06 +0000
commit08ade1a49f2689b58ad5a1aa5004c60c69646b3f (patch)
tree182e403ba3a97d386d7914ed07761aa2edb84272 /tests/so
parent020bc4cedc49e9c3a242618992949c6bc0fd79de (diff)
Add Test for VNF Package Management - Artifacts
Change-Id: Ia00ea3185b6c9a51c1dd84da6a65082d57f6c16b Issue-ID: INT-1846 Signed-off-by: AndrewLamb <andrew.a.lamb@est.tech>
Diffstat (limited to 'tests/so')
-rw-r--r--tests/so/etsi/data/responses/expectedArtifacts/image1
-rw-r--r--tests/so/etsi/etsi_vnf_package_management_tests.robot18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/so/etsi/data/responses/expectedArtifacts/image b/tests/so/etsi/data/responses/expectedArtifacts/image
new file mode 100644
index 00000000..f31d15df
--- /dev/null
+++ b/tests/so/etsi/data/responses/expectedArtifacts/image
@@ -0,0 +1 @@
+ubuntu_16.04
diff --git a/tests/so/etsi/etsi_vnf_package_management_tests.robot b/tests/so/etsi/etsi_vnf_package_management_tests.robot
index 11041c1d..b7cd337f 100644
--- a/tests/so/etsi/etsi_vnf_package_management_tests.robot
+++ b/tests/so/etsi/etsi_vnf_package_management_tests.robot
@@ -99,6 +99,24 @@ Get VNF Package VNFD
Remove Directory ${TEMPDIR}${/}${TEST_DIR} recursive=True
Log To Console \nexecuted with expected result
+Get A VNF Package Artifact
+ ${artifactPath}= Convert To String image
+ Create Session so_vnfm_adapter_session http://${REPO_IP}:9092
+ &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/octet-stream
+ Log to Console \nGetting ${artifactPath} artifact from Vnf Package with id ${vnf_package_id} from so-vnfm-adapter
+ ${response}= Get On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/vnf_packages/${vnf_package_id}/artifacts/${artifactPath} headers=${headers}
+ Log To Console Response:${response}
+ Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result
+ Should Be Equal As Strings '${response.status_code}' '200'
+ Create Directory ${TEMPDIR}${/}${TEST_DIR}
+ Empty Directory ${TEMPDIR}${/}${TEST_DIR}
+ Create Binary File ${TEMPDIR}${/}${TEST_DIR}${/}${artifactPath} ${response.content}
+ ${expectedArtifact}= Get Binary File ${CURDIR}${/}data${/}responses${/}expectedArtifacts${/}${artifactPath}
+ ${actualArtifact}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}${artifactPath}
+ Should Be Equal As Strings ${expectedArtifact} ${actualArtifact}
+ Remove Directory ${TEMPDIR}${/}${TEST_DIR} recursive=True
+ Log To Console \nexecuted with expected result
+
*** Keywords ***
Should Be Equal File Size
[Arguments] ${file1} ${file2}