Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
NFV - Network Functions Virtualisation
api-tests
Commits
ef5add67
Commit
ef5add67
authored
Sep 27, 2021
by
Muhammad Hamza
Committed by
Giacomo Bernini
Oct 05, 2021
Browse files
fixed VNFD parsing in SOL005 APIs
parent
d61a1faf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
128 additions
and
27 deletions
+128
-27
SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot
...05/NSLifecycleManagement-API/NSLCMOperationKeywords.robot
+18
-9
SOL005/NSLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml
...leManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml
+1
-3
SOL005/NSLifecycleManagement-API/environment/variables.txt
SOL005/NSLifecycleManagement-API/environment/variables.txt
+3
-2
SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot
...FPackageManagement-API/VNFPackageManagementKeywords.robot
+101
-8
SOL005/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml
...geManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml
+1
-3
SOL005/VNFPackageManagement-API/environment/variables.txt
SOL005/VNFPackageManagement-API/environment/variables.txt
+4
-2
No files found.
SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot
View file @
ef5add67
...
...
@@ -269,14 +269,23 @@ PARSE the Descriptor File
Run Keyword If
'
${descriptorType}
'=='SOL001'
Fetch Information from SOL001 descriptor file
ELSE
Fetch Information from SOL006 descriptor file
Fetch Information from SOL001 descriptor file
Import Variables
descriptors/SOL001/VNFD/vnfd_SOL001.yaml
Import Variables
${CURDIR}
/
descriptors/SOL001/VNFD/vnfd_SOL001.yaml
@{VDU_labels}
=
Create List
@{VNF_labels}
=
Create List
@{VirtualLink_labels}
=
Create List
@{CP_labels}
=
Create List
@{Storage_labels}
=
Create List
FOR
${key}
IN
@{node_types.keys()}
${node_type}
=
Get Variable Value
${node_types['${key}']['derived_from']}
${is_VNF}
=
Run Keyword And Return Status
Should Be Equal As Strings
${node_type}
${tosca_type_VNF}
Run Keyword If
${is_VNF}
Set Global Variable
${tosca_type_derived_from_VNF}
${key}
END
${derived_type_is_used}
=
Run Keyword And Return Status
Should not be empty
${tosca_type_derived_from_VNF}
Run Keyword If
${derived_type_is_used}
Set Global Variable
${tosca_type_VNF}
${tosca_type_derived_from_VNF}
FOR
${key}
IN
@{topology_template.node_templates.keys()}
${key_type}
=
Get Variable Value
${topology_template.node_templates
.
${key}.type}
${key_type}
=
Get Variable Value
${topology_template.node_templates
['
${key}
']
.type}
${VDU_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key_type}
${tosca_type_VDU_compute}
${VNF_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key_type}
${tosca_type_VNF}
${Link_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key_type}
${tosca_type_virtual_link}
...
...
@@ -297,13 +306,13 @@ Fetch Information from SOL001 descriptor file
Get VNF Attributes from SOL001
[
Arguments
]
${VNF_label}
Import Variables
descriptors/SOL001/VNFD/vnfd_SOL001.yaml
${descriptor_id}
=
Get Variable Value
${topology_template.node_templates
.
${VNF_label}.properties.descriptor_id}
${provider}
=
Get Variable Value
${topology_template.node_templates
.
${VNF_label}.properties.provider}
${product_name}
=
Get Variable Value
${topology_template.node_templates
.
${VNF_label}.properties.product_name}
${software_version}
=
Get Variable Value
${topology_template.node_templates
.
${VNF_label}.properties.software_version}
${descriptor_version}
=
Get Variable Value
${topology_template.node_templates
.
${VNF_label}.properties.descriptor_version}
${flavour_id}
=
Get Variable Value
${topology_template.node_templates
.
${VNF_label}.properties.flavour_id}
Import Variables
${CURDIR}
/
descriptors/SOL001/VNFD/vnfd_SOL001.yaml
${descriptor_id}
=
Get Variable Value
${topology_template.node_templates
['
${VNF_label}
']
.properties.descriptor_id}
${provider}
=
Get Variable Value
${topology_template.node_templates
['
${VNF_label}
']
.properties.provider}
${product_name}
=
Get Variable Value
${topology_template.node_templates
['
${VNF_label}
']
.properties.product_name}
${software_version}
=
Get Variable Value
${topology_template.node_templates
['
${VNF_label}
']
.properties.software_version}
${descriptor_version}
=
Get Variable Value
${topology_template.node_templates
['
${VNF_label}
']
.properties.descriptor_version}
${flavour_id}
=
Get Variable Value
${topology_template.node_templates
['
${VNF_label}
']
.properties.flavour_id}
Set Global Variable
${Descriptor_ID}
${descriptor_id}
Set Global Variable
${Provider}
${provider}
...
...
SOL005/NSLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml
View file @
ef5add67
...
...
@@ -90,7 +90,6 @@ topology_template:
order
:
1
requirements
:
-
virtual_binding
:
VDU-B
vdu-b-1-vsd
:
management
:
type
:
"
tosca.nodes.nfv.VduCp"
properties
:
...
...
@@ -98,7 +97,6 @@ topology_template:
order
:
0
requirements
:
-
virtual_binding
:
VDU-B
vdu-b-1-vsd
:
left
:
type
:
"
tosca.nodes.nfv.VduCp"
properties
:
...
...
@@ -164,4 +162,4 @@ topology_template:
terminate
:
implementation
:
terminate-example.yaml
operate
:
implementation
:
operate-example.yaml
implementation
:
operate-example.yaml
\ No newline at end of file
SOL005/NSLifecycleManagement-API/environment/variables.txt
View file @
ef5add67
...
...
@@ -82,11 +82,13 @@ ${callbackResp} 127.0.0.1
${check_descriptors} 1
${descriptorType} SOL006
#############internal variables used for descriptor parsing################
${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute
${tosca_type_VNF} t
st010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder
${tosca_type_VNF} t
osca.nodes.nfv.VNF
${tosca_type_virtual_link} tosca.nodes.nfv.VnfVirtualLink
${tosca_type_VDU_cp} tosca.nodes.nfv.VduCp
${tosca_type_storage} tosca.nodes.nfv.Vdu.VirtualBlockStorage
${tosca_type_derived_from_VNF}
${tosca_type_NS} tosca.nodes.nfv.NS
${tosca_type_NsVirtualLink} tosca.nodes.nfv.NsVirtualLink
...
...
@@ -111,7 +113,6 @@ ${NS_Name}
${NS_Version}
${NS_InvariantId}
${Descriptor_ID}
${Provider}
${Product_Name}
...
...
SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot
View file @
ef5add67
...
...
@@ -197,11 +197,45 @@ PARSE the Descriptor File
Fetch Information from SOL001 descriptor file
Import Variables
${CURDIR}
/descriptors/SOL001/VNFD/vnfd_SOL001.yaml
${descriptor_id}
=
Get Variable Value
${topology_template.node_templates.properties.descriptor_id}
${provider}
=
Get Variable Value
${topology_template.node_templates.properties.provider}
${product_name}
=
Get Variable Value
${topology_template.node_templates.properties.product_name}
${software_version}
=
Get Variable Value
${topology_template.node_templates.properties.software_version}
${descriptor_version}
=
Get Variable Value
${topology_template.node_templates.properties.descriptor_version}
@{VDU_labels}
=
Create List
@{VNF_labels}
=
Create List
@{VirtualLink_labels}
=
Create List
@{CP_labels}
=
Create List
@{Storage_labels}
=
Create List
FOR
${key}
IN
@{node_types.keys()}
${node_type}
=
Get Variable Value
${node_types['${key}']['derived_from']}
${is_VNF}
=
Run Keyword And Return Status
Should Be Equal As Strings
${node_type}
${tosca_type_VNF}
Run Keyword If
${is_VNF}
Set Global Variable
${tosca_type_derived_from_VNF}
${key}
END
${derived_type_is_used}
=
Run Keyword And Return Status
Should not be empty
${tosca_type_derived_from_VNF}
Run Keyword If
${derived_type_is_used}
Set Global Variable
${tosca_type_VNF}
${tosca_type_derived_from_VNF}
FOR
${key}
IN
@{topology_template.node_templates.keys()}
${key_type}
=
Get Variable Value
${topology_template.node_templates['${key}'].type}
${VDU_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key_type}
${tosca_type_VDU_compute}
${VNF_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key_type}
${tosca_type_VNF}
${Link_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key_type}
${tosca_type_virtual_link}
${VDUcp_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key_type}
${tosca_type_VDU_cp}
${Storage_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key_type}
${tosca_type_storage}
Run Keyword If
${VDU_check}
Append To List
${VDU_labels}
${key}
Run Keyword If
${VNF_check}
Append To List
${VNF_labels}
${key}
Run Keyword If
${VNF_check}
Get VNF Attributes from SOL001
${key}
Run Keyword If
${Link_check}
Append To List
${VirtualLink_labels}
${key}
Run Keyword If
${VDUcp_check}
Append To List
${CP_labels}
${key}
Run Keyword If
${Storage_check}
Append To List
${Storage_labels}
${key}
END
Set Global Variable
@{VDU_IDs}
@{VDU_labels}
Set Global Variable
@{VNF_IDs}
@{VNF_labels}
Set Global Variable
@{VirtualLink_IDs}
@{VirtualLink_labels}
Set Global Variable
@{CP_IDs}
@{CP_labels}
Set Global Variable
@{Storage_IDs}
@{Storage_labels}
Get VNF Attributes from SOL001
[
Arguments
]
${VNF_label}
${descriptor_id}
=
Get Variable Value
${topology_template.node_templates['${VNF_label}'].properties.descriptor_id}
${provider}
=
Get Variable Value
${topology_template.node_templates['${VNF_label}'].properties.provider}
${product_name}
=
Get Variable Value
${topology_template.node_templates['${VNF_label}'].properties.product_name}
${software_version}
=
Get Variable Value
${topology_template.node_templates['${VNF_label}'].properties.software_version}
${descriptor_version}
=
Get Variable Value
${topology_template.node_templates['${VNF_label}'].properties.descriptor_version}
Set Global Variable
${Descriptor_ID}
${descriptor_id}
Set Global Variable
${Provider}
${provider}
...
...
@@ -213,14 +247,73 @@ Fetch Information from SOL006 descriptor file
Import Variables
${CURDIR}
/descriptors/SOL006/VNFD/vnfd_SOL006.yaml
${descriptor_id}
=
Get Variable Value
${nfv.vnfd[0].id}
${provider}
=
Get Variable Value
${nfv.vnfd[0].provider}
${product_name}
=
Get Variable Value
${nfv.vnfd[0].product-name}
${software_version}
=
Get Variable Value
${nfv.vnfd[0].software-version}
${descriptor_version}
=
Get Variable Value
${nfv.vnfd[0].version}
${product_name}
=
Get Variable Value
${nfv.vnfd[0]['product-name']}
${software_version}
=
Get Variable Value
${nfv.vnfd[0]['software-version']}
${descriptor_version}
=
Get Variable Value
${nfv.vnfd[0].version}
${VDUcount}
=
Get Length
${nfv.vnfd[0].vdu}
${extCP_count}
=
Get Length
${nfv.vnfd[0]['ext-cpd']}
${virtualLink_count}
=
Get length
${nfv.vnfd[0]['int-virtual-link-desc']}
${instantiation_levels}
=
Get Length
${nfv.vnfd[0].df['instantiation-level']}
FOR
${key}
IN
@{nfv.vnfd[0].keys()}
${VDU_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key}
vdu
Run Keyword If
${VDU_check}
Get VDU IDs
${VDUcount}
${extCP_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key}
ext-cpd
Run Keyword If
${extCP_check}
Get External CP IDs
${extCP_count}
${virtualLink_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key}
int-virtual-link-desc
Run Keyword If
${virtualLink_check}
Get Virtual Link IDs
${virtualLink_count}
${DF_check}
=
Run Keyword And Return Status
Should Be Equal As Strings
${key}
df
Run Keyword If
${DF_check}
Get Instantiation Levels
${instantiation_levels}
END
Set Global Variable
${Descriptor_ID}
${descriptor_id}
Set Global Variable
${Provider}
${provider}
Set Global Variable
${Product_Name}
${product_name}
Set Global Variable
${Software_Version}
${software_version}
Set Global Variable
${Descriptor_Version}
${descriptor_version}
Get VDU IDs
[
Arguments
]
${count}
@{VDU_labels}
=
Create List
${Storage_labels}
=
Create List
FOR
${i}
IN RANGE
${count}
Append To List
${VDU_labels}
${nfv.vnfd[0].vdu[${i}]['id']}
Append To List
${Storage_labels}
${nfv.vnfd[0].vdu[${i}]['virtual-storage-desc']}
Get Internal CPs for each VDU
${i}
END
Set Global Variable
${VDU_IDs}
${VDU_labels}
Set Global Variable
${Storage_IDs}
${Storage_labels}
Get Internal CPs for each VDU
[
Arguments
]
${vdu}
${count}
=
Get Length
${nfv.vnfd[0].vdu[${vdu}]['int-cpd']}
${internal_CPs}
=
Create List
FOR
${i}
IN RANGE
${count}
Append To List
${internal_CPs}
${nfv.vnfd[0].vdu[${vdu}]['int-cpd'][${i}]['id']}
END
Set Global Variable
${internalCP_IDs}
${internal_CPs}
Get External CP IDs
[
Arguments
]
${count}
@{external_CPs}
=
Create List
FOR
${i}
IN RANGE
${count}
Append To List
${external_CPs}
${nfv.vnfd[0]['ext-cpd'][${i}]['id']}
END
Set Global Variable
${externalCP_IDs}
${external_CPs}
Get Virtual Link IDs
[
Arguments
]
${count}
${VirtualLink_labels}
=
Create List
FOR
${i}
IN RANGE
${count}
Append To List
${VirtualLink_labels}
${nfv.vnfd[0]['int-virtual-link-desc'][${i}]['id']}
END
Set Global Variable
${VirtualLink_IDs}
${VirtualLink_labels}
Get Instantiation Levels
[
Arguments
]
${count}
@{Instantiation_Levels}
=
Create List
FOR
${i}
IN RANGE
${count}
Append To List
${Instantiation_Levels}
${nfv.vnfd[0].df['instantiation-level'][${i}]['id']}
END
Set Global Variable
${InstantiationLevel_IDs}
${Instantiation_Levels}
Match the Response Attributes of vnfPkgInfo with Descriptors
#Checking Response attributes with VNF Descriptors
...
...
SOL005/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml
View file @
ef5add67
...
...
@@ -90,7 +90,6 @@ topology_template:
order
:
1
requirements
:
-
virtual_binding
:
VDU-B
vdu-b-1-vsd
:
management
:
type
:
"
tosca.nodes.nfv.VduCp"
properties
:
...
...
@@ -98,7 +97,6 @@ topology_template:
order
:
0
requirements
:
-
virtual_binding
:
VDU-B
vdu-b-1-vsd
:
left
:
type
:
"
tosca.nodes.nfv.VduCp"
properties
:
...
...
@@ -164,4 +162,4 @@ topology_template:
terminate
:
implementation
:
terminate-example.yaml
operate
:
implementation
:
operate-example.yaml
implementation
:
operate-example.yaml
\ No newline at end of file
SOL005/VNFPackageManagement-API/environment/variables.txt
View file @
ef5add67
...
...
@@ -93,12 +93,14 @@ ${callbackResp} 127.0.0.1
${check_descriptors} 1
${descriptorType} SOL006
#############internal variables used for descriptor parsing################
${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute
${tosca_type_VNF} t
st010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder
${tosca_type_VNF} t
osca.nodes.nfv.VNF
${tosca_type_virtual_link} tosca.nodes.nfv.VnfVirtualLink
${tosca_type_VDU_cp} tosca.nodes.nfv.VduCp
${tosca_type_storage} tosca.nodes.nfv.Vdu.VirtualBlockStorage
${tosca_type_derived_from_VNF}
${VDU_IDs}
${VNF_IDs}
${virtualLink_IDs}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment