+++ /dev/null
-<!--
-Copyright 2019 Tech Mahindra Limited
-
-All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may
-not use this file except in compliance with the License. You may obtain
-a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations
-under the License.
--->
-
-
-# Step to run robot framework test standalone linux environment
-
-All installation commands run using root user(`sudo su`)
-## Step 1: Install python packages
-Install below python packages using pip
->pip install python-magic pyangbind haikunator requests pyvcloud progressbar pathlib robotframework robotframework-seleniumlibrary robotframework-requests robotframework-jsonlibrary
-
-## Step 2: Install linux packages
-Install below linux packages
->curl http://osm-download.etsi.org/repository/osm/debian/ReleaseSIX/OSM%20ETSI%20Release%20Key.gpg | apt-key add -
-
->add-apt-repository -y "deb http://osm-download.etsi.org/repository/osm/debian/ReleaseSIX stable devops osmclient IM" && apt update
-
->curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
-
->echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
-
-> apt-get install -y python-osmclient python-osm-im google-chrome-stable chromium-chromedriver
-
->./git-repo/devops/tools/OVF_converter/install.sh
-
-## Step 3: checkout robot seed code
-Checkout devops from gerrit
-> git clone "https://osm.etsi.org/gerrit/osm/devops"
-
-If robot seed code not merged to to master, pull it
-> git pull "https://osm.etsi.org/gerrit/osm/devops" refs/changes/52/7852/4
-
-## Step 4: Set environmet
-for build test need to create env-file and provide below details and for Standalone testing export them
-```
-export OSM_HOSTNAME=<OSM server IP>
-```
-
-OpenStack Details
-```
-export OS_AUTH_URL=<auth url>
-export OS_PASSWORD=<password>
-export OS_PROJECT_NAME=<project name>
-export OS_VIM_CONFIG=<config value>
-```
-
-VCD Details
-```
-export VCD_AUTH_URL=<VCD auth url>
-export VCD_USERNAME=<VCD username>
-export VCD_PASSWORD=<VCD password>
-export VCD_TENANT_NAME=<VCD Tenant name>
-export VCD_ORGANIZATION=<VCD Org name>
-export VCD_VIM_CONFIG=<config value>
-```
-
-Note:- Optional
-```
-export NS_CONFIG=<NS Config Details>
-e.g. export NS_CONFIG="'{vld: [ {name: mgmtnet, vim-network-name: mgmt}]}'"
-```
-
-## Step 5: Run Test
-There are two ways to run the test-case:
-* use `devops/robot-systest/run_test.sh` file and provide test-name(vim/smoke/sanity/comprehensive).
- > ./devops/robot-systest/run_test.sh -t smoke
-
-* use `robot` command
- > robot -d path/to/report/dir -i test-tag-to-be-included -e test-tag-to-be-excluded path/to/testsuiet
-
- > robot -d devops/robot-systest/reports -i comprehensive devops/robot-systest/testsuite
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com
-##
-
-
-*** Variables ***
-${token}= ${EMPTY}
-${HOST}= ${EMPTY}
-
-
-*** Keywords ***
-Get Auth Token
- [Tags] auth_token
-
- ${nbi_host}= Get Environment Variable OSM_HOSTNAME
- ${passed}= Run Keyword And Return Status Should Contain ${nbi_host} :
- Run Keyword If ${passed} Set Dockerized Host ${nbi_host}
- ... ELSE Set Standalone Host ${nbi_host}
-
- Create Session osmhit ${HOST} verify=${FALSE} debug=1 headers=${HEADERS}
-
- Log Many ${auth_token_uri} @{data} ${data}
-
- ${resp}= Post Request osmhit ${auth_token_uri} data=${data}
- log ${resp}
-
- Pass Execution If ${resp.status_code} in ${success_status_code_list} Get Auth Token completed
-
- ${content}= To Json ${resp.content}
- ${t}= Get From Dictionary ${content} _id
-
- Set Suite Variable ${token} ${t}
-
-
-Set Dockerized Host
- [Arguments] ${env_host}
-
- Set Suite Variable ${HOST} https://${env_host}
-
-
-Set Standalone Host
- [Arguments] ${env_host}
-
- Set Suite Variable ${HOST} https://${env_host}:9999
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
-##
-
-
-*** Keywords ***
-Create Vim
- [Arguments] ${vim_name} ${account_type} ${auth_url} ${user} ${password} ${tenant} ${description}
-
- &{request_data}= Create Dictionary vim_user=${user} vim_password=${password} vim_url=${auth_url} vim_tenant_name=${tenant} vim_type=${account_type} description=${description} name=${vim_name}
-
- &{headers}= Create Dictionary Authorization=Bearer ${token} Content-Type=application/json Accept=application/json
-
- Create Session osmvim ${HOST} verify=${FALSE} headers=${headers}
-
- LOG ${request_data}
- ${res}= Post Request osmvim ${create_vim_uri} data=${request_data}
- log ${res.content}
- Pass Execution If ${res.status_code} in ${success_status_code_list} Create Vim Request completed
- Get Vim ID ${res.content}
-
-
-Delete Vim
- [Arguments] ${vim_id}
-
- ${uri} = Catenate SEPARATOR=/ ${create_vim_uri} ${vim_id}
- ${resp}= Delete Request osmvim ${uri}
-
- log ${resp.content}
- Pass Execution If ${resp.status_code} in ${success_status_code_list} Delete Vim Request completed
-
-
-Get Vim ID
- [Arguments] ${res}
-
-# log to console ${res}
- ${content}= To Json ${res}
- ${id}= Get From Dictionary ${content} id
- Set Suite Variable ${vim_id} ${id}
- log Vim Id is ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 08-nov-2019
-##
-
-*** Variables ***
-${success_return_code} 0
-${delete_max_wait_time} 1min
-${delete_pol_time} 15sec
-${ns_launch_max_wait_time} 5min
-${ns_launch_pol_time} 30sec
-
-
-*** Keywords ***
-Create NST
- [Documentation] Create nst at osm
- [Arguments] ${nst_pkg}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nst-create ${nst_pkg}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- [Return] ${stdout}
-
-
-Delete NST
- [Documentation] delete nst at osm
- [Arguments] ${nst}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nst-delete ${nst}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- [Return] ${stdout}
-
-
-Launch Network Slice Instance
- [Arguments] ${vim_name} ${nst_name} ${ns_config}=''
-
- ${nsi_name}= GENERATE NAME
- Run Keyword If ${ns_config}!='' Create Network Slice With Config ${nsi_name} ${nst_name} ${vim_name} ${ns_config}
- ... ELSE Create Network Slice Without Config ${nsi_name} ${nst_name} ${vim_name}
-
- WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For Network Slice Instance To Configured ${nsi_name}
- Check For Network Slice Instance For Failure ${nsi_name}
-
-
-Create Network Slice With Config
- [Arguments] ${nsi_name} ${nst_name} ${vim} ${config}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsi-create --nsi_name ${nsi_name} --nst_name ${nst_name} --vim_account ${vim} --config ${config}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Append To List ${nsi_list} ${nsi_name}
-
-
-Create Network Slice Without Config
- [Arguments] ${nsi_name} ${nst_name} ${vim}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsi-create --nsi_name ${nsi_name} --nst_name ${nst_name} --vim_account ${vim}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Append To List ${nsi_list} ${nsi_name}
-
-
-Check For Network Slice Instance For Failure
- [Arguments] ${nsi_name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${nsi_name}"
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} failed
-
-
-Check For Network Slice Instance To Configured
- [Arguments] ${nsi_name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${nsi_name}"
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Contain Any ${stdout} configured failed
-
-
-Delete Network Slice Instance
- [Documentation] Delete ns
- [Arguments] ${nsi}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsi-delete ${nsi}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
- WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NSI Instance To Be Delete ${nsi}
-
-
-Check For NSI Instance To Be Delete
- [Arguments] ${nsi}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsi-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} ${nsi}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-*** Variables ***
-${success_return_code} 0
-${ns_launch_max_wait_time} 5min
-${ns_launch_pol_time} 30sec
-${ns_delete_max_wait_time} 1min
-${ns_delete_pol_time} 15sec
-${nsconfig}
-
-*** Keywords ***
-Get NS List
- [Documentation] Get ns instance list
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Get NS Instance ID
- [Arguments] ${ns_name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}" | awk 'NR==4{print $4}'
- log ${stdout}
- [Return] ${stdout}
-
-
-Verify All JUJU Applications Status
- [Arguments] ${ns} ${api_ip} ${api_port} ${username} ${password} ${api_cert_path}
-
- ${juju_model}= Get NS Instance ID ${ns}
-
- Import Library robot_juju.JujuLibrary ${api_ip} ${api_port} ${juju_model} ${username} ${password} ${api_cert_path}
- Assert status of applications is ${status_active}
-
-
-Launch Network Services and Return
- [Arguments] ${vim_name} ${ns_config}=''
- [Documentation] Get Configuration parameter to create Newtork service
-
- Run Keyword If ${ns_config}=='' Get NS Config
- ... ELSE Set NS Config ${ns_config}
- Log To Console \n${nsconfig}
- Should Not Be Empty ${nsd_ids} There are no NS descriptors to launch the NS
- :FOR ${nsd} IN @{nsd_ids}
- \ ${ns_name}= GENERATE NAME
- \ Append To List ${ns_ids} ${ns_name}
- \ Create Network Service ${nsd} ${vim_name} ${ns_name} ${nsconfig}
-
-
-Set NS Config
- [Arguments] ${ns_config}
- [Documentation] Set NS Configuration variable
-
- ${nsconfig}= Get Variable Value ${ns_config} ''
- Set Test Variable ${nsconfig}
-
-
-Get NS Config
- [Documentation] Get NS Configuration from Environment Variable
-
- ${nsconfig}= Get Environment Variable NS_CONFIG ''
- Set Test Variable ${nsconfig}
-
-
-Create Network Service
- [Documentation] Create ns at osm
- [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config}
-
- Run Keyword If ${ns_config}!='' Create Network Service With Config ${nsd} ${vim_name} ${ns_name} ${ns_config}
- ... ELSE Create Network Service Without Config ${nsd} ${vim_name} ${ns_name}
-
- WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For NS Instance To Configured ${ns_name}
- Check For NS Instance For Failure ${ns_name}
-
-
-Create Network Service Without Config
- [Documentation] Create ns at osm
- [Arguments] ${nsd} ${vim_name} ${ns_name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Create Network Service With Config
- [Documentation] Create ns at osm
- [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config}
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name} --config ${ns_config}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Delete NS
- [Documentation] Delete ns
- [Arguments] ${ns}
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
- WAIT UNTIL KEYWORD SUCCEEDS ${ns_delete_max_wait_time} ${ns_delete_pol_time} Check For NS Instance To Be Delete ${ns}
-
-
-Check For NS Instance To Configured
- [Arguments] ${ns_name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}"
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Contain Any ${stdout} READY BROKEN
-
-
-Check For NS Instance For Failure
- [Arguments] ${ns_name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}"
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} BROKEN
-
-
-Check For NS Instance To Be Delete
- [Arguments] ${ns}
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} ${ns}
-
-
-Force Delete NS
- [Documentation] Forcely Delete ns
- [Arguments] ${ns}
-
- ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- WAIT UNTIL KEYWORD SUCCEEDS ${ns_delete_max_wait_time} ${ns_delete_pol_time} Check For NS Instance To Be Delete ${ns}
-
-
-Perform VNF Scale-in Operation
- [Arguments] ${ns} ${vnf_member} ${scaling_group}
-
- ${rc} ${nsr}= Run and Return RC and Output osm ns-show ${ns} --literal
- ${scaled_vnf}= Get Scaled Vnf ${nsr}
- log to console Scaled VNF befor scale-in operation is ${scaled_vnf}
- ${rc} ${stdout}= Run and Return RC and Output osm vnf-scale --scale-in --scaling-group ${scaling_group} ${ns} ${vnf_member}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- Sleep 1m Waiting for scale-in operation to complete
- ${rc} ${nsr}= Run and Return RC and Output osm ns-show ${ns} --literal
- ${scaled_vnf}= Get Scaled Vnf ${nsr}
- log to console Scaled VNF after scale-in operation is ${scaled_vnf}
-
-
-Perform VNF Scale-out Operation
- [Arguments] ${ns} ${vnf_member} ${scaling_group}
-
- ${rc} ${nsr}= Run and Return RC and Output osm ns-show ${ns} --literal
- ${scaled_vnf}= Get Scaled Vnf ${nsr}
- log to console Scaled VNF befor scale-out operation is ${scaled_vnf}
- ${rc} ${stdout}= Run and Return RC and Output osm vnf-scale --scale-out --scaling-group ${scaling_group} ${ns} ${vnf_member}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- Sleep 1m Waiting for scale-out operation to complete
- ${rc} ${nsr}= Run and Return RC and Output osm ns-show ${ns} --literal
- ${scaled_vnf}= Get Scaled Vnf ${nsr}
- log to console Scaled VNF befor scale-out operation is ${scaled_vnf}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
-##
-
-*** Variables ***
-${success_return_code} 0
-${delete_max_wait_time} 1min
-${delete_pol_time} 15sec
-
-
-*** Keywords ***
-Get NSDs List
- [Documentation] Get nsds list
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsd-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Create NSD
- [Documentation] Create nsd at osm
- [Arguments] ${nsd_pkg}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsd-create ${nsd_pkg}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- [Return] ${stdout}
-
-
-Delete NSD
- [Documentation] Delete nsd
- [Arguments] ${nsd_id}
-
- # For timebeing exception thrown by nsd-delete api was ignor because nsd was deleted successfully. The cause of exception is need to debug further
- ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm nsd-delete ${nsd_id}
- log ${stdout}
-# Should Be Equal As Integers ${rc} ${success_return_code}
- WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NSD ${nsd_id}
-
-
-Check For NSD
- [Arguments] ${nsd_id}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsd-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} ${nsd_id}
-
-
-Force Delete NSD
- [Documentation] Forcely Delete nsd
- [Arguments] ${nsd_id}
-
- ${rc} ${stdout}= Run and Return RC and Output osm nsd-delete ${nsd_id}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Build NS Descriptor
- [Documentation] Build NS Descriptor from the descriptor-packages
- [Arguments] ${nsd path}
-
- ${rc} ${stdout}= Run and Return RC and Output make -C '${CURDIR}${/}../../..${nsd path}'
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
+++ /dev/null
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 18-Dec-2019
-##
-
-*** Keywords ***
-Create OSM NS Package
- [Arguments] ${pkg_name}
- ${ns_pkg}= Catenate SEPARATOR=_ ${pkg_name} ns
- ${ns_yaml}= Catenate SEPARATOR=_ ${pkg_name} nsd
- ${ns_yaml}= Catenate SEPARATOR=. ${ns_yaml} yaml
- ${nsd_path}= Join Path ${ns_pkg} ${ns_yaml}
- ${rc} ${stdout}= Run and Return RC and Output osm package-create ns ${pkg_name}
- Should Be Equal As Integers ${rc} ${success_return_code}
- File Should Exist ${nsd_path}
- log ${stdout}
-
-
-Create OSM VNF Package
- [Arguments] ${pkg_name}
- ${vnf_pkg}= Catenate SEPARATOR=_ ${pkg_name} vnf
- ${vnf_yaml}= Catenate SEPARATOR=_ ${pkg_name} vnfd
- ${vnf_yaml}= Catenate SEPARATOR=. ${vnf_yaml} yaml
- ${vnfd_path}= Join Path ${vnf_pkg} ${vnf_yaml}
- ${rc} ${stdout}= Run and Return RC and Output osm package-create vnf ${pkg_name}
- Should Be Equal As Integers ${rc} ${success_return_code}
- File Should Exist ${vnfd_path}
- log ${stdout}
-
-
-Validate OSM NS Package
- [Arguments] ${pkg_name}
- ${ns_pkg}= Catenate SEPARATOR=_ ${pkg_name} ns
- ${rc} ${stdout}= Run and Return RC and Output osm package-validate ${ns_pkg}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Verify Package Validation Result ${ns_pkg}
- log ${stdout}
-
-
-Validate OSM VNF Package
- [Arguments] ${pkg_name}
- ${vnf_pkg}= Catenate SEPARATOR=_ ${pkg_name} vnf
- ${rc} ${stdout}= Run and Return RC and Output osm package-validate ${vnf_pkg}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Verify Package Validation Result ${vnf_pkg}
- log ${stdout}
-
-
-Verify Package Validation Result
- [Arguments] ${pkg}
- ${rc} ${stdout}= Run and Return RC and Output osm package-validate ${pkg} | awk 'NR==6{print $6}'
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} ERROR
- log ${stdout}
-
-
-Build OSM VNF Package
- [Arguments] ${pkg_name}
- ${vnf_pkg}= Catenate SEPARATOR=_ ${pkg_name} vnf
- ${vnf_pkg_tar}= Catenate SEPARATOR=. ${vnf_pkg} tar gz
- ${rc} ${stdout}= Run and Return RC and Output osm package-build ${vnf_pkg}
- Should Be Equal As Integers ${rc} ${success_return_code}
- File Should Exist ${vnf_pkg_tar}
- log ${stdout}
-
-
-Build OSM NS Package
- [Arguments] ${pkg_name}
- ${ns_pkg}= Catenate SEPARATOR=_ ${pkg_name} ns
- ${ns_pkg_tar}= Catenate SEPARATOR=. ${ns_pkg} tar gz
- ${rc} ${stdout}= Run and Return RC and Output osm package-build ${ns_pkg}
- Should Be Equal As Integers ${rc} ${success_return_code}
- File Should Exist ${ns_pkg_tar}
- log ${stdout}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 08-nov-2019
-##
-
-
-*** Variables ***
-${success_return_code} 0
-${er_replicas} 0/1
-
-
-*** Keywords ***
-Check If OSM Working
-
- ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- ${rc} ${stdout}= Run and Return RC and Output osm vim-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Check All Service Are Running
-
- ${rc} ${stdout}= Run and Return RC and Output docker service ls
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} ${er_replicas}
-
-
-Kill Docker Container
- [Arguments] ${name}
-
- ${rc} ${stdout}= Run and Return RC and Output docker rm -f \$(docker ps |grep -i ${name}|awk '{print $1}')
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
\ No newline at end of file
+++ /dev/null
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 21-nov-2019
-##
-
-*** Keywords ***
-Configure NBI For RBAC
- ${rc} ${stdout}= Run and Return RC and Output docker service update osm_nbi --force --env-add OSMNBI_AUTHENTICATION_BACKEND=keystone --env-add OSMNBI_AUTHENTICATION_AUTH_URL=keystone --env-add OSMNBI_AUTHENTICATION_AUTH_PORT=5000 --env-add OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME=default --env-add OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME=default --env-add OSMNBI_AUTHENTICATION_SERVICE_USERNAME=nbi --env-add OSMNBI_AUTHENTICATION_SERVICE_PROJECT=service
- Should Be Equal As Integers ${rc} ${success_return_code}
- Sleep 30s Wait for NBI service to be update
-
-
-Create User
- [Arguments] ${user} ${password}
-
- ${rc} ${stdout}= Run and Return RC and Output osm user-create ${user} --password ${password}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-List User
- ${rc} ${stdout}= Run and Return RC and Output osm user-list
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-List User And Check For The Created User
- [Arguments] ${user}
- ${user list}= List User
- Should Contain ${user list} ${user}
-
-
-Get User Info By Name
- [Arguments] ${user_name}
- ${rc} ${stdout}= Run and Return RC and Output osm user-show ${user_name}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
-
-
-Get User Info By ID
- [Arguments] ${user_id}
- ${rc} ${stdout}= Run and Return RC and Output osm user-show ${user_id}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
-
-
-Update User
- [Arguments] ${user} ${field} ${value}
- ${rc} ${stdout}= Run and Return RC and Output osm user-update ${field} ${value} ${user}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
-
-
-Update User And Verify Info
- [Arguments] ${user} @{args}
- FOR ${arg} IN @{args}
- ${fields}= Get Dictionary Items ${arg}
- Update User ${user} ${fields[0]} ${fields[1]}
- END
- ${rc} ${stdout}= Run and Return RC and Output osm user-show ${user}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
-
-
-Login With User And Perform Operation
- [Arguments] ${user} ${password} ${project}
- ${rc} ${stdout}= Run and Return RC and Output export OSM_USER=${user}
- Should Be Equal As Integers ${rc} ${success_return_code}
- ${rc} ${stdout}= Run and Return RC and Output export OSM_PROJECT=${project}
- Should Be Equal As Integers ${rc} ${success_return_code}
- ${rc} ${stdout}= Run and Return RC and Output export OSM_PASSWORD=${password}
- Should Be Equal As Integers ${rc} ${success_return_code}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- Logout and Login With Admin
-
-
-Logout and Login With Admin
- ${rc} ${stdout}= Run and Return RC and Output export OSM_USER=admin
- Should Be Equal As Integers ${rc} ${success_return_code}
- ${rc} ${stdout}= Run and Return RC and Output export OSM_PASSWORD=admin
- Should Be Equal As Integers ${rc} ${success_return_code}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Delete User
- [Arguments] ${user}
- ${rc} ${stdout}= Run and Return RC and Output osm user-delete ${user}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Delete User And Check
- [Arguments] ${user}
- Delete User ${user}
- ${rc} ${stdout}= Run and Return RC and Output osm user-list
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} ${user}
-
-
-Create Project
- [Arguments] ${project}
- ${rc} ${stdout}= Run and Return RC and Output osm project-create ${project}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-List Project
- ${rc} ${stdout}= Run and Return RC and Output osm project-list
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-List Project And Verify
- [Arguments] ${project}
- ${project list}= List Project
- Should Contain ${project list} ${project}
-
-
-Get Project Info By Name
- [Arguments] ${project_name}
- ${rc} ${stdout}= Run and Return RC and Output osm project-show ${project_name}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-Get Project Info By ID
- [Arguments] ${project_id}
- ${rc} ${stdout}= Run and Return RC and Output osm project-show ${project_id}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-Update Project
- [Arguments] ${project} ${feild} ${value}
- ${rc} ${stdout}= Run and Return RC and Output osm project-update ${feild} ${value} ${project}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
-
-
-Update Project Name And Verify
- [Arguments] ${old_name} ${new_name}
- Update Project ${old_name} --name ${new_name}
- List Project And Verify ${new_name}
-
-
-Delete Project
- [Arguments] ${project}
- ${rc} ${stdout}= Run and Return RC and Output osm project-delete ${project}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Delete Project And Verify
- [Arguments] ${project}
- Delete Project ${project}
- ${project_list}= List Project
- Should Not Contain ${project_list} ${project}
-
-
-Create Role
- [Arguments] ${role}
- ${rc} ${stdout}= Run and Return RC and Output osm role-create ${role}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-List Roles
- ${rc} ${stdout}= Run and Return RC and Output osm role-list
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-List Roles And Verify
- [Arguments] ${role}
- ${role_list}= List Roles
- Should Contain ${role_list} ${role}
-
-
-Get Role Info By Name
- [Arguments] ${role}
- ${rc} ${stdout}= Run and Return RC and Output osm role-show ${role}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-Get Role Info By ID
- [Arguments] ${role_id}
- ${rc} ${stdout}= Run and Return RC and Output osm role-show ${role_id}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
- [Return] ${stdout}
-
-
-Update Role
- [Arguments] ${role} ${feild} ${value}
- ${rc} ${stdout}= Run and Return RC and Output osm role-update ${feild} ${value} ${role}
- Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
-
-
-Add Role And Verify
- [Arguments] ${role} ${role_to_add}
- Update Role ${role} --add ${role_to_add}
- ${role_info}= Get Role Info By Name ${role}
-# Should Contain ${role_info} ${role_to_add}
-
-
-Delete Role
- [Arguments] ${role}
- ${rc} ${stdout}= Run and Return RC and Output osm role-delete ${role}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Delete Role And Verify
- [Arguments] ${role}
- Delete Role ${role}
- ${role_list}= List Roles
- Should Not Contain ${role_list} ${role}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-
-*** Variables ***
-${success_return_code} 0
-${name} "OpenSite"
-${user} "admin"
-${password} "admin"
-${ip} "1.1.1.1"
-${type} "onos"
-${port} "5858"
-${dpid} "a7:2f:aa:be:C3:c1:fe:C9"
-
-
-*** Keywords ***
-Create SDNC Account
- [Documentation] create new sdnc account
-
- ${rc} ${stdout}= Run and Return RC and Output osm sdnc-create --name ${name} --type ${type} --ip_address ${ip} --user ${user} --password ${password} --port ${port} --switch_dpid ${dpid}
- log ${rc}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Get SDNC List
- [Documentation] Get a sdnc account list
-
- ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list
- log ${stdout}
-
-
-Show SDNC Account
- [Documentation] Get sdnc account details
-
- ${rc} ${stdout}= Run and Return RC and Output osm sdnc-show ${name}
- log ${rc}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Delete SDNC Account
- [Documentation] Get sdnc account details
-
- ${rc} ${stdout}= Run and Return RC and Output osm sdnc-delete ${name}
- log ${rc}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
-##
-
-*** Settings ***
-Library OperatingSystem
-Library String
-Library Collections
-Library ../custom_lib.py
-
-
-*** Variables ***
-${success_return_code} 0
-${user} "robottest"
-${password} "fred"
-${authurl} "https://127.0.0.1/"
-${type} "openstack"
-${desc} "a test vim"
-${tenant} "robottest2"
-
-
-*** Keywords ***
-Create Vim Account
- [Documentation] Create a new vim account
-
- ${vim-name}= Generate Random String 8 [NUMBERS]
- ${vim-name}= Catenate SEPARATOR= vim_ ${vim-name}
- set global variable ${vim-name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${vim-name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Get Vim List
- [Documentation] Get a vim account list
-
- ${rc} ${stdout}= Run and Return RC and Output osm vim-list
- log ${stdout}
- Log To Console ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Delete Vim Account
- [Documentation] delete vim account details
- [Arguments] ${vim_name}=${vim-name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm vim-delete ${vim_name}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-VIM Setup To Launch Network Services
- [Documentation] Setup a VIM to launch network services
-
- set global variable @{vim}
- ${vmware_url}= Get Environment Variable VCD_AUTH_URL ${EMPTY}
- ${openstack_url}= Get Environment Variable OS_AUTH_URL ${EMPTY}
- ${vmware_vim}= Run Keyword And Return If '${vmware_url}'!='${EMPTY}' Setup Vmware Vim ${vmware_url} 'vmware' 'pytest system test'
- ${openstack_vim}= Run Keyword And Return If '${openstack_url}'!='${EMPTY}' Setup Openstack Vim ${openstack_url} 'openstack' 'pytest system test'
- Should Not Be Empty ${vim} VIM details not provided
- Log Many @{vim}
-
-
-Setup Openstack Vim
- [Documentation] Openstack Vim Account Setup
- [Tags] vim-setup
- [Arguments] ${authurl} ${type} ${desc}
-
- ${user}= Get Environment Variable OS_USERNAME ''
- ${password}= Get Environment Variable OS_PASSWORD ''
- ${tenant}= Get Environment Variable OS_PROJECT_NAME ''
- ${vim-config}= Get Environment Variable OS_VIM_CONFIG ''
- ${vim_name}= GENERATE NAME
-
- ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${vim_name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc} --config ${vim-config}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Sleep 30s Wait for to get vim ready
- ${rc} ${vim_detail}= Run and Return RC and Output osm vim-show ${vim_name}
- Should Contain ${vim_detail} "operationalState": "ENABLED" msg=Openstack vim is not available values=False
- Append To List ${vim} ${stdout}
-
- [Return] ${stdout}
-
-
-Setup Vmware Vim
- [Documentation] Vmware Vim Account Setup
- [Tags] vim-setup
- [Arguments] ${authurl} ${type} ${desc}
-
- ${user}= Get Environment Variable VCD_USERNAME ''
- ${password}= Get Environment Variable VCD_PASSWORD ''
- ${tenant}= Get Environment Variable VCD_TENANT_NAME ''
- ${vcd-org}= Get Environment Variable VCD_ORGANIZATION ''
- ${vim-config}= Get Environment Variable VCD_VIM_CONFIG ''
- ${vim_name}= GENERATE NAME
-
- ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${vim_name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc} --config ${vim-config}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Sleep 30s Wait for to get vim ready
- ${rc} ${vim_detail}= Run and Return RC and Output osm vim-show ${vim_name}
- Should Contain ${vim_detail} "operationalState": "ENABLED" msg=VMWare VCD vim is not available values=False
- Append To List ${vim} ${stdout}
-
- [Return] ${stdout}
-
-
-Force Delete Vim Account
- [Documentation] delete vim account details
- [Arguments] ${vim_name}
-
- ${rc} ${stdout}= Run and Return RC and Output osm vim-delete ${vim_name}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
-##
-
-*** Variables ***
-${success_return_code} 0
-${delete_max_wait_time} 1min
-${delete_pol_time} 15sec
-
-
-*** Keywords ***
-Get VNFDs List
- [Documentation] Get vnfds list
-
- ${rc} ${stdout}= Run and Return RC and Output osm vnfd-list
- log ${stdout}
- log ${rc}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Create VNFD
- [Documentation] Create vnfd at osm
- [Arguments] ${vnfd_pkg}
-
- ${rc} ${stdout}= Run and Return RC and Output osm vnfd-create ${vnfd_pkg}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- [Return] ${stdout}
-
-
-Delete VNFD
- [Documentation] Delete vnfd
- [Arguments] ${vnfd_id}
-
- ${rc} ${stdout}= Run and Return RC and Output osm vnfd-delete ${vnfd_id}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id}
-
-
-Check For VNFD
- [Arguments] ${vnfd_id}
-
- ${rc} ${stdout}= Run and Return RC and Output osm vnfd-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Contain ${stdout} ${vnfd_id}
-
-
-Force Delete VNFD
- [Documentation] Forcely Delete vnfd
- [Arguments] ${vnfd_id}
-
- ${rc} ${stdout}= Run and Return RC and Output osm vnfd-delete ${vnfd_id}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Build VNF Descriptor
- [Documentation] Build VNF Descriptor from the descriptor-packages
- [Arguments] ${vnfd path}
-
- ${rc} ${stdout}= Run and Return RC and Output make -C '${CURDIR}${/}../../..${vnfd path}'
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
+++ /dev/null
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-
-from osmclient import client
-from robot.api import logger
-import json
-
-
-class ClientLib:
- def __init__(self, host="127.0.0.1", user=None, password=None, project=None):
-
- kwargs = {}
- if user is not None:
- kwargs['user'] = user
- if password is not None:
- kwargs['password'] = password
- if project is not None:
- kwargs['project'] = project
- self.client = client.Client(host=host, sol005=True, **kwargs)
-
- def get_vim_list(self):
- resp = self.client.vim.list()
- logger.info('VIM List: {}'.format(resp))
- return json.dumps(resp)
-
- def create_vim_account(self, name, vim_type, user, password, auth_url, tenant, desc='', config=None):
- vim_access = {}
- if config is not None:
- vim_access['config'] = config
- vim_access['vim-type'] = vim_type
- vim_access['vim-username'] = user
- vim_access['vim-password'] = password
- vim_access['vim-url'] = auth_url
- vim_access['vim-tenant-name'] = tenant
- vim_access['description'] = desc
-
- resp = self.client.vim.create(name, vim_access)
- logger.info('Create VIM Account: {}'.format(resp))
- return json.dumps(resp)
-
- def delete_vim_account(self, name):
- resp = self.client.vim.delete(name)
- return json.dumps(resp)
-
- def get_vnfd_list(self):
- resp = self.client.vnfd.list()
- logger.info('VNF Descriptor List: {}'.format(resp))
- return json.dumps(resp)
-
- def get_nsd_list(self):
- resp = self.client.nsd.list()
- logger.info('NS Descriptor List: {}'.format(resp))
- return json.dumps(resp)
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com
-##Ì¥
-
-
-import random
-from haikunator import Haikunator
-import yaml
-from os.path import basename
-import hashlib
-
-from robot.api import logger
-from robot.api.deco import keyword
-
-
-def generate_name():
- haikunator = Haikunator()
- name = haikunator.haikunate(delimiter='_', token_length=2)
- return name
-
-
-def get_random_item_from_list(l):
- assert isinstance(l, list), "List should be provided"
- return random.choice(l)
-
-
-def get_scaled_vnf(nsr):
- nsr = yaml.load(nsr)
- if 'scaling-group' in nsr['_admin']:
- return nsr['_admin']['scaling-group'][0]['nb-scale-op']
- else:
- return 0
-
-
-@keyword('Get File Name From Path')
-def get_filename(path):
- filename = basename(path)
- return filename, filename.split('.')[0]
-
-
-@keyword('Generate MD5')
-def generate_md5(fpath):
- hash_md5 = hashlib.md5()
- with open(fpath, "rb") as f:
- for chunk in iter(lambda: f.read(1024), b""):
- hash_md5.update(chunk)
- return hash_md5.hexdigest()
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-*** Variables ***
-${DESIRED_CAPABILITIES} desired_capabilities
-${BROWSER} Chrome
-${DELAY} 0
-${VALID USER} admin
-${VALID PASSWORD} admin
-${LOGIN URL} /auth/
-${WELCOME URL} /projects/
-${NS LIST URL} /packages/ns/list
-${VNF LIST URL} /packages/vnf/list
-
-
-*** Keywords ***
-Set Server URL
- ${env_host}= Get Environment Variable OSM_HOSTNAME
- ${passed}= Run Keyword And Return Status Should Contain ${env_host} :
- Run Keyword If ${passed} Set Dockerized Host
- ... ELSE Set Standalone Host ${env_host}
-
-
-Open Browser To Login Page
- ${chrome_options} = Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
- Call Method ${chrome_options} add_argument headless
- Call Method ${chrome_options} add_argument disable-gpu
- Call Method ${chrome_options} add_argument no-sandbox
- ${options}= Call Method ${chrome_options} to_capabilities
- Open Browser ${SERVER}${LOGIN URL} ${BROWSER} desired_capabilities=${options}
- Maximize Browser Window
- Set Selenium Speed ${DELAY}
- Login Page Should Be Open
-
-
-Login Page Should Be Open
- Element Text Should Be //*[@id="main_content"]/div/div[2]/p Sign in to start your session
-
-
-Enter Credentials
- [Arguments] ${username} ${password}
- Input Text name:username ${username}
- Input Password name:password ${password}
-
-
-Submit Credentials
- Click Button //*[@id="main_content"]/div/div[2]/form/div[3]/div[2]/button
-
-
-Home Page Should Be Open
- Location Should Be ${SERVER}${WELCOME URL}
-# Element Should Contain id:title_header 6e3a8415-9014-4100-9727-90e0150263be ignore_case=True
- Element Attribute Value Should Be //*[@id="main_content"]/div/div[2]/div[1]/div[1]/div/a href ${SERVER}${NS LIST URL}
- Element Attribute Value Should Be //*[@id="main_content"]/div/div[2]/div[1]/div[2]/div/a href ${SERVER}${VNF LIST URL}
-
-
-Set Dockerized Host
-
- Set Suite Variable ${SERVER} http://light-ui
-
-
-Set Standalone Host
- [Arguments] ${env_host}
-
- Set Suite Variable ${SERVER} http://${env_host}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com
-##
-
-
-*** Variables ***
-&{HEADERS} Content-Type=application/json Accept=application/json
-&{data} username=admin password=admin project-id=admin
-@{success_status_code_list} 200 201 202 204
-
-${descriptor_content_type_gzip} application/gzip
-
-${auth_token_uri} /osm/admin/v1/tokens
-
-${get_all_vnfd_uri} /osm/vnfpkgm/v1/vnf_packages
-${create_vnfd_uri} /osm/vnfpkgm/v1/vnf_packages_content
-${delete_vnfd_uri} /osm/vnfpkgm/v1/vnf_packages
-
-${get_all_nsd_uri} /osm/nsd/v1/ns_descriptors
-${create_nsd_uri} /osm/nsd/v1/ns_descriptors_content
-${delete_nsd_uri} /osm/nsd/v1/ns_descriptors
-
-${base_ns_uri} /osm/nslcm/v1/ns_instances_content
-${create_ns_uri} /osm/nslcm/v1/ns_instances_content
-
-${create_vim_uri} /osm/admin/v1/vim_accounts
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
-##
-
-
-# Create/Delete Vim Account
-vim_name = 'API-TEST-VIM'
-account_type = 'openstack'
-auth_url = 'http://127.0.0.1:5000/v3'
-user = 'admin'
-password = 'admin'
-tenant = 'admin'
-description = 'Test OpenStack Vim Account'
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2020 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-# Author: Mrityunjay Yadav < MY00514913@techmahindra.com >, Jayant Madavi
-##
-
-
-# VNFD Details
-vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_basic_vnf"
-vnfdPckg = '/build/hackfest_basic_vnf.tar.gz'
-
-# NSD Details
-nsdPckgPath = "/descriptor-packages/nsd/no_port_security_ns"
-nsdPckg = '/build/no_port_security_ns.tar.gz'
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-# VNFD Details
-vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_basic_vnf"
-vnfdPckg = '/build/hackfest_basic_vnf.tar.gz'
-
-# NSD Details
-nsdPckgPath = "/descriptor-packages/nsd/hackfest_basic_ns"
-nsdPckg = '/build/hackfest_basic_ns.tar.gz'
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-# VNFD Details
-vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_cloudinit_vnf"
-vnfdPckg = '/build/hackfest_cloudinit_vnf.tar.gz'
-
-# NSD Details
-nsdPckgPath = "/descriptor-packages/nsd/hackfest_cloudinit_ns"
-nsdPckg = '/build/hackfest_cloudinit_ns.tar.gz'
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-# VNFD Details
-vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_epasriov_vnf"
-vnfdPckg = '/build/hackfest_epasriov_vnf.tar.gz'
-
-# NSD Details
-nsdPckgPath = "/descriptor-packages/nsd/hackfest_epasriov_ns"
-nsdPckg = '/build/hackfest_epasriov_ns.tar.gz'
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-# VNFD Details
-vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_multivdu_vnf"
-vnfdPckg = '/build/hackfest_multivdu_vnf.tar.gz'
-
-# NSD Details
-nsdPckgPath = "/descriptor-packages/nsd/hackfest_multivdu_ns"
-nsdPckg = '/build/hackfest_multivdu_ns.tar.gz'
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-# VNFD Details
-vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_simplecharm_vnf"
-vnfdPckg = '/build/hackfest_simplecharm_vnf.tar.gz'
-
-# NSD Details
-nsdPckgPath = "/descriptor-packages/nsd/hackfest_simplecharm_ns"
-nsdPckg = '/build/hackfest_simplecharm_ns.tar.gz'
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com
-##
-
-
-# VNFD Details
-vnfdPckgPath = "/descriptor-packages/vnfd/cirros_vnf"
-vnfdPckg = '/build/cirros_vnf.tar.gz'
-
-# NSD Details
-nsdPckgPath = "/descriptor-packages/nsd/cirros_ns"
-nsdPckg = '/build/cirros_ns.tar.gz'
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 TATA ELXSI
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-##
-# Author: Ragavi D (ragavi.d@tataelxsi.co.in)
-
-# VNFD Details
-vnfdPckgPath = "/descriptor-packages/vnfd/ubuntu-cloudinit_vnf"
-vnfdPckg = '/build/ubuntu-cloudinit_vnf.tar.gz'
-
-# NSD Details
-nsdPckgPath = "/descriptor-packages/nsd/ubuntu-cloudinit_ns"
-nsdPckg = '/build/ubuntu-cloudinit_ns.tar.gz'
+++ /dev/null
-#!/usr/bin/env bash
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-Sep-2019
-# Entry script to start the vim, smoke, openstack_stage_4 and comprehensive test using Robot Framework as a Automation Test Framework
-##
-
-BASEDIR=$(dirname "$0")
-TOPDIR=$(dirname "$BASEDIR")
-DESCRIPTOR_DIR=$TOPDIR/descriptor-packages
-
-
-robot_prerequisite(){
- echo -e "\nInstalling robot requirements"
- # installing python packages
- pip install haikunator requests robotframework robotframework-seleniumlibrary robotframework-requests robotframework-jsonlibrary
-}
-
-while getopts ":t:-:" o; do
- case "${o}" in
- t)
- TEST=${OPTARG}
- ;;
- -)
- [[ "${OPTARG}" == "do_install" ]] && robot_prerequisite && continue
- ;;
- \?)
- echo -e "Invalid option: '-$OPTARG'\n" >&2
- exit 1
- ;;
- esac
-done
-
-if [[ -z $TEST ]]; then
- printf "Test not provided. \nRunning default test: smoke\n"
- TEST="smoke"
-fi
-
-if [[ "$TEST" == "vim" ]]; then
- echo "Robot Framework Vim Test"
- robot -d $BASEDIR/reports -i vim $BASEDIR/testsuite/
- exit 0
-elif [[ "$TEST" == "smoke" ]]; then
- echo "Robot Framework SMOKE test"
- robot --removekeywords tag:vim-setup --removekeywords WUKS -d $BASEDIR/reports -i smoke $BASEDIR/testsuite/
- exit 0
-elif [[ "$TEST" == "sanity" ]]; then
- echo "Robot Framework Cirros VNF Test"
- mkdir -p $BASEDIR/images/cache
- if [[ ! -z $OS_AUTH_URL ]]; then
- (openstack image show cirros-0.3.5-x86_64-disk.img) || (wget -r -nc http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img -O $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img && make $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img && openstack image create --file $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img cirros-0.3.5-x86_64-disk.img)
- fi
- if [[ ! -z $VCD_AUTH_URL ]]; then
-# TODO: Check for image over VIM before downloading
- if [[ ! -s $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img ]]; then
- wget -r -nc http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img -O $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img
- fi
- ovf_converter $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img -n cirros
- python $TOPDIR/tools/vmware_ovf_upload.py $VCD_AUTH_URL $VCD_USERNAME $VCD_PASSWORD $VCD_ORGANIZATION $BASEDIR/images/cache/cirros.ovf
- fi
- robot --removekeywords tag:vim-setup --removekeywords WUKS -d $BASEDIR/reports -i sanity $BASEDIR/testsuite/
- exit 0
-elif [[ "$TEST" == "comprehensive" ]]; then
- echo "Robot Framework Comprehensive Test"
- echo "Installing chrome driver and chrome for UI testing"
- # installing chrome driver and chrome for UI testing
- curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
- apt-get update && apt-get -y install google-chrome-stable chromium-chromedriver
- echo "Checking of image over VIMs"
- mkdir -p $BASEDIR/images/cache
- if [[ ! -z $OS_AUTH_URL ]]; then
- (openstack image show ubuntu1604) || (wget -r -nc https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img -O $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img && make $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img && openstack image create --file $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img ubuntu1604)
- (openstack image show hackfest3-mgmt) || (wget -r -nc https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img -O $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img && make $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img && openstack image create --file $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img hackfest3-mgmt)
- fi
- if [[ ! -z $VCD_AUTH_URL ]]; then
-# TODO: Check for image over VIM before downloading
- if [[ ! -s $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img ]]; then
- wget -r -nc https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img -O $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img
- fi
- ovf_converter $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img -n ubuntu1604
- python $TOPDIR/tools/vmware_ovf_upload.py $VCD_AUTH_URL $VCD_USERNAME $VCD_PASSWORD $VCD_ORGANIZATION $BASEDIR/images/cache/ubuntu1604.ovf
- fi
- robot --removekeywords tag:vim-setup --removekeywords WUKS -d $BASEDIR/reports -i comprehensive $BASEDIR/testsuite/
- exit 0
-else
- echo "wrong test provided"
- exit 1
-fi
-
-exit 1
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-*** Settings ***
-Documentation Test Suite to create and delete vim account
-Library Collections
-Library RequestsLibrary
-Library OperatingSystem
-Resource ../../lib/api/common.robot
-Resource ../../lib/api/vim_lib.robot
-Resource ../../resource/api/common.robot
-Variables ../../resource/api/variables.py
-
-Suite Setup Get Auth Token
-Suite Teardown Delete All Sessions
-
-
-*** Variables ***
-${vim_id} ${EMPTY}
-
-
-*** Test Cases ***
-Create Vim Account
- [Tags] comprehensive api_vim_test
- [Template] Create Vim
- ${vim name} ${account type} ${auth url} ${user} ${password} ${tenant} ${description}
-
-
-Delete Vim Account
- [Tags] comprehensive api_vim_test
- [Template] Delete Vim
- ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-
-*** Settings ***
-Documentation Test suiet to create/delete sdnc account via osmclient
-Library OperatingSystem
-Library Collections
-Resource ../../lib/cli/sdnc_account_lib.robot
-
-
-*** Test Cases ***
-Create SDNC Account Test
- [Tags] sdnc
-
- Create SDNC Account
-
-
-Get SDNC Accounts List Test
- [Tags] sdnc
-
- Get SDNC List
-
-
-Delete SDNC Account Test
- [Tags] sdnc
-
- Delete SDNC Account
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 08-nov-2019 : network slicing test library
-##
-
-
-*** Settings ***
-Documentation Test Suite to create hackfest basic nestwork service
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Resource ../../lib/cli/network_slicing_lib.robot
-Library ../../lib/custom_lib.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-${vnfd_id}
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-${nst_id}
-@{nsi_list}
-${vnfdPckg} slice_hackfest_vnfd.tar.gz
-${nsdPckg} slice_hackfest_nsd.tar.gz
-${nstPckg} slice_hackfest_nst.yaml
-${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_vnfd.tar.gz
-${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_nsd.tar.gz
-${nstftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_nst.yaml
-${nst_config} '{netslice-vld: [{name: mgmtnet, vim-network-name: mgmt}]}'
-
-
-*** Test Cases ***
-Create Slice Hackfest VNF Descriptor
- [Tags] slice_hackfest comprehensive
- [Documentation] Create Slice Hackfest VNF Descriptor Test
-
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${vnfdftpPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/slice${/}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create Slice Hackfest NS Descriptor
- [Tags] slice_hackfest comprehensive
- [Documentation] Create Slice Hackfest NS Descriptor Test
-
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${nsdftpPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../resource/cli/slice${/}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Create Slice Hackfest Network Slice Template
- [Tags] slice_hackfest comprehensive
- [Documentation] Create Slice Hackfest Network Slice Template Test
-
-# set suite variable ${nst_id}
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${nstftpPath}
- ${nst_id}= Create NST '${CURDIR}${/}../../resource/cli/slice${/}${nstPckg}'
- Set Suite Variable ${nst_id}
-
-
-Instanciate Network Slice
- [Tags] slice_hackfest comprehensive
- [Documentation] Instantiate Network Slice Test
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Slice Instance ${vim_name} ${nst_id} ${nst_config}
-
-
-Terminate Network Slice Instance
- [Tags] slice_hackfest comprehensive
- [Documentation] Terminate Network Slice Instance Test
-
- :FOR ${nsi} IN @{nsi_list}
- \ Delete Network Slice Instance ${nsi}
-
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: delete NST, NSD and VNFD
-
- Delete NST ${nst_id}
-
-# :FOR ${nsi} IN @{nsi_list}
-# \ Delete Network Slice Instance ${nsi}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 08-nov-2019 : network slicing test library
-##
-
-
-*** Settings ***
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/osm_platform_resiliancy_recovery_lib.robot
-Library ../../lib/custom_lib.py
-
-
-*** Variables ***
-${max_wait_time} 5min
-${pol_time} 30sec
-@{components} osm_keystone.1 osm_lcm.1 osm_light-ui.1 osm_mon.1 osm_mongo.1 osm_nbi.1 osm_pol.1 osm_prometheus.1 osm_ro.1 osm_kafka.1 osm_zookeeper.1 osm_mysql.1
-
-
-*** Test Cases ***
-Feature 1413 - OSM platform resiliency to single component failure
- [Tags] platform resiliency
- [Documentation] OSM platform resiliency test
-
- ${name}= Get Random Item From List ${components}
- Check If OSM Working
- WAIT UNTIL KEYWORD SUCCEEDS 2x 30sec Check All Service Are Running
- Kill Docker Container ${name}
- WAIT UNTIL KEYWORD SUCCEEDS ${max_wait_time} ${pol_time} Check All Service Are Running
- Check If OSM Working
-
-
-Feature 1412 - OSM platform recovery after major failure
- [Tags] platform recovery
- [Documentation] OSM platform recovery
-
- Check If OSM Working
- WAIT UNTIL KEYWORD SUCCEEDS 2x 30sec Check All Service Are Running
- :FOR ${component} IN @{components}
- \ Kill Docker Container ${component}
- WAIT UNTIL KEYWORD SUCCEEDS ${max_wait_time} ${pol_time} Check All Service Are Running
- Check If OSM Working
+++ /dev/null
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 21-nov-2019
-##
-
-*** Settings ***
-Documentation Test RBAC for platform using CRUD operations over users, projects and roles
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/rbac_lib.robot
-
-#Suite Setup Configure NBI For RBAC
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-${success_return_code} 0
-# Test data for Users Operations test
-${user_id} ${EMPTY}
-&{update_field1} --set-project=admin,system_admin,project_admin #project,role1,role2...
-&{update_field2} --add-project-role=admin,project_user #project,role1,role2...
-&{update_field3} --add-project-role=service,account_manager #project,role1,role2...
-@{update_user} ${update_field1} ${update_field2} ${update_field3}
-# Test data for Project Operations test
-${project_id} ${EMPTY}
-# Test data for Role Operations test
-${role_id} ${EMPTY}
-${role_to_add} "vims: true"
-
-
-*** Test Cases ***
-Test User Operations
- [Documentation] Test RBAC using CRUD operation over users
- [Tags] rabc rabc_users comprehensive
-
- ${user-name}= Generate Random String 8 [NUMBERS]
- ${user-name}= Catenate SEPARATOR= user_ ${user-name}
- set global variable ${user-name}
- ${user-password}= Generate Random String 8 [NUMBERS]
- set global variable ${user-password}
- ${user_id}= Create User ${user-name} ${user-password}
- List User And Check For The Created User ${user-name}
- Get User Info By Name ${user-name}
- Get User Info By ID ${user_id}
- Update User And Verify Info ${user-name} @{update_user}
- Login With User And Perform Operation ${user-name} ${user-password} admin
- Delete User And Check ${user-name}
-
-
-Test Project Operatios
- [Documentation] Test RBAC using CRUD operation over projects
- [Tags] rabc rabc_projects comprehensive
-
- ${project-name}= Generate Random String 8 [NUMBERS]
- ${project-name}= Catenate SEPARATOR= project_ ${project-name}
- set global variable ${project-name}
- ${project_id}= Create Project ${project-name}
- List Project And Verify ${project-name}
- Get Project Info By Name ${project-name}
- Get Project Info By ID ${project_id}
- ${new-project-name}= Generate Random String 8 [NUMBERS]
- ${new-project-name}= Catenate SEPARATOR= project_ ${new-project-name}
- set global variable ${new-project-name}
- Update Project Name And Verify ${project-name} ${new-project-name}
- Delete Project And Verify ${new-project-name}
-
-
-Test Role Operations
- [Documentation] Test RBAC using CRUD operation over roles
- [Tags] rabc rabc_roles comprehensive
-
- ${role-name}= Generate Random String 8 [NUMBERS]
- ${role-name}= Catenate SEPARATOR= project_ ${role-name}
- set global variable ${role-name}
- ${role_id}= Create Role ${role-name}
- List Roles And Verify ${role-name}
- Get Role Info By Name ${role-name}
- Get Role Info By ID ${role_id}
- Add Role And Verify ${role-name} ${role_to_add}
- Delete Role And Verify ${role-name}
-
-
-*** Keywords ***
-Test Cleanup
- Delete User ${user-name}
- Delete Project ${project-name}
- Delete Project ${new-project-name}
- Delete Role ${role-name}
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 TATA ELXSI
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Author: Ragavi D (ragavi.d@tataelxsi.co.in)
-
-*** Settings ***
-Documentation Test Suite to create hackfest basic nestwork service
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-Variables ../../resource/cli/ubuntu-cloudinit_ns_data.py
-
-*** Variables ***
-@{vnfd_ids}
-${nsd_id} ${EMPTY}
-@{nsd_ids}
-@{ns_ids}
-${ns_config} '{vld: [ {name: mgmtnet, vim-network-name: osm-ext} ], additionalParamsForVnf: [ { member-vnf-index: "1", additionalParams: { password: "PASSWORD" } } ] }'
-
-*** Test Cases ***
-Create Ubuntu CloudInit VNF Descriptor
- [Tags] comprehensive ubuntu-cloudinit_ns
- Build VNF Descriptor ${vnfdPckgPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-Create Ubuntu CloudInit NS Descriptor
- [Tags] comprehensive ubuntu-cloudinit_ns
- Build NS Descriptor ${nsdPckgPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-Network Service Instance Test
- [Documentation] Launch and terminate network services
- [Tags] comprehensive ubuntu-cloudinit_ns
- : FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name} ${ns_config}
-
-Delete NS Instance Test
- [Tags] comprehensive ubuntu-cloudinit_ns
- : FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-Delete NS Descriptor Test
- [Tags] comprehensive ubuntu-cloudinit_ns
- : FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-Delete VNF Descriptor Test
- [Tags] comprehensive ubuntu-cloudinit_ns
- : FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
- : FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
- : FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
- : FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
- # :FOR ${vim_id} IN @{vim}
- # Delete Vim Account ${vim_id}
+++ /dev/null
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 18-Dec-2019
-##
-
-*** Settings ***
-Documentation Test RBAC for platform - Visibility of packages and instances test
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/rbac_lib.robot
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-
-Suite Setup Prerequisite For Test
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-${success_return_code} 0
-
-@{vim}
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-@{ns_ids}
-${vnfdPckg} hackfest_basic_vnf.tar.gz
-${nsdPckg} hackfest_basic_ns.tar.gz
-${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_vnf.tar.gz
-${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_ns.tar.gz
-
-# Test data for Users Operations test
-${user_id} ${EMPTY}
-
-# Test data for Project Operations test
-${project_id} ${EMPTY}
-
-
-*** Test Cases ***
-Create VIM Account For New User
- [Documentation] Test to create VIM account for newly created user
- [Tags] rabc rabc_vim comprehensive nbi
-
- Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services
-
-
-Create VNF Descriptor For New User
- [Documentation] Test to create vnfd for new user
- [Tags] rabc rabc_vnfd comprehensive nbi
-
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/rbac/' ${vnfdftpPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/rbac${/}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create NS Descriptor For New User
- [Documentation] Test to create nsd for new user
- [Tags] rabc rabc_nsd comprehensive nbi
-
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/rbac/' ${nsdftpPath}
- ${nsd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/rbac${/}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Instanciate Network Service For New User
- [Documentation] Launch network services for new user
- [Tags] rabc rabc_ns comprehensive nbi
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Delete NS Instance Test
- [Tags] rabc rabc_ns comprehensive nbi
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] rabc rabc_nsd comprehensive nbi
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] rabc rabc_vnfd comprehensive nbi
-
- :FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-
-*** Keywords ***
-Prerequisite For Test
- ${user-name}= Generate Random String 8 [NUMBERS]
- ${user-name}= Catenate SEPARATOR= user_ ${user-name}
- set global variable ${user-name}
- ${user-password}= Generate Random String 8 [NUMBERS]
- set global variable ${user-password}
- ${user_id}= Create User ${user-name} ${user-password}
-
- ${project-name}= Generate Random String 8 [NUMBERS]
- ${project-name}= Catenate SEPARATOR= project_ ${project-name}
- set global variable ${project-name}
- ${project_id}= Create Project ${project-name}
-
- &{update_field1}= Create Dictionary --add-project-role=admin,project_user
- &{update_field2}= Create Dictionary --add-project-role=${project-name},account_manager
- @{update_user}= Create List ${update_field1} ${update_field2}
- Update User And Verify Info ${user-name} @{update_user}
- Login With User And Perform Operation ${user-name} ${user-password} ${project-name}
-
-
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
-
- Logout and Login With Admin
-
- Delete User ${user-name}
- Delete Project ${project-name}
+++ /dev/null
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 18-Dec-2019
-##
-
-*** Settings ***
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-
-Suite Setup Prerequisite For Test
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-${success_return_code} 0
-
-@{vim}
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-@{ns_ids}
-${vnfdPckg} hackfest_basic_vnf.tar.gz
-${nsdPckg} hackfest_basic_ns.tar.gz
-${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_vnf.tar.gz
-${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_ns.tar.gz
-
-
-*** Test Cases ***
-Create VNF Descriptor Test
- [Tags] comprehensive feature7921
-
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/' ${vnfdftpPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource${/}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create NS Descriptor Test
- [Tags] comprehensive feature7921
-
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/' ${nsdftpPath}
- ${nsd_id}= Create VNFD '${CURDIR}${/}../../resource${/}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Instanciate Network Service Test
- [Tags] comprehensive feature7921
- [Setup] Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Delete NS Instance Test
- [Tags] comprehensive feature7921
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] comprehensive feature7921
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] comprehensive feature7921
-
- :FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-
-*** Keywords ***
-Prerequisite For Test
- [Documentation] Update docker service to use mongodb as file system
-
- Update NBI Service
- Update LCM Service
-
-
-Update NBI Service
- ${rc} ${stdout}= Run and Return RC and Output docker service update osm_nbi --force --env-add OSMNBI_STORAGE_DRIVER=mongo --env-add OSMNBI_STORAGE_PATH=/app/storage --env-add OSMNBI_STORAGE_COLLECTION=files --env-add OSMNBI_STORAGE_URI=mongodb://mongo:27017
- Should Be Equal As Integers ${rc} ${success_return_code}
- Sleep 30s Wait for NBI service to be update
-
-
-Update LCM Service
- ${rc} ${stdout}= Run and Return RC and Output docker service update osm_lcm --force --env-add OSMLCM_STORAGE_DRIVER=mongo --env-add OSMLCM_STORAGE_PATH=/app/storage --env-add OSMLCM_STORAGE_COLLECTION=files --env-add OSMLCM_STORAGE_URI=mongodb://mongo:27017
- Should Be Equal As Integers ${rc} ${success_return_code}
- Sleep 30s Wait for LCM service to be update
-
-
-Test Cleanup
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
-
- ${rc} ${stdout}= Run and Return RC and Output docker service rollback osm_nbi
- Should Be Equal As Integers ${rc} ${success_return_code}
- ${rc} ${stdout}= Run and Return RC and Output docker service rollback osm_lcm
- Should Be Equal As Integers ${rc} ${success_return_code}
+++ /dev/null
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 18-Dec-2019
-##
-
-*** Settings ***
-Documentation Test Suite to test OSMClient Package Createtion and Validation Tool
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/osm_package_tools_lib.robot
-
-Suite Setup Prerequisite For Test
-Suite Teardown Test Cleanup
-
-
-*** Variables ***
-${success_return_code} 0
-${base_dir} ${EXECDIR}
-${pkg_dir} ${CURDIR}${/}../../resource/cli/packages
-${ns_pkg} vEPC
-${vnf_pkg} vEPC
-
-
-*** Test Cases ***
-Test OSM NS Package Create
- [Tags] comprehensive feature8047
- Create OSM NS Package ${ns_pkg}
-
-
-Test OSM VNF Package Create
- [Tags] comprehensive feature8047
- Create OSM VNF Package ${vnf_pkg}
-
-
-Test OSM NS Package Validate
- [Tags] comprehensive feature8047
- Validate OSM NS Package ${ns_pkg}
-
-
-Test OSM VNF Package Validate
- [Tags] comprehensive feature8047
- Validate OSM VNF Package ${vnf_pkg}
-
-
-Test OSM VNF Package Build
- [Tags] comprehensive feature8047
- Build OSM VNF Package ${vnf_pkg}
-
-
-Test OSM NS Package Build
- [Tags] comprehensive feature8047
- Build OSM NS Package ${ns_pkg}
-
-
-*** Keywords ***
-Prerequisite For Test
- Create Directory ${pkg_dir}
- ${rc} ${stdout}= Run and Return RC and Output cd ${pkg_dir}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
-
-Test Cleanup
- ${rc} ${stdout}= Run and Return RC and Output cd ${base_dir}
- Should Be Equal As Integers ${rc} ${success_return_code}
-
- Remove Directory ${pkg_dir} recursive=${TRUE}
\ No newline at end of file
+++ /dev/null
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 27-Nov-19
-##
-
-*** Settings ***
-Documentation Test Suite to test manual scale-in/out cirros VNF and NS using osm-client
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-# VNFD Details
-@{vnfd_ids}
-${vnfdPckgPath} /descriptor-packages/vnfd/cirros_vnf
-${vnfdPckg} /build/cirros_vnf.tar.gz
-
-# NSD Details
-@{nsd_ids}
-${nsdPckgPath} /descriptor-packages/nsd/cirros_ns
-${nsdPckg} /build/cirros_ns.tar.gz
-${scaling_group} scaling_cirros_vnf
-${vnf_member_index} 1
-
-@{ns_ids}
-
-
-*** Test Cases ***
-Create VNF Descriptor Test
- [Documentation] Build and onboard cirros VNF package with scaling parameter
- [Tags] comprehensive manual_scaling
-
- Build VNF Descriptor ${vnfdPckgPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create NS Descriptor Test
- [Documentation] Build and onboard cirros NS package with scaling parameter
- [Tags] comprehensive manual_scaling
-
- Build NS Descriptor ${nsdPckgPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Network Service Instance Test
- [Documentation] Launch cirros ns with scaling parameter
- [Tags] comprehensive manual_scaling
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Perform VNF/VDU Scaling-out Operation Over Launched NS Test
- [Documentation] scale-out cirros ns
- [Tags] comprehensive manual_scaling
- :FOR ${ns} IN @{ns_ids}
- \ Perform VNF Scale-out Operation ${ns} ${vnf_member_index} ${scaling_group}
-
-
-Perform VNF/VDU Scaling-in Operation Over Launched NS Test
- [Documentation] scale-in cirros ns
- [Tags] comprehensive manual_scaling
- :FOR ${ns} IN @{ns_ids}
- \ Perform VNF Scale-in Operation ${ns} ${vnf_member_index} ${scaling_group}
-
-
-Delete NS Instance Test
- [Tags] comprehensive manual_scaling
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] comprehensive manual_scaling
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] comprehensive manual_scaling
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2020 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# Author: Mrityunjay Yadav <MY00514913@techmahindra.com>, Jayant Madavi
-##
-
-
-*** Settings ***
-Documentation Test Suite to test disable network port security NS
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-Variables ../../resource/cli/disable_port_security_ns_data.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-@{ns_ids}
-
-
-*** Test Cases ***
-Create VNF Descriptor
- [Tags] disable_port_security comprehensive
-
- Build VNF Descriptor ${vnfdPckgPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create NS Descriptor
- [Tags] disable_port_security comprehensive
-
- Build NS Descriptor ${nsdPckgPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Network Service Instance Test
- [Documentation] Launch and terminate network services
- [Tags] disable_port_security comprehensive
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Verify Port Security
- [Tags] disable_port_security comprehensive
-
- :FOR ${ns} IN @{ns_ids}
- \ Check For Network Port Security ${ns}
-
-
-Delete NS Instance Test
- [Tags] disable_port_security comprehensive
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] disable_port_security comprehensive
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] disable_port_security comprehensive
-
- :FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-
-*** Keywords ***
-Check For Network Port Security
- [Arguments] ${ns_name}
- ${rc} ${network_id}= Run and Return RC and Output openstack network list | grep ${ns_name} | awk '{print $2}'
- Log ${network_id}
- ${rc} ${stdout}= Run and Return RC and Output openstack network show ${network_id} -f json | jq '.port_security_enabled'
- Log ${stdout}
- Should Be Equal As Strings ${stdout} true
-
-
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019
-##
-
-
-*** Settings ***
-Documentation Test Suite to test basic cirros VNF and NS using osm-client
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-Variables ../../resource/cli/test_vnf_data.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-@{vnfd_ids}
-@{nsd_ids}
-@{ns_ids}
-
-
-*** Test Cases ***
-Create VNF Descriptor Test
- [Tags] sanity smoke
-
- Build VNF Descriptor ${vnfdPckgPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create NS Descriptor Test
- [Tags] sanity smoke
-
- Build NS Descriptor ${nsdPckgPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Network Service Instance Test
- [Documentation] Launch and terminate network services
- [Tags] sanity
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Delete NS Instance Test
- [Tags] sanity
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] sanity smoke
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] sanity smoke
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
-##
-
-
-*** Settings ***
-Documentation Test suiet to create/delete vim account via osmclient
-Library OperatingSystem
-Library Collections
-Resource ../../lib/cli/vim_account_lib.robot
-
-
-*** Test Cases ***
-Create Vim Account Test
- [Tags] smoke vim
-
- Create Vim Account
-
-
-Get Vim Accounts List Test
- [Tags] vim
-
- Get Vim List
-
-
-Delete Vim Account Test
- [Tags] smoke vim
-
- Delete Vim Account
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019
-##
-
-
-*** Settings ***
-Documentation Test Suite to create hackfest basic nestwork service
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-Variables ../../resource/cli/hackfest_basic_ns_data.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-@{ns_ids}
-
-
-*** Test Cases ***
-Create Hackfest Basic VNF Descriptor
- [Tags] comprehensive hackfest_basic_ns
-
- Build VNF Descriptor ${vnfdPckgPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create Hackfest Basic NS Descriptor
- [Tags] comprehensive hackfest_basic_ns
-
- Build NS Descriptor ${nsdPckgPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Network Service Instance Test
- [Documentation] Launch and terminate network services
- [Tags] comprehensive hackfest_basic_ns
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Delete NS Instance Test
- [Tags] comprehensive hackfest_basic_ns
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] comprehensive hackfest_basic_ns
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] comprehensive hackfest_basic_ns
-
- :FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019
-##
-
-
-*** Settings ***
-Documentation Test Suite to create hackfest simplecharm ns
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-Variables ../../resource/cli/hackfest_simplecharm_ns_data.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-@{ns_ids}
-${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-6.0-six/7th-hackfest/packages/hackfest_simplecharm_vnf.tar.gz
-${nsdftpPath} https://osm-download.etsi.org/ftp/osm-6.0-six/7th-hackfest/packages/hackfest_simplecharm_ns.tar.gz
-
-
-*** Test Cases ***
-Create Hackfest Simple Charm VNF Descriptor
- [Tags] hackfest_simplecharm comprehensive
-
- #Build VNF Descriptor ${vnfdPckgPath}
- #Workarround for charm build issue
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../..${vnfdPckgPath}${/}build/' ${vnfdftpPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create Hackfest Simple Charm NS Descriptor
- [Tags] hackfest_simplecharm comprehensive
-
- #Build NS Descriptor ${nsdPckgPath}
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../..${nsdPckgPath}${/}build/' ${nsdftpPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Network Service Instance Test
- [Documentation] Launch and terminate network services
- [Tags] hackfest_simplecharm comprehensive
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Delete NS Instance Test
- [Tags] comprehensive hackfest_simplecharm
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] hackfest_simplecharm comprehensive
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] hackfest_simplecharm comprehensive
-
- :FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019
-##
-
-
-*** Settings ***
-Documentation Test Suite to create hackfest multivdu ns
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-Variables ../../resource/cli/hackfest_multivdu_ns_data.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-@{ns_ids}
-
-
-*** Test Cases ***
-Create Hackfest Multivdu VNF Descriptor
- [Tags] comprehensive hackfest_multivdu
-
- Build VNF Descriptor ${vnfdPckgPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create Hackfest Multivdu NS Descriptor
- [Tags] comprehensive hackfest_multivdu
-
- Build NS Descriptor ${nsdPckgPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Network Service Instance Test
- [Documentation] Launch and terminate network services
- [Tags] comprehensive hackfest_multivdu
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Delete NS Instance Test
- [Tags] comprehensive hackfest_multivdu
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] comprehensive hackfest_multivdu
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] comprehensive hackfest_multivdu
-
- :FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019
-##
-
-
-*** Settings ***
-Documentation Test Suite to create hackfest cloudinit ns
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-Variables ../../resource/cli/hackfest_cloudinit_ns_data.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-@{ns_ids}
-
-
-*** Test Cases ***
-Create Hackfest Cloudinit VNF Descriptor
- [Tags] comprehensive hackfest_cloudinit
-
- Build VNF Descriptor ${vnfdPckgPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create Hackfest Cloudinit NS Descriptor
- [Tags] comprehensive hackfest_cloudinit
-
- Build NS Descriptor ${nsdPckgPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Network Service Instance Test
- [Documentation] Launch and terminate network services
- [Tags] comprehensive hackfest_cloudinit
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Delete NS Instance Test
- [Tags] comprehensive hackfest_cloudinit
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] comprehensive hackfest_cloudinit
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] comprehensive hackfest_cloudinit
-
- :FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019
-##
-
-
-*** Settings ***
-Documentation Test Suite to create hackfest epa ns
-Library OperatingSystem
-Library String
-Library Collections
-Resource ../../lib/cli/vnfd_lib.robot
-Resource ../../lib/cli/nsd_lib.robot
-Resource ../../lib/cli/ns_lib.robot
-Resource ../../lib/cli/vim_account_lib.robot
-Library ../../lib/custom_lib.py
-Variables ../../resource/cli/hackfest_epa_ns_data.py
-
-Suite Teardown Run Keyword And Ignore Error Test Cleanup
-
-
-*** Variables ***
-@{vnfd_ids}
-${nsd_id}
-@{nsd_ids}
-@{ns_ids}
-
-
-*** Test Cases ***
-Create Hackfest EPA VNF Descriptor
- [Tags] hackfest_epa
-
- Build VNF Descriptor ${vnfdPckgPath}
- ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
- Append To List ${vnfd_ids} ${vnfd_id}
-
-
-Create Hackfest EPA NS Descriptor
- [Tags] hackfest_epa
-
- Build NS Descriptor ${nsdPckgPath}
- ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
- Append To List ${nsd_ids} ${nsd_id}
-
-
-Network Service Instance Test
- [Documentation] Launch and terminate network services
- [Tags] hackfest_epa
-
- :FOR ${vim_name} IN @{vim}
- \ Launch Network Services and Return ${vim_name}
-
-
-Delete NS Instance Test
- [Tags] hackfest_epa
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
-
-Delete NS Descriptor Test
- [Tags] hackfest_epa
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
-
-Delete VNF Descriptor Test
- [Tags] hackfest_epa
-
- :FOR ${vnfd_id} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd_id}
-
-
-*** Keywords ***
-Test Cleanup
- [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
-
- :FOR ${ns} IN @{ns_ids}
- \ Delete NS ${ns}
-
- :FOR ${nsd} IN @{nsd_ids}
- \ Delete NSD ${nsd}
-
- :FOR ${vnfd} IN @{vnfd_ids}
- \ Delete VNFD ${vnfd}
-
-# :FOR ${vim_id} IN @{vim}
-# \ Delete Vim Account ${vim_id}
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-*** Settings ***
-Library OperatingSystem
-Library String
-Library Collections
-Library ../../lib/custom_lib.py
-Resource ../../lib/cli/vim_account_lib.robot
-
-Suite Setup Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services
-Suite Teardown Run Keyword And Ignore Error Suite Cleanup
-
-
-*** Variables ***
-@{vim}
-
-
-*** Keywords ***
-Suite Cleanup
- :FOR ${vim_id} IN @{vim}
- \ Force Delete Vim Account ${vim_id}
\ No newline at end of file
+++ /dev/null
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-
-*** Settings ***
-Documentation Test suite to test osmclient python library
-Library OperatingSystem
-
-Suite Setup Setup OSM Client
-
-
-*** Variables ***
-${name} helloworld-os
-${user} robottest
-${password} fred
-${authurl} https://169.254.169.245/
-${type} openstack
-${desc} a test vim
-${tenant} robottest
-
-
-*** Test Cases ***
-Get VIM Account List Test
- [Tags] comprehensive osmclient_lib
- [Documentation] Using python's osmclient library to get vim account list
-
- ${vim_list}= osmclient.get_vim_list
- log to console ${vim_list}
- log ${vim_list}
-
-
-Get VNF Descriptor List Test
- [Tags] comprehensive osmclient_lib
- [Documentation] Using python's osmclient library to get vnfd list
-
- ${vnfd_list}= osmclient.get_vnfd_list
- log to console ${vnfd_list}
- log ${vnfd_list}
-
-
-Get NS Descriptor List Test
- [Tags] comprehensive osmclient_lib
- [Documentation] Using python's osmclient library to get nsd list
-
- ${nsd_list}= osmclient.get_nsd_list
- log to console ${nsd_list}
- log ${nsd_list}
-
-
-Create Vim Account Test
- [Tags] comprehensive osmclient_lib
- [Documentation] Using python's osmclient library to create vim account
- [Template] osmclient.create_vim_account
- ${name} ${type} ${user} ${password} ${authurl} ${tenant} ${desc}
-
-
-Delete Vim Account Test
- [Tags] comprehensive osmclient_lib
- [Documentation] Using python's osmclient library to delete vim account
- osmclient.delete_vim_account ${name}
-
-
-*** Keywords ***
-Setup OSM Client
- evaluate sys.path.append('${CURDIR}${/}../../lib/client_lib') modules=sys
- ${host}= Get Environment Variable OSM_HOSTNAME 127.0.0.1
- Import Library client_lib.ClientLib host=${host} WITH NAME osmclient
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-##
-# Copyright 2019 Tech Mahindra Limited
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-## Change log:
-# 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com
-##
-
-
-*** Settings ***
-Documentation Suite description
-Library SeleniumLibrary
-Library OperatingSystem
-Resource ../../lib/gui/login_gui.robot
-
-
-*** Test Cases ***
-Valid Login
- [Tags] comprehensive gui_login_test
- [Setup] Set Server URL
- Open Browser To Login Page
- Enter Credentials admin admin
- Submit Credentials
- Home Page Should Be Open
- [Teardown] Close Browser
[Arguments] ${host}
${rc} ${stdout}= Run and Return RC and Output ping -c 2 -W 1 ${host}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Test Connectivity
*** Keywords ***
Get Scale Number
- [Arguments] ${host} ${username} ${password} ${privatekey} ${application_name} ${model_name}
+ [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${application_name} ${model_name}
Should Not Be Empty ${application_name} ${model_name}
+ ${host}= Remove String Using Regexp ${endpoint} :([0-9]+)$
${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju show-status ${application_name} --format yaml -m ${model_name} | grep scale | awk -F ': ' '{print $2}'
- log ${stdout}
+ Log ${stdout}
[Return] ${stdout}
Get Model Name
- [Arguments] ${host} ${username} ${password} ${privatekey} ${ns_id} ${kdu_name}
+ [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${ns_id} ${kdu_name}
Should Not Be Empty ${ns_id} ${kdu_name}
+ ${host}= Remove String Using Regexp ${endpoint} :([0-9]+)$
${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju models | grep -i ${kdu_name} | grep -i ${ns_id} | cut -f1 -d " "
- log ${stdout}
+ Log ${stdout}
${model_name}= Set Variable ${kdu_name}-${ns_id}
Should Be Equal As Strings ${model_name} ${stdout}
[Return] ${stdout}
Get Application Name VDU Level Charm
- [Arguments] ${host} ${username} ${password} ${privatekey} ${model_name} ${vdu_profile_id} ${ee_name}
+ [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${model_name} ${vdu_profile_id} ${ee_name}
Should Not Be Empty ${model_name}
+ ${host}= Remove String Using Regexp ${endpoint} :([0-9]+)$
${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju status -m ${model_name} | grep "\\-vdu" | grep -v "*" | grep -i ${vdu_profile_id} | cut -f1 -d " "
- log ${stdout}
+ Log ${stdout}
Should Not Be Empty ${stdout}
Should Contain ${stdout} ${ee_name}
[Return] ${stdout}
Get Application Name NS Level Charm
- [Arguments] ${host} ${username} ${password} ${privatekey} ${model_name} ${charm_name}
+ [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${model_name} ${charm_name}
Should Not Be Empty ${model_name}
+ ${host}= Remove String Using Regexp ${endpoint} :([0-9]+)$
${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju status -m ${model_name} | grep "\\-ns" | grep -v "*" | grep -i ${charm_name} | cut -f1 -d " "
- log ${stdout}
+ Log ${stdout}
Should Not Be Empty ${stdout}
[Return] ${stdout}
Get Application Name VNF Level Charm
- [Arguments] ${host} ${username} ${password} ${privatekey} ${model_name} ${vnf_profile_id} ${ee_name}
+ [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${model_name} ${vnf_profile_id} ${ee_name}
Should Not Be Empty ${model_name}
+ ${host}= Remove String Using Regexp ${endpoint} :([0-9]+)$
${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju status -m ${model_name} | grep "\\-vnf" | grep -v "*" | grep -i ${vnf_profile_id} | cut -f1 -d " "
- log ${stdout}
+ Log ${stdout}
Should Not Be Empty ${stdout}
Should Contain ${stdout} ${ee_name}
[Return] ${stdout}
\ No newline at end of file
Create K8s Cluster
[Arguments] ${k8scluster_creds} ${k8scluster_version} ${k8scluster_vim} ${k8scluster_net} ${k8scluster_name}
${rc} ${stdout}= Run and Return RC and Output osm k8scluster-add --creds ${k8scluster_creds} --version ${k8scluster_version} --vim ${k8scluster_vim} --k8s-nets '{"net1": "${k8scluster_net}"}' ${k8scluster_name} --description "Robot cluster"
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
WAIT UNTIL KEYWORD SUCCEEDS ${k8scluster_launch_max_wait_time} ${k8scluster_launch_pol_time} Check For K8s Cluster To Be Ready ${k8scluster_name}
Check For K8s Cluster To Be Enabled ${k8scluster_name}
Get K8s Cluster
${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list
Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
+ Log ${stdout}
[Return] ${stdout}
Check for K8s Cluster
Check For K8s Cluster To Be Ready
[Arguments] ${k8scluster_name}
${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list --filter name="${k8scluster_name}" --filter _admin.operationalState="ENABLED,DEGRADED"
- log ${stdout}
+ Log ${stdout}
${rc} ${stdout}= Run and Return RC and Output echo "${stdout}" | awk '{print $2}' | grep ${k8scluster_name}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Be Equal As Strings ${stdout} ${k8scluster_name}
Check For K8s Cluster To Be Enabled
[Arguments] ${k8scluster_name}
${rc2} ${stdout2}= Run and Return RC and Output osm k8scluster-show ${k8scluster_name}
- log ${stdout2}
+ Log ${stdout2}
${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list --filter name="${k8scluster_name}" --filter _admin.operationalState="ENABLED"
- log ${stdout}
+ Log ${stdout}
${rc} ${stdout}= Run and Return RC and Output echo "${stdout}" | awk '{print $2}' | grep ${k8scluster_name}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Be Equal As Strings ${stdout} ${k8scluster_name}
${config_file_attr} Set Variable If '${config_file}'!='${EMPTY}' --config_file '${config_file}' \
${ns_id}= Instantiate Network Service ${ns_name} ${nsd} ${vim_name} ${config_attr} ${sshkeys_attr} ${config_file_attr}
- log ${ns_id}
+ Log ${ns_id}
WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For NS Instance To Configured ${ns_name}
Check For NS Instance For Failure ${ns_name}
[Arguments] ${ns_name} ${nsd} ${vim_name} ${ns_extra_args}
${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name} ${ns_extra_args}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
[Arguments] ${ns_id} ${update_type} ${ns_update_config} ${ns_update_timeout}
${rc} ${stdout}= Run and Return RC and Output osm ns-update ${ns_id} --updatetype ${update_type} --config ${ns_update_config} --timeout ${ns_update_timeout} --wait
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${ns_id}
Should Not Be Empty ${vnf_member_index}
${rc} ${stdout}= Run and Return RC and Output osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $14}' 2>&1
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${ns_id}
Should Not Be Empty ${vnf_member_index}
${rc} ${stdout}= Run and Return RC and Output osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $2}' 2>&1
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${ns_name}
${rc} ${stdout}= Run and Return RC and Output osm ns-list | grep ${ns_name} | awk '{print $4}' 2>&1
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Not Be Empty ${stdout}
[Return] ${stdout}
should not be empty @{vnf_list}
@{temp_list}= Create List
FOR ${vnf_id} IN @{vnf_list}
- log ${vnf_id}
+ Log ${vnf_id}
@{vnf_ip_list} Get Vnf Ip List ${vnf_id}
@{temp_list}= Combine Lists ${temp_list} ${vnf_ip_list}
END
# returns a string of ip addresses and needs to be converted into a list
should not be empty ${vnf_ip_list_string}[1]
@{vnf_ip_list} = split string ${vnf_ip_list_string}[1]
- log list ${vnf_ip_list}
+ Log Many ${vnf_ip_list}
should not be empty ${vnf_ip_list}
[return] @{vnf_ip_list}
[arguments] ${ns_name}
${rc} ${stdout}= Run and Return RC and Output openstack server list
- log ${stdout}
+ Log ${stdout}
${rc} ${stdout}= run and return rc and output osm ns-list --filter name="${ns_name}"
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain Any ${stdout} READY BROKEN
[Arguments] ${ns_name}
${rc} ${stdout}= Run and Return RC and Output openstack server list
- log ${stdout}
+ Log ${stdout}
${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}"
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Not Contain ${stdout} BROKEN
[Arguments] ${ns}
${rc} ${stdout}= Run and Return RC and Output openstack server list
- log ${stdout}
+ Log ${stdout}
${rc} ${stdout}= Run and Return RC and Output osm ns-list | awk '{print $2}' | grep ${ns}
Should Not Be Equal As Strings ${stdout} ${ns}
Should Not Be Empty ${ns_name}
${rc} ${stdout}= Run and Return RC and Output osm ns-op-list ${ns_name}
- log ${stdout}
- log ${rc}
+ Log ${stdout}
+ Log ${rc}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Not Be Empty ${ns_operation_id}
${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\"
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain ${stdout} COMPLETED msg=The ns-action with id ${ns_operation_id} was not completed values=False
Should Not Be Empty ${ns_operation_id}
${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\"
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain ${stdout} FAILED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False
Should Not Be Empty ${ns_operation_id}
${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\"
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain Any ${stdout} FAILED COMPLETED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False
[Arguments] ${ns_name} ${vnf_id} ${vdur_id}
${rc} ${affinity_group_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(.id == "'${vdur_id}'")' | yq '."affinity-or-anti-affinity-group-id"[0]' | tr -d \\" 2>&1
- log ${affinity_group_id}
+ Log ${affinity_group_id}
Should Be Equal As Integers ${rc} ${success_return_code} msg=${affinity_group_id} values=False
${rc} ${affinity_group_name}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq '."affinity-or-anti-affinity-group"[] | select(.id == "'${affinity_group_id}'")' | yq '.name' | tr -d \\" 2>&1
- log ${affinity_group_name}
+ Log ${affinity_group_name}
Should Be Equal As Integers ${rc} ${success_return_code} msg=${affinity_group_name} values=False
[Return] ${affinity_group_name}
Should Not Be Empty ${ns_id}
Should Not Be Empty ${type}
${rc} ${stdout}= Run and Return RC and Output osm ns-op-list ${ns_id} | grep ${type} | awk '{print $2}' 2>&1
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Not Be Empty ${stdout}
[Return] ${stdout}
*** Keywords ***
Get NSDs List
${rc} ${stdout}= Run and Return RC and Output osm nspkg-list
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Arguments] ${nsd_pkg}
${rc} ${stdout}= Run and Return RC and Output osm nspkg-create ${nsd_pkg}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
${lines}= Get Line Count ${stdout}
${last}= Evaluate ${lines} - 1
${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm nspkg-delete ${nsd_id}
Should Be Equal As Integers ${rc} ${success_return_code}
- log ${stdout}
+ Log ${stdout}
WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NSD ${nsd_id}
${config_file_attr} Set Variable If '${config_file}'!='${EMPTY}' --config_file '${config_file}' \
${nsi_id}= Instantiate Network Slice ${slice_name} ${nst} ${vim_name} ${config_attr} ${config_file_attr} ${sshkeys_attr}
- log ${nsi_id}
+ Log ${nsi_id}
WAIT UNTIL KEYWORD SUCCEEDS ${slice_launch_max_wait_time} ${slice_launch_pol_time} Check For Network Slice Instance To Configured ${slice_name}
Check For Network Slice Instance For Failure ${slice_name}
[Arguments] ${slice_name} ${nst} ${vim_name} ${slice_extra_args} ${sshkeys_attr}
${rc} ${stdout}= Run and Return RC and Output osm nsi-create --nsi_name ${slice_name} --nst_name ${nst} --vim_account ${vim_name} ${sshkeys_attr} ${slice_extra_args}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${slice_name}
${rc} ${stdout}= Run and Return RC and Output osm ns-list | grep ${slice_name} | wc -l 2>&1
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
# Get all the ns_id in the slice
@{slice_ns_list} Get Slice Ns List ${slice_name}
- log many @{slice_ns_list}
+ Log Many @{slice_ns_list}
@{temp_list}= Create List
# For each ns_id in the list, get all the vnf_id and their IP addresses
FOR ${ns_id} IN @{slice_ns_list}
- log ${ns_id}
+ Log ${ns_id}
@{vnf_id_list} Get Ns Vnf List ${ns_id}
# For each vnf_id in the list, get all its IP addresses
@{ns_ip_list} Get Ns Ip List @{vnf_id_list}
[Arguments] ${slice_name}
${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${slice_name}"
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain Any ${stdout} READY BROKEN configured
[Arguments] ${slice_name}
${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${slice_name}"
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Not Contain ${stdout} failed
[Arguments] ${slice_name} ${slice_delete_max_wait_time}=4min
${rc} ${stdout}= Run and Return RC and Output osm nsi-delete ${slice_name}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
${slice_delete_max_wait_time}= Convert Time ${slice_delete_max_wait_time} result_format=number
*** Keywords ***
Get NST List
${rc} ${stdout}= Run and Return RC and Output osm netslice-template-list
- log ${stdout}
- log ${rc}
+ Log ${stdout}
+ Log ${rc}
Should Be Equal As Integers ${rc} ${success_return_code}
[Arguments] ${nst}
${rc} ${stdout}= Run and Return RC and Output osm netslice-template-create ${nst}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
[Arguments] ${nst_id}
${rc} ${stdout}= Run and Return RC and Output osm netslice-template-delete ${nst_id}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NST ${nst_id}
Should Not Be Empty ${server_id}
${rc} ${stdout}= Run and Return RC and Output openstack server show ${server_id} | grep flavor | awk 'NR>1{print $1}' RS='(' FS=')'
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${flavor_id}
${rc} ${stdout}= Run and Return RC and Output openstack flavor show ${flavor_id} | grep properties | awk -F '|' '{print $3}'
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${ns_name}
${rc} ${stdout}= Run and Return RC and Output openstack server list | grep ${ns_name} | awk '{print $4}'
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
@{servers} = Split String ${stdout}
${n_servers}= Get Length ${servers}
Should Be Equal As Integers ${number} ${n_servers}
+Check If Volume Bootable
+ [Documentation] Check the volume properties and return whether it is bootable or not.
+ [Arguments] ${volume_id}
+
+ Should Not Be Empty ${volume_id}
+ ${rc} ${stdout}= Run and Return RC and Output openstack volume show ${volume_id} | grep bootable | awk '{print $4}'
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
+
+
Get Project Quota
[Documentation] Get a field (ram, cores, ports, etc.) from quota in current project.
[Arguments] ${field}
Should Not Be Empty ${field}
${rc} ${stdout}= Run and Return RC and Output openstack quota show -c ${field} -f value
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${server_id}
Should Not Be Empty ${field}
${rc} ${stdout}= Run and Return RC and Output openstack server show ${server_id} -c ${field} -f value
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${server_group_name}
Should Not Be Empty ${server_id}
${rc} ${stdout}= Run and Return RC and Output openstack server group show ${server_group_name} -c members -f value
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain ${stdout} ${server_id}
+Set Volume Id
+ [Documentation] Sets the root volume ID and ordinary volume ID by checking bootable property of volumes
+ [Arguments] ${volume_match} ${index}
+
+ Should Not Be Empty ${volume_match} ${index}
+ ${bootable}= Check If Volume Bootable ${volume_match}[${index}]
+ Set Suite Variable ${bootable}
+ IF '${bootable}'=='true'
+ Set Suite Variable ${root_vol_id} ${volume_match}[${index}]
+ IF ${index}==0
+ Set Suite Variable ${ordinary_vol_id} ${volume_match}[1]
+ ELSE
+ Set Suite Variable ${ordinary_vol_id} ${volume_match}[0]
+ END
+ END
+
+
+Get Persistent Volumes Attached To Vm
+ [Documentation] Sets the root volume ID and ordinary volume ID by checking bootable property of volumes
+ [Arguments] ${ns_id}
+
+ Variable Should Exist ${ns_id} msg=NS is not available
+ ${vnfs_list}= Get Ns Vnf List ${ns_id}
+ ${vim_id}= Get VNF VIM ID ${vnfs_list}[0]
+ ${volumes_attached}= Get Server Property ${vim_id} volumes_attached
+ log ${volumes_attached}
+ ${stdout}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
+ log ${stdout}
+ [Return] ${stdout}
+
+
Check If Volume Exists
[Documentation] Checks if a volume id exists
[Arguments] ${volume_id}
Should Not Be Empty ${volume_id}
${rc} ${stdout}= Run and Return RC and Output openstack volume list | grep ${volume_id} | wc -l
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${volume_id}
${rc} ${stdout}= Run and Return RC and Output openstack volume delete ${volume_id}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${server_id}
${rc} ${stdout}= Run and Return RC and Output openstack server stop ${server_id}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${server_id}
${rc} ${stdout}= Run and Return RC and Output openstack server set --state error ${server_id}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${server_id}
${rc} ${stdout}= Run and Return RC and Output openstack server delete ${server_id}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
# Proceedes with the onboarding with the appropriate arguments
${rc} ${stdout}= Run and Return RC and Output tar -czf ${pkg}.tar.gz -C ${pkg} .
${rc} ${stdout}= Run and Return RC and Output osm upload-package ${pkg}.tar.gz
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${project_name}
Should Not Be Empty ${new_name}
${rc} ${stdout}= Run and Return RC and Output osm project-update ${project_name} --name ${new_name}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
... The filter parameters are given to this function in key=value format (one argument per key/value pair).
... Fails if the metric is not found or has multiple values.
... Examples of execution:
- ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric}
- ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} \${param1}=\${value1} \${param2}=\${value2}
+ ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} ${prometheus_password} \${metric}
+ ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} ${prometheus_password} \${metric} \${param1}=\${value1} \${param2}=\${value2}
- [Arguments] ${prometheus_ip} ${prometheus_port} ${metric} @{filter_parameters}
+ [Arguments] ${prometheus_ip} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric} @{filter_parameters}
${filter}= Set Variable ${EMPTY}
FOR ${param} IN @{filter_parameters}
${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in filter parameters
${filter}= Catenate SEPARATOR= ${filter} ${param_name}="${param_value}",
END
- ${resp}= Execute Prometheus Instant Query ${prometheus_host} ${prometheus_port} query=${metric}{${filter}}
+ ${resp}= Execute Prometheus Instant Query ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} query=${metric}{${filter}}
${result_list}= Convert To List ${resp["data"]["result"]}
${results}= Get Length ${result_list}
Should Not Be Equal As Numbers 0 ${results} msg=Metric ${metric} not found values=false
... Return an inline json with the result of the query.
... The requested URL is the next: http://\${prometheus_ip}:\${prometheus_port}/api/v1/query?\${querystring}
- [Arguments] ${prometheus_ip} ${prometheus_port} ${querystring}
-
- Create Session prometheus http://${prometheus_ip}:${prometheus_port} timeout=${timeout} max_retries=${max_retries}
+ [Arguments] ${prometheus_ip} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${querystring}
+ ${auth}= IF '${prometheus_password}'!='${EMPTY}' Create List ${prometheus_user} ${prometheus_password} ELSE Set Variable None
+ Create Session prometheus http://${prometheus_ip}:${prometheus_port} timeout=${timeout} max_retries=${max_retries} verify=false auth=${auth}
${resp}= GET On Session prometheus /api/v1/query?${querystring} timeout=${timeout}
Status Should Be 200 ${resp}
[Return] ${resp.json()}
${osm_update_command}= Catenate ${osm_update_command} --${param_name}=${param_value}
END
${rc} ${stdout}= Run and Return RC and Output ${osm_update_command}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
${osm_sdnc_create_command}= Catenate ${osm_sdnc_create_command} --${param_name}=${param_value}
END
${rc} ${stdout}= Run and Return RC and Output ${osm_sdnc_create_command}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
[Arguments] ${sdnc_name}
${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm sdnc-delete ${sdnc_name}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for SDNC To Be Deleted ${sdnc_name}
Get SDNC List
${rc} ${stdout}= Run and Return RC and Output osm sdnc-list
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Arguments] ${sdnc_id}
${rc} ${stdout}= Run and Return RC and Output osm sdnc-show ${sdnc_id} | grep -io ENABLED
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Check for SDNC Status
- [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
- Wait Until Keyword Succeeds ${sdnc_status_max_wait_time} ${sdnc_status_pol_time} Check If SDNC Is Available ${sdnc_id} ${prometheus_host} ${prometheus_port}
+ Wait Until Keyword Succeeds ${sdnc_status_max_wait_time} ${sdnc_status_pol_time} Check If SDNC Is Available ${sdnc_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Get SDNC ID
Check If SDNC Is Available
- [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
- ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_sdnc_status sdnc_id=${sdnc_id}
+ ${metric}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} osm_sdnc_status sdnc_id=${sdnc_id}
Should Be Equal As Integers ${metric} 1 msg=SDNC '${sdnc_id}' is not active values=false
Library String
Library OperatingSystem
Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot
+Variables %{ROBOT_DEVOPS_FOLDER}/resources/sol003_01-vnf_lifecycle_management.py
*** Variables ***
@{success_status_code_list} 200 201 202 204
Get Hostname
Create Session osmhit ${HOST}
&{headers} Create Dictionary Content-Type=application/json Accept=application/json
- &{data} Create Dictionary username=admin password=admin project-id=admin
+ &{data} Create Dictionary username=${osm_user} password=${osm_password} project-id=${osm_project}
${resp}= Post On Session osmhit ${auth_token_uri} json=${data} headers=${headers}
- log ${resp}
+ Log ${resp}
Pass Execution If ${resp.status_code} in ${success_status_code_list} Get Auth Token completed
Set Suite Variable ${token_status_code} ${resp.status_code}
${access_token}= Get Value From Json ${resp.json()} $..id
Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password}
... ELSE Login With Public Key ${username} ${privatekey}
${stdout} ${rc}= Execute Command ${command} return_rc=True return_stdout=True
- log ${rc}
- log ${stdout}
+ Log ${rc}
+ Log ${stdout}
Close All Connections
Should Be Equal As Integers ${rc} 0
[Return] ${stdout}
${osm_vim_create_command}= Catenate ${osm_vim_create_command} --${param_name}=${param_value}
END
${rc} ${stdout}= Run and Return RC and Output ${osm_vim_create_command}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
[Arguments] ${vim_name}
${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm vim-delete ${vim_name}
- log ${stdout}
+ Log ${stdout}
Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for VIM Target ${vim_name}
Get VIM Targets
${rc} ${stdout}= Run and Return RC and Output osm vim-list
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Check for VIM Target Metric
- [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
${vim_account_id}= Get VIM Target ID ${vim_name}
- Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Has Metric ${vim_account_id} ${prometheus_host} ${prometheus_port}
+ Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Has Metric ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Check for VIM Target Status
- [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
${vim_account_id}= Get VIM Target ID ${vim_name}
- Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port}
+ Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Get VIM Target ID
Check If VIM Target Is Available
- [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
- ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id}
+ ${metric}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} osm_vim_status vim_account_id=${vim_account_id}
Should Be Equal As Integers ${metric} 1 msg=VIM Target '${vim_account_id}' is not active values=false
Check If VIM Target Has Metric
- [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
- ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id}
+ ${metric}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} osm_vim_status vim_account_id=${vim_account_id}
Should Be True ${metric} <2 msg=VIM Target '${vim_account_id}' has no metric
Should Not Be Empty ${vnf_id}
${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | grep vim-id | awk '{print $2}'
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
Should Not Be Empty ${vnf_id}
${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[].id'
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
@{vdur_ids}= Split String ${stdout}
[Return] @{vdur_ids}
Should Not Be Empty ${vnf_id}
${rc} ${vm_vim_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(.id == "'${vdur_id}'")' | yq '."vim-id"' | tr -d \\"
- log ${vm_vim_id}
+ Log ${vm_vim_id}
Should Be Equal As Integers ${rc} ${success_return_code} msg=${vm_vim_id} values=False
[Return] ${vm_vim_id}
*** Keywords ***
Get VNFDs List
${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-list
- log ${stdout}
- log ${rc}
+ Log ${stdout}
+ Log ${rc}
Should Be Equal As Integers ${rc} ${success_return_code}
# Proceedes with the onboarding with the appropriate arguments
${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-create ${overrides} ${vnfd_pkg}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
${lines}= Get Line Count ${stdout}
${last}= Evaluate ${lines} - 1
# Proceedes with the onboarding with the appropriate arguments
${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-update --content ${vnfd_pkg} ${vnfd_name}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
${lines}= Get Line Count ${stdout}
${last}= Evaluate ${lines} - 1
# Proceedes with the onboarding with the appropriate arguments
${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-create ${overrides} ${vnfd_pkg} --override '${override_fields}'
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
${lines}= Get Line Count ${stdout}
${last}= Evaluate ${lines} - 1
[Arguments] ${vnfd_id}
${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-delete ${vnfd_id}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id}
[Arguments] ${vnfd_id}
${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-delete ${vnfd_id}
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${failure_return_code}
Should Contain ${stdout} 409 msg=Expected Conflict values=False
WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id} True
# Prometheus host and port
-(prometheus_host, prometheus_port) = get_prometheus_info()
+(
+ prometheus_host,
+ prometheus_port,
+ prometheus_user,
+ prometheus_password,
+) = get_prometheus_info()
# VIM configuration
cloud_type = os.environ.get("CLOUD_TYPE", "openstack")
vim_name_prefix = "basic01"
# Get credentias from Openstack Clouds file
os_cloud = os.environ.get("OS_CLOUD")
- clouds_file_paths = ["./clouds.yaml", str(Path.home()) + "/.config/openstack/clouds.yaml", "/etc/openstack/clouds.yaml"]
+ clouds_file_paths = [
+ "./clouds.yaml",
+ str(Path.home()) + "/.config/openstack/clouds.yaml",
+ "/etc/openstack/clouds.yaml",
+ ]
for path in clouds_file_paths:
clouds_file_path = Path(path)
if clouds_file_path.exists():
raise Exception("Auth url not found in Openstack cloud '" + os_cloud + "'")
vim_auth_url = cloud["auth"]["auth_url"]
if not "project_name" in cloud["auth"]:
- raise Exception("Project name not found in Openstack cloud '" + os_cloud + "'")
+ raise Exception(
+ "Project name not found in Openstack cloud '" + os_cloud + "'"
+ )
vim_tenant = cloud["auth"]["project_name"]
- vim_user_domain_name = cloud["auth"]["user_domain_name"] if "user_domain_name" in cloud["auth"] else None
- vim_project_domain_name = cloud["auth"]["project_domain_name"] if "project_domain_name" in cloud["auth"] else None
+ vim_user_domain_name = (
+ cloud["auth"]["user_domain_name"]
+ if "user_domain_name" in cloud["auth"]
+ else None
+ )
+ vim_project_domain_name = (
+ cloud["auth"]["project_domain_name"]
+ if "project_domain_name" in cloud["auth"]
+ else None
+ )
vim_insecure = True if "verify" in cloud and not cloud["verify"] else None
-
+
# Extra config
vim_config_dict = {}
vim_config_dict["vim_network_name"] = os.environ.get("VIM_MGMT_NET")
vim_config_dict["user_domain_name"] = vim_user_domain_name
if vim_insecure:
vim_config_dict["insecure"] = True
- vim_config = "'{}'".format(yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip('\r\n'))
+ vim_config = "'{}'".format(
+ yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip(
+ "\r\n"
+ )
+ )
elif cloud_type == "azure":
# Azure VIM
vim_config_dict["vnet_name"] = os.environ.get("VNET_NAME")
if "AZURE_FLAVORS_PATTERN" in os.environ:
vim_config_dict["flavors_pattern"] = os.environ.get("AZURE_FLAVORS_PATTERN")
- vim_config = "'{}'".format(yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip('\r\n'))
+ vim_config = "'{}'".format(
+ yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip(
+ "\r\n"
+ )
+ )
else:
raise Exception("VIM type not supported: '" + cloud_type + "'")
# Prometheus host and port
-(prometheus_host, prometheus_port) = get_prometheus_info()
+(
+ prometheus_host,
+ prometheus_port,
+ prometheus_user,
+ prometheus_password,
+) = get_prometheus_info()
# VIM Configuration
vim_account_type = "openstack"
# Get credentials from Openstack clouds file
os_cloud = os.environ.get("OS_CLOUD")
-clouds_file_paths = ["./clouds.yaml", str(Path.home()) + "/.config/openstack/clouds.yaml", "/etc/openstack/clouds.yaml"]
+clouds_file_paths = [
+ "./clouds.yaml",
+ str(Path.home()) + "/.config/openstack/clouds.yaml",
+ "/etc/openstack/clouds.yaml",
+]
for path in clouds_file_paths:
clouds_file_path = Path(path)
if clouds_file_path.exists():
if not "project_name" in cloud["auth"]:
raise Exception("Project name not found in Openstack cloud '" + os_cloud + "'")
vim_tenant = cloud["auth"]["project_name"]
- vim_user_domain_name = cloud["auth"]["user_domain_name"] if "user_domain_name" in cloud["auth"] else None
- vim_project_domain_name = cloud["auth"]["project_domain_name"] if "project_domain_name" in cloud["auth"] else None
+ vim_user_domain_name = (
+ cloud["auth"]["user_domain_name"]
+ if "user_domain_name" in cloud["auth"]
+ else None
+ )
+ vim_project_domain_name = (
+ cloud["auth"]["project_domain_name"]
+ if "project_domain_name" in cloud["auth"]
+ else None
+ )
vim_insecure = True if "verify" in cloud and not cloud["verify"] else None
# Extra VIM config
vim_config_dict["insecure"] = True
vim_config_dict["disable_network_port_security"] = True
vim_config_dict["management_network_name"] = os.environ.get("VIM_MGMT_NET")
-vim_config = "'{}'".format(yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip('\r\n'))
+vim_config = "'{}'".format(
+ yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip("\r\n")
+)
# Get ${HOME} from local machine
home = str(Path.home())
# NS and VNF descriptor package folder
-vnfd_pkg = 'hackfest_multivdu_vnf'
-nsd_pkg = 'hackfest_multivdu_ns'
+vnfd_pkg = "hackfest_multivdu_vnf"
+nsd_pkg = "hackfest_multivdu_ns"
# NS and VNF descriptor id
-vnfd_name = 'hackfest_multivdu-vnf'
-nsd_name = 'hackfest_multivdu-ns'
+vnfd_name = "hackfest_multivdu-vnf"
+nsd_name = "hackfest_multivdu-ns"
# NS instance name
-ns_name = 'basic_08_disable_port_security_network_level_test'
+ns_name = "basic_08_disable_port_security_network_level_test"
# SSH keys to be used
-publickey = home + '/.ssh/id_rsa.pub'
-privatekey = home + '/.ssh/id_rsa'
+publickey = home + "/.ssh/id_rsa.pub"
+privatekey = home + "/.ssh/id_rsa"
def get_prometheus_info():
- if os.environ.get('PROMETHEUS_HOSTNAME', False):
- prometheus_host = os.environ.get('PROMETHEUS_HOSTNAME')
- prometheus_port = os.environ.get('PROMETHEUS_PORT', 9090)
+ if os.environ.get("PROMETHEUS_HOSTNAME", False):
+ prometheus_host = os.environ.get("PROMETHEUS_HOSTNAME")
+ prometheus_port = os.environ.get("PROMETHEUS_PORT", 9090)
else:
- prometheus_host = os.environ.get('OSM_HOSTNAME')
- prometheus_port = os.environ.get('PROMETHEUS_PORT', 9091)
- return prometheus_host, prometheus_port
+ prometheus_host = os.environ.get("OSM_HOSTNAME")
+ prometheus_port = os.environ.get("PROMETHEUS_PORT", 9091)
+ prometheus_user = os.environ.get("PROMETHEUS_USER", "")
+ prometheus_password = os.environ.get("PROMETHEUS_PASSWORD", "")
+ return prometheus_host, prometheus_port, prometheus_user, prometheus_password
+
+
+def get_osm_info():
+ osm_user = os.environ.get("OSM_USER", "admin")
+ osm_password = os.environ.get("OSM_PASSWORD", "admin")
+ osm_project = os.environ.get("OSM_PROJECT", "admin")
+ return osm_user, osm_password, osm_project
# Prometheus host and port
-(prometheus_host, prometheus_port) = get_prometheus_info()
+(
+ prometheus_host,
+ prometheus_port,
+ prometheus_user,
+ prometheus_password,
+) = get_prometheus_info()
# SDNC Configuration
# Prometheus host and port
-(prometheus_host, prometheus_port) = get_prometheus_info()
+(
+ prometheus_host,
+ prometheus_port,
+ prometheus_user,
+ prometheus_password,
+) = get_prometheus_info()
# Prometheus host and port
-(prometheus_host, prometheus_port) = get_prometheus_info()
+(
+ prometheus_host,
+ prometheus_port,
+ prometheus_user,
+ prometheus_password,
+) = get_prometheus_info()
# Prometheus host and port
-(prometheus_host, prometheus_port) = get_prometheus_info()
+(
+ prometheus_host,
+ prometheus_port,
+ prometheus_user,
+ prometheus_password,
+) = get_prometheus_info()
# Prometheus host and port
-(prometheus_host, prometheus_port) = get_prometheus_info()
+(
+ prometheus_host,
+ prometheus_port,
+ prometheus_user,
+ prometheus_password,
+) = get_prometheus_info()
--- /dev/null
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from pathlib import Path
+
+from common_helpers import get_osm_info
+
+
+(osm_user, osm_password, osm_project) = get_osm_info()
python3 -m pip install -r /robot-systest/conformance-tests/requirements.txt
}
-create_vim(){
+create_k8scluster(){
+ attempts=3
+ while [ $attempts -ge 0 ] ; do
+ echo -e "\n$( date '+%F_%H:%M:%S' ) Creating K8s Cluster"
+
+ osm k8scluster-add --creds ${K8S_CREDENTIALS} --version "v1" --vim ${VIM_TARGET} --k8s-nets "{\"net1\": \"${VIM_MGMT_NET}\"}" ${VIM_TARGET} --description "Robot cluster"
+
+ STATUS=""
+ i=0
+ while [[ ${STATUS} != "ENABLED" ]]
+ do
+ ((i++))
+ if [[ $i -eq 5 ]]; then
+ echo "K8s cluster stuck for more than 50 seconds:"
+ osm k8scluster-show ${VIM_TARGET}
+ osm k8scluster-delete ${VIM_TARGET}
+ sleep 5
+ break
+ fi
+ sleep 10
+ STATUS=`osm k8scluster-list | grep ${VIM_TARGET} | awk '{print $8}'`
+ done
+ if [[ ${STATUS} = "ENABLED" ]] ; then
+ break
+ fi
+ ((attempts--))
+ done
+ if [ $attempts -lt 0 ] ; then
+ echo "VIM failed to enter ENABLED state"
+ exit 1
+ fi
+}
+
+create_vim(){
attempts=3
while [ $attempts -ge 0 ] ; do
echo -e "\n$( date '+%F_%H:%M:%S' ) Creating VIM ${VIM_TARGET}"
;;
-c|--createvim)
create_vim
+ create_k8scluster
shift 1
;;
-T)
-p <package_branch> [OPTIONAL]: OSM packages repository branch. Default: master
-t <testing_tags> [OPTIONAL]: Robot tests tags. [sanity, daily, regression, particular_test]. Default: sanity
-T <testing_branch> [OPTIONAL]: Run SOL005 Robot conformance tests
- -c To create a VIM for the tests
+ -c To create a VIM and K8s cluster for the tests
Volumes:
<path_to_reports> [OPTIONAL]: It is the absolute path to reports location in the host
${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type}
Set Suite Variable ${created_vim_account_id}
Check VIM Target Operational State ${vim_name}
- Check for VIM Target Metric ${vim_name} ${prometheus_host} ${prometheus_port}
+ ${stdout}= Check for VIM Target Metric ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Delete VIM Target By Name
${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config}
Set Suite Variable ${created_vim_account_id}
Check VIM Target Operational State ${vim_name}
- Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port}
+ Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Delete VIM Target By ID
Get Management Ip Addresses
${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
Get Management Ip Addresses
${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
- log ${ip_addr_1}
+ Log ${ip_addr_1}
Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1}
${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
- log ${ip_addr_2}
+ Log ${ip_addr_2}
Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2}
Get Management Ip Addresses
[Tags] verify
${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
Create VIM With Port Security Disabled
${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config}
- Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port}
+ Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Create VNF Descriptor
Get Management Ip Addresses
${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
- log ${ip_addr_1}
+ Log ${ip_addr_1}
Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1}
${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
- log ${ip_addr_2}
+ Log ${ip_addr_2}
Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2}
[Arguments] ${folder_name}
${rc} ${stdout}= Run and Return RC and Output rm -rf '${folder_name}'
- log ${stdout}
+ Log ${stdout}
Set Suite Variable ${vnf_id2} ${vnfr_list}[1]
${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
Set Suite Variable ${vnf1_ipmgmt} ${ip}
- log ${vnf1_ipmgmt}
+ Log ${vnf1_ipmgmt}
${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
Set Suite Variable ${vnf2_ipmgmt} ${ip}
- log ${vnf2_ipmgmt}
+ Log ${vnf2_ipmgmt}
Check Vnf1 IPs
Variable Should Exist ${privatekey} msg=SSH private key not available
Sleep 10 seconds Wait for SSH daemon to be up
${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ip --brief addr show up | grep -v "^lo" | awk '{print $3}'
- log ${stdout}
+ Log ${stdout}
@{ip} = Split String ${stdout}
Should Match Regexp ${ip}[1] ${datanet1_prefix} msg=${ip}[1] doesn't match subnet's regexp ${datanet1_prefix}
Should Match Regexp ${ip}[2] ${datanet2_prefix} msg=${ip}[2] doesn't match subnet's regexp ${datanet2_prefix}
Variable Should Exist ${vnf2_ipmgmt} msg=IP address of the data VNF '${vnf_member_index_2}' is not available
Variable Should Exist ${privatekey} msg=SSH private key not available
${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip --brief addr show up | grep -v "^lo" | awk '{print $3}'
- log ${stdout}
+ Log ${stdout}
@{ip} = Split String ${stdout}
Should Match Regexp ${ip}[1] ${datanet1_prefix} msg=${ip}[1] doesn't match subnet's regexp ${datanet1_prefix}
Should Match Regexp ${ip}[2] ${datanet2_prefix} msg=${ip}[2] doesn't match subnet's regexp ${datanet2_prefix}
Variable Should Exist ${vnf1_ipmgmt} msg=IP address of the data VNF '${vnf_member_index_1}' is not available
Variable Should Exist ${privatekey} msg=SSH private key not available
${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf2_ipmgmt}
- log ${stdout}
+ Log ${stdout}
${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ping -c 5 ${vnf2_ip1}
- log ${stdout}
+ Log ${stdout}
${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ping -c 5 ${vnf2_ip2}
- log ${stdout}
+ Log ${stdout}
${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ping -c 5 ${vnf2_ip3}
- log ${stdout}
+ Log ${stdout}
Ping from Vnf2 to Vnf1
Variable Should Exist ${vnf1_ipmgmt} msg=IP address of the data VNF '${vnf_member_index_2}' is not available
Variable Should Exist ${privatekey} msg=SSH private key not available
${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf1_ipmgmt}
- log ${stdout}
+ Log ${stdout}
${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf1_ip1}
- log ${stdout}
+ Log ${stdout}
${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf1_ip2}
- log ${stdout}
+ Log ${stdout}
${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf1_ip3}
- log ${stdout}
+ Log ${stdout}
Delete NS Instance
Set Suite Variable ${vnf_id} ${vnfr_list}[0]
${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
Set Suite Variable ${vnf_ipmgmt} ${ip}
- log ${vnf_ipmgmt}
+ Log ${vnf_ipmgmt}
Check Vnf IPs
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
${num_virtual_storage}= Convert To Integer ${stdout}
Set Suite Variable ${vnf_num_volumes} ${num_virtual_storage}
- log ${vnf_num_volumes}
+ Log ${vnf_num_volumes}
Get VNF IP Address
[Tags] verify
Variable Should Exist ${ns_id} msg=NS is not available
${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
Variable Should Exist ${vnf_ip_addr} msg=VNF is not available
Sleep 30 seconds Wait for SSH daemon to be up
${stdout}= Execute Remote Command Check Rc Return Output ${vnf_ip_addr} ${username} ${password} ${privatekey} sudo lsblk -l
- log ${stdout}
+ Log ${stdout}
${lines}= Get Lines Containing String ${stdout} disk
${num_lines}= Get Line Count ${lines}
Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes})
# [Tags] cleanup
# Variable Should Exist ${volume_id} msg=Volume is not available
# ${exists}= Check If Volume Exists ${volume_id}
-# log ${exists}
+# Log ${exists}
# IF ${exists}==0
# Fail msg=Persistent volume was deleted
# Set Suite Variable ${volume_id} ${EMPTY}}
# ELSE
-# log Persistent volume still exists, deleting...
+# Log Persistent volume still exists, deleting...
# Delete Volume ${volume_id}
# Set Suite Variable ${volume_id} ${EMPTY}}
# END
Variable Should Exist ${ns_id} msg=NS is not available
${id} Get Vnf Id ${ns_id} ${vnf_member_index}
- log ${id}
+ Log ${id}
Set Suite Variable ${vnf_id} ${id}
Set Suite Variable ${ns_update_config} '{changeVnfPackageData: [{vnfInstanceId: "${vnf_id}", vnfdId: "${vnfd_id}"}]}'
Get Management Ip Address
${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
--- /dev/null
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+Documentation [BASIC-26] Secure connection to helm execution environments.
+
+Library OperatingSystem
+Library SSHLibrary
+
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
+
+Force Tags basic_26 cluster_ee_config daily regression
+
+Suite Teardown Run Keyword And Ignore Error Suite Cleanup
+
+
+*** Variables ***
+# NS and VNF descriptor package folder and ids
+${vnfd_pkg} simple_secure_ee_vnf
+${vnfd_name} simple_secure_ee-vnf
+${nsd_pkg} simple_secure_ee_ns
+${nsd_name} simple_secure_ee-ns
+
+# NS instance name and configuration
+${ns_name} basic_26_secure_helm_ee_test
+${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
+
+# SSH keys and username to be used
+${publickey} %{HOME}/.ssh/id_rsa.pub
+${privatekey} %{HOME}/.ssh/id_rsa
+${username} ubuntu
+${password} ${EMPTY}
+
+${action_name} touch
+${new_action_name} mkdir
+${vnf_member_index} simple
+${day_1_file_name} /home/ubuntu/first-touch
+${ns_timeout} 15min
+
+
+*** Test Cases ***
+Create VNF Descriptor
+
+ ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
+ Set Suite Variable ${vnfd_id} ${id}
+
+
+Create NS Descriptor
+
+ Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
+
+
+Instantiate Network Service
+
+ ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout}
+ Set Suite Variable ${ns_id} ${id}
+
+
+Get Management Ip Address
+
+ ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
+ Log ${ip_addr}
+ Set Suite Variable ${vnf_ip_addr} ${ip_addr}
+
+
+Test SSH Access
+
+ Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF '${vnf_member_index}' is not available
+ Sleep 30s Waiting ssh daemon to be up
+ Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey}
+
+
+Check Remote File Created Via Day 1 Operation
+ [Documentation] Check whether the file created in the previous test via Day 1 operations exist or not.
+
+ Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name}
+
+
+Delete NS Instance
+ [Tags] cleanup
+
+ Delete NS ${ns_name}
+
+
+Delete NS Descriptor
+ [Tags] cleanup
+
+ Delete NSD ${nsd_name}
+
+
+Delete VNF Descriptor
+ [Tags] cleanup
+
+ Delete VNFD ${vnfd_name}
+
+
+*** Keywords ***
+Suite Cleanup
+ [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
+
+ Run Keyword If Any Tests Failed Delete NS ${ns_name}
+
+ Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
+
+ Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
+
--- /dev/null
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+Documentation [BASIC-27] Update Helm EE in Running VNF Instance.
+
+Library OperatingSystem
+Library SSHLibrary
+
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
+
+Force Tags basic_27 cluster_ee_config daily regression
+
+Suite Teardown Run Keyword And Ignore Error Suite Cleanup
+
+
+*** Variables ***
+# NS and VNF descriptor package folder and ids
+${vnfd_pkg} simple_ee_vnf
+${updated_vnfd_pkg} updated_simple_ee_vnf
+${vnfd_name} simple_ee-vnf
+${nsd_pkg} simple_ee_ns
+${nsd_name} simple_ee-ns
+
+# NS instance name and configuration
+${ns_name} basic_27_helm_ee_update_test
+${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
+
+# SSH keys and username to be used
+${publickey} %{HOME}/.ssh/id_rsa.pub
+${privatekey} %{HOME}/.ssh/id_rsa
+${username} ubuntu
+${password} ${EMPTY}
+
+${action_name} touch
+${new_action_name} mkdir
+${vnf_member_index} simple
+${day_1_file_name} /home/ubuntu/first-touch
+${day_2_file_name} /home/ubuntu/mytouch1
+${day_2_folder_name} /home/ubuntu/myfolder1
+${ns_timeout} 15min
+
+# NS update operation configuration
+${update_type} CHANGE_VNFPKG
+${ns_update_timeout} 500
+
+
+*** Test Cases ***
+Create VNF Descriptor
+
+ ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
+ Set Suite Variable ${vnfd_id} ${id}
+
+
+Create NS Descriptor
+
+ Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
+
+
+Instantiate Network Service
+
+ ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout}
+ Set Suite Variable ${ns_id} ${id}
+
+
+Set NS Update Config
+
+ Variable Should Exist ${ns_id} msg=NS is not available
+ ${id} Get Vnf Id ${ns_id} ${vnf_member_index}
+ Log ${id}
+ Set Suite Variable ${vnf_id} ${id}
+ Set Suite Variable ${ns_update_config} '{changeVnfPackageData: [{vnfInstanceId: "${vnf_id}", vnfdId: "${vnfd_id}"}]}'
+
+
+Get Management Ip Address
+
+ ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
+ Log ${ip_addr}
+ Set Suite Variable ${vnf_ip_addr} ${ip_addr}
+
+
+Test SSH Access
+
+ Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF '${vnf_member_index}' is not available
+ Sleep 30s Waiting ssh daemon to be up
+ Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey}
+
+
+Check Remote Files Created Via Day 1 Operation
+ [Documentation] The VNF has a Day 1 operation that creates a file named ${day_1_file_name}.
+ ... This test checks whether that files have been created or not.
+
+ Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name}
+
+
+Execute Day 2 Operation
+ [Documentation] Performs one Day 2 operation on the VNF that creates a new file.
+
+ Variable Should Exist ${ns_id} msg=Network service instance is not available
+ ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index} file-path=${day_2_file_name}
+
+
+Check Remote File Created Via Day 2 Operation
+ [Documentation] Check whether the file created in the previous test via Day 2 operations exist or not.
+
+ Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name}
+
+
+Update VNFD Package
+ [Documentation] Updates the VNFD by using new VNFD package which includes the EE
+ ... which has new day2 operation.
+
+ Update VNFD '%{PACKAGES_FOLDER}/${updated_vnfd_pkg}' ${vnfd_name}
+
+
+Update Running VNF Instance
+ [Documentation] Updates the running VNF instance by using new VNFD package.
+ ... As the VNFD has an updated Helm EE, this operation will trigger the upgrade of existing Helm EE
+ ... for the specific VNF.
+
+ Update Network Service ${ns_id} ${update_type} ${ns_update_config} ${ns_update_timeout}
+
+
+Execute Day 2 Operation on Upgraded Helm EE
+ [Documentation] Performs one Day 2 operation on the updated VNF that creates a new folder.
+
+ Variable Should Exist ${ns_id} msg=Network service instance is not available
+ ${ns_op_id_2}= Execute NS Action ${ns_name} ${new_action_name} ${vnf_member_index} foldername=${day_2_folder_name}
+
+
+Check Remote Folder Created Via Day 2 Operation
+ [Documentation] Check whether the folder created in the previous test via Day 2 operations exist or not.
+
+ Check If remote Folder Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_2_folder_name}
+
+
+Delete NS Instance
+ [Tags] cleanup
+
+ Delete NS ${ns_name}
+
+
+Delete NS Descriptor
+ [Tags] cleanup
+
+ Delete NSD ${nsd_name}
+
+
+Delete VNF Descriptor
+ [Tags] cleanup
+
+ Delete VNFD ${vnfd_name}
+
+
+*** Keywords ***
+Suite Cleanup
+ [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
+
+ Run Keyword If Any Tests Failed Delete NS ${ns_name}
+
+ Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
+
+ Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
+
--- /dev/null
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+Documentation [BASIC-28] NS with one VDU which has 2 persistent volumes with keep flag
+
+Library OperatingSystem
+Library String
+Library Collections
+Library Process
+Library SSHLibrary
+
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnf_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/openstack_lib.robot
+
+Force Tags basic_28 cluster_main daily
+
+
+Suite Teardown Run Keyword And Ignore Error Suite Cleanup
+
+
+*** Variables ***
+# NS and VNF descriptor package folder and ids
+${vnfd_pkg} keep_persistent_volume_vnf
+${vnfd_name} keep_persistent-volumes-vnf
+${nsd_pkg} keep_persistent_volume_ns
+${nsd_name} persistent_volumes-ns
+
+# NS instance name and configuration
+${ns_name} basic_28
+${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
+
+# SSH keys and username to be used
+${publickey} %{HOME}/.ssh/id_rsa.pub
+${privatekey} %{HOME}/.ssh/id_rsa
+${username} ubuntu
+${password} ${EMPTY}
+
+${vnf_member_index} vnf-persistent-volumes
+${vdu_id} keep-persistent-vol-VM
+${root_disk} root-volume
+${ordinary_disk} persistent-volume
+${success_return_code} 0
+
+
+*** Test Cases ***
+Create VNF Descriptor
+ Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
+
+
+Create NS Descriptor
+ Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
+
+
+Network Service Instance Test
+ ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
+ Set Suite Variable ${ns_id} ${id}
+
+
+Check Persistent Volume Counts
+ Variable Should Exist ${ns_id} msg=NS is not available
+ ${volume_match}= Get Persistent Volumes Attached To Vm ${ns_id}
+ Set Suite Variable ${volume_match}
+ ${volume_counts}= Get Length ${volume_match}
+ Set Suite Variable ${volume_counts}
+ Run Keyword If ${volume_counts} != 2 Fail msg=There were not 2 volumes attached to VM
+
+
+Set Persistent Volume Ids
+ Variable Should Exist ${volume_match} msg=NS is not available
+ Set Volume Id ${volume_match} 0
+ Set Volume Id ${volume_match} 1
+
+
+Delete NS Instance Test
+ [Tags] cleanup
+ Delete NS ${ns_name}
+
+
+Check Persistent Root Volume in VIM after NS Deleted
+ Variable Should Exist ${root_vol_id} msg=Root volume is not available
+ ${root_vol_exists}= Check If Volume Exists ${root_vol_id}
+ log ${root_vol_exists}
+ IF ${root_vol_exists}==0
+ Fail msg=Persistent root volume was deleted
+ Set Suite Variable ${root_vol_id} ${EMPTY}
+ ELSE
+ log Persistent root volume still exists
+ END
+
+
+Check Persistent Ordinary Volume in VIM after NS Deleted
+ Variable Should Exist ${ordinary_vol_id} msg=Ordinary persistent volume is not available
+ ${ordinary_vol_exists}= Check If Volume Exists ${ordinary_vol_id}
+ log ${ordinary_vol_exists}
+ IF ${ordinary_vol_exists}==0
+ Fail msg=Persistent ordinary volume was deleted
+ Set Suite Variable ${ordinary_vol_id} ${EMPTY}
+ ELSE
+ log Persistent ordinary volume still exists
+ END
+
+
+Prepare Ns Config With Volume Id
+ Set Suite Variable ${ns_config_with_vim_id} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ], vnf: [ {member-vnf-index: ${vnf_member_index}, vdu: [ {id: ${vdu_id}, volume: [{"name": ${root_disk}, vim-volume-id: ${root_vol_id}}, {"name": ${ordinary_disk}, vim-volume-id: ${ordinary_vol_id}}] } ] } ] }
+
+
+Network Service Instance With Existing Volumes Test
+ ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config_with_vim_id} ${publickey}
+ Set Suite Variable ${ns_id} ${id}
+
+
+Verify the Attachment Of Existing Persistent Volumes
+ Set Suite Variable ${prev_root_vol_id} ${root_vol_id}
+ Set Suite Variable ${prev_ordinary_vol_id} ${ordinary_vol_id}
+ ${volume_match}= Get Persistent Volumes Attached To Vm ${ns_id}
+ Set Suite Variable ${volume_match}
+ Set Volume Id ${volume_match} 0
+ Set Volume Id ${volume_match} 1
+ Should Be Equal As Strings ${root_vol_id} ${prev_root_vol_id} msg=Existing root volume is not attached to server
+ Should Be Equal As Strings ${ordinary_vol_id} ${prev_ordinary_vol_id} msg=Existing ordinary volume is not attached to server
+
+
+Delete NS Instance With Existing Volumes Test
+ [Tags] cleanup
+ Delete NS ${ns_name}
+
+
+Check Existence of Persistent Volumes
+ Variable Should Exist ${root_vol_id} msg=Volume is not available
+ Variable Should Exist ${ordinary_vol_id} msg=Volume is not available
+ ${root_vol_exists}= Check If Volume Exists ${root_vol_id}
+ Run Keyword If ${root_vol_exists} == 0 Fail msg=Existing root volume is deleted
+ ${ordinary_vol_exists}= Check If Volume Exists ${ordinary_vol_id}
+ Run Keyword If ${ordinary_vol_exists} == 0 Fail msg=Existing ordinary volume is deleted
+
+
+Delete Persistent Volumes
+ [Tags] cleanup
+ Delete Volume ${root_vol_id}
+ Delete Volume ${ordinary_vol_id}
+
+
+Delete NS Descriptor Test
+ [Tags] cleanup
+ Delete NSD ${nsd_name}
+
+
+Delete VNF Descriptor Test
+ [Tags] cleanup
+ Delete VNFD ${vnfd_name}
+
+
+*** Keywords ***
+Suite Cleanup
+ [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
+
+ Run Keyword If Any Tests Failed Delete NS ${ns_name}
+
+ Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
+
+ Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
+
+ Run Keyword If Any Tests Failed Delete Persistent Volumes
Get VNF IP Address
${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
${vnfs_list}= Get Ns Vnf List ${ns_id}
${vim_id}= Get VNF VIM ID ${vnfs_list}[0]
- log ${vim_id}
+ Log ${vim_id}
Set Suite Variable ${vnf_server_id} ${vim_id}
${flavor_id}= Get Server Flavor ID ${vnf_server_id}
${properties}= Get Flavor Properties ${flavor_id}
- log ${properties}
+ Log ${properties}
Set Suite Variable ${flavor_properties} ${properties}
Check SDNC Status Is Healthy
- Check for SDNC Status ${sdnc_id} ${prometheus_host} ${prometheus_port}
+ Check for SDNC Status ${sdnc_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Delete Basic SDNC
Variable Should Exist ${ns_id} msg=Network service instance is not available
${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
Set Suite Variable ${ip_mgmt_1} ${ip}
- log ${ip_mgmt_1}
+ Log ${ip_mgmt_1}
${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
Set Suite Variable ${ip_mgmt_2} ${ip}
- log ${ip_mgmt_2}
+ Log ${ip_mgmt_2}
Ping from Vnf1 to Vnf2
Variable Should Exist ${ip_mgmt_1} msg=IP address of the data VNF '${vnf_member_index_1}' is not available
Sleep 30 seconds Wait for SSH daemon to be up
${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_1} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip2}
- log ${stdout}
+ Log ${stdout}
Ping from Vnf2 to Vnf1
Variable Should Exist ${ip_mgmt_2} msg=IP address of the data VNF '${vnf_member_index_2}' is not available
${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_2} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip1}
- log ${stdout}
+ Log ${stdout}
Delete NS Instance
Variable Should Exist ${ns_id} msg=Network service instance is not available
${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
Set Suite Variable ${ip_mgmt_1} ${ip}
- log ${ip_mgmt_1}
+ Log ${ip_mgmt_1}
${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
Set Suite Variable ${ip_mgmt_2} ${ip}
- log ${ip_mgmt_2}
+ Log ${ip_mgmt_2}
Ping from Vnf1 to Vnf2
Variable Should Exist ${ip_mgmt_1} msg=IP address of the data VNF '${vnf_member_index_1}' is not available
Sleep 30 seconds Wait for SSH daemon to be up
${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_1} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip2}
- log ${stdout}
+ Log ${stdout}
Ping from Vnf2 to Vnf1
Variable Should Exist ${ip_mgmt_2} msg=IP address of the data VNF '${vnf_member_index_2}' is not available
${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_2} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip1}
- log ${stdout}
+ Log ${stdout}
Delete NS Instance
ELSE
${memory}= Evaluate ${ram_quota} / 1000
END
- log ${memory}
+ Log ${memory}
Create VNFD Overriding Fields '%{PACKAGES_FOLDER}/${vnfd_pkg}' virtual-compute-desc.1.virtual-memory.size=${memory}
${rand}= Generate Random String 4 [NUMBERS]
${ns_name}= Catenate SEPARATOR=_ ${ns_name_prefix} ${rand}
Set Suite Variable ${ns_name}
- log ${ns_name}
+ Log ${ns_name}
${id}= Instantiate Network Service ${ns_name} ${nsd_name} %{VIM_TARGET} --config '${ns_config}' --ssh_keys ${publickey}
- log ${id}
+ Log ${id}
Set Suite Variable ${ns_id} ${id}
WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For Ns Instance To Configured ${ns_name}
${rc} ${stdout}= run and return rc and output osm ns-list --filter id="${ns_id}" | grep ${ns_id} | awk '{print $8}'
- log ${stdout}
+ Log ${stdout}
Should Contain ${stdout} BROKEN
${rc} ${stdout}= run and return rc and output osm ns-show ${ns_id} --literal | yq .errorDetail
- log ${stdout}
+ Log ${stdout}
Should Contain ${stdout} Deploying at VIM: Error at create vdu
Get Vnf Ip Address
${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
Test Ping
Get Vnf Ip Address
${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
Check Remote File Injected Via Cloud-init
${stdout}= Execute Remote Command Check Rc Return Output ${vnf_ip_addr} ${username} ${password} ${EMPTY} sudo cat /root/helloworld.txt
- log ${stdout}
+ Log ${stdout}
Delete NS Instance Test
Get Vnf Ip Address
${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
Test Ping
${success_return_code} 0
+@{vim_vdus} @{EMPTY}
+@{vim_volumes} @{EMPTY}
+
*** Test Cases ***
Create VNF Descriptors
END
+Get VIM Objects
+ Variable Should Exist ${ns_id} msg=NS is not available
+ @{vnf_id_list}= Get Ns Vnf List ${ns_id}
+ Log ${vnf_id_list}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ Log ${vnf_id}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ Append To List ${vim_vdus} @{vdu_ids}
+ END
+ FOR ${vdu_id} IN @{vim_vdus}
+ ${volumes_attached}= Get Server Property ${vdu_id} volumes_attached
+ ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
+ IF ${match} != @{EMPTY}
+ IF not "${match}[0]" in "@{vim_volumes}"
+ Append To List ${vim_volumes} ${match}[0]
+ END
+ END
+ END
+ Log Many @{vim_vdus}
+ Log Many @{vim_volumes}
+
+
Get Volume VNF Info
Variable Should Exist ${ns_id} msg=NS is not available
${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_several_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_volumes_ip_addr} ${ip_addr}
${vnf_id}= Get Vnf Id ${ns_id} ${vnf_several_index}
Set Suite Variable ${vnf_volumes_id} ${vnf_id}
${id}= Get VNF VIM ID ${vnf_id}
Set Suite Variable ${vdu_volumes_id} ${id}
- log ${vdu_volumes_id}
+ Log ${vdu_volumes_id}
@{volumes_ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id}
Set Suite Variable @{volumes_ip_list} @{volumes_ip_list}
- log @{volumes_ip_list}
+ Log @{volumes_ip_list}
Get Volumes Info
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
${num_virtual_storage}= Convert To Integer ${stdout}
Set Suite Variable ${vnf_num_volumes} ${num_virtual_storage}
- log ${vnf_num_volumes}
+ Log ${vnf_num_volumes}
${volumes_attached}= Get Server Property ${vdu_volumes_id} volumes_attached
${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
Set Suite Variable ${volume_id} ${match}[0]
Check VDU Disks
Variable Should Exist ${vnf_volumes_ip_addr} msg=VNF is not available
- Sleep 30 seconds Wait for SSH daemon to be up
+ Sleep 20 seconds Wait for SSH daemon to be up
${stdout}= Execute Remote Command Check Rc Return Output ${vnf_volumes_ip_addr} ${username} ${password} ${privatekey} sudo lsblk -l
- log ${stdout}
+ Log ${stdout}
${lines}= Get Lines Containing String ${stdout} disk
${num_lines}= Get Line Count ${lines}
Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes})
Variable Should Exist ${vnf_volumes_id} msg=VNF is not available
@{ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id}
- log @{ip_list}
+ Log @{ip_list}
Should Be Equal ${ip_list} ${volumes_ip_list} IP addresses have changed after healing
${id}= Get VNF VIM ID ${vnf_volumes_id}
- log ${id}
+ Log ${id}
Should Not Be Equal ${id} ${vdu_volumes_id} VDU id has not changed after healing
${volumes_attached}= Get Server Property ${id} volumes_attached
Sleep 30 seconds Wait for SSH daemon to be up
${stdout}= Execute Remote Command Check Rc Return Output ${vnf_volumes_ip_addr} ${username} ${password} ${privatekey} sudo lsblk -l
- log ${stdout}
+ Log ${stdout}
${lines}= Get Lines Containing String ${stdout} disk
${num_lines}= Get Line Count ${lines}
Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes})
+Update VIM Objects
+ Variable Should Exist ${ns_id} msg=NS is not available
+ @{vdu_updated}= Create List
+ @{vnf_id_list}= Get Ns Vnf List ${ns_id}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ Append To List ${vdu_updated} @{vdu_ids}
+ FOR ${id} IN @{vdu_ids}
+ IF not "${id}" in "@{vim_vdus}"
+ Append To List ${vim_vdus} ${id}
+ END
+ END
+ END
+ FOR ${vdu_id} IN @{vdu_updated}
+ ${volumes_attached}= Get Server Property ${vdu_id} volumes_attached
+ ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
+ IF ${match} != @{EMPTY}
+ IF not "${match}[0]" in "@{vim_volumes}"
+ Append To List ${vim_volumes} ${match}[0]
+ END
+ END
+ END
+ Log Many @{vim_vdus}
+ Log Many @{vim_volumes}
+
+
Delete NS Instance
[Tags] cleanup
Delete NS ${ns_name}
Delete VNFD ${vnfd_charm_name}
+Delete Objects in VIM
+ [Tags] cleanup
+ ${error}= Set Variable 0
+ FOR ${vol_id} IN @{vim_volumes}
+ Log Checking if volume ${vol_id} is still in VIM
+ ${exists}= Check If Volume Exists ${vol_id}
+ IF ${exists}!=0
+ ${error}= Set Variable 1
+ Log Deleting volume ${vol_id}
+ Run Keyword And Ignore Error Delete Volume ${vol_id}
+ END
+ END
+ FOR ${vdu_id} IN @{vim_vdus}
+ Log Checking if server ${vdu_id} is still in VIM
+ ${status}= Run Keyword And Ignore Error Get Server Property ${vdu_id} id
+ Log ${status}[0]
+ IF '${status}[0]' == 'PASS'
+ ${error}= Set Variable 1
+ Log Deleting server ${vdu_id}
+ Run Keyword And Ignore Error Delete Server ${vdu_id}
+ END
+ END
+ IF ${error}==1
+ Fail Some objects created by test were not deleted in VIM
+ END
+
+
*** Keywords ***
Suite Cleanup
[Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_volumes_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_charm_name}
+ Run Keyword If Any Tests Failed Delete Objects in VIM
${success_return_code} 0
+@{vim_vdus} @{EMPTY}
+@{vim_volumes} @{EMPTY}
+
*** Test Cases ***
Create VNF Descriptors
Run Keyword If ${vdurs} != ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out
+Get VIM Objects
+ Variable Should Exist ${ns_id} msg=NS is not available
+ @{vnf_id_list}= Get Ns Vnf List ${ns_id}
+ Log ${vnf_id_list}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ Log ${vnf_id}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ Append To List ${vim_vdus} @{vdu_ids}
+ END
+ FOR ${vdu_id} IN @{vim_vdus}
+ ${volumes_attached}= Get Server Property ${vdu_id} volumes_attached
+ ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
+ IF ${match} != @{EMPTY}
+ IF not "${match}[0]" in "@{vim_volumes}"
+ Append To List ${vim_volumes} ${match}[0]
+ END
+ END
+ END
+ Log Many @{vim_vdus}
+ Log Many @{vim_volumes}
+
+
Get Charm VNF Info
Variable Should Exist ${ns_id} msg=NS is not available
${variables} Get Variables
${id}= Get VNF VIM ID ${vnf_charm_id}
@{vdu_charm_ids}= Split String ${id}
Set Suite Variable @{vdu_charm_ids} @{vdu_charm_ids}
- log ${vdu_charm_ids}[1]
+ Log ${vdu_charm_ids}[1]
@{charm_ip_list}= Get Vnf Vdur IPs ${vnf_charm_id}
Set Suite Variable @{charm_ip_list} @{charm_ip_list}
${ip}= Get Vdu Attribute ${vnf_charm_id} ip-address 1
${stdout}= Execute Remote Command Check Rc Return Output ${ip} ${username} ${password} ${privatekey} sudo ls ${vnf_charm_cloudinit_file}
- log ${stdout}
+ Log ${stdout}
Check If remote File Exists ${ip} ${username} ${password} ${privatekey} ${vnf_charm_day1_file}
+Update VIM Objects
+ Variable Should Exist ${ns_id} msg=NS is not available
+ @{vdu_updated}= Create List
+ @{vnf_id_list}= Get Ns Vnf List ${ns_id}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ Append To List ${vdu_updated} @{vdu_ids}
+ FOR ${id} IN @{vdu_ids}
+ IF not "${id}" in "@{vim_vdus}"
+ Append To List ${vim_vdus} ${id}
+ END
+ END
+ END
+ FOR ${vdu_id} IN @{vdu_updated}
+ ${volumes_attached}= Get Server Property ${vdu_id} volumes_attached
+ ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
+ IF ${match} != @{EMPTY}
+ IF not "${match}[0]" in "@{vim_volumes}"
+ Append To List ${vim_volumes} ${match}[0]
+ END
+ END
+ END
+ Log Many @{vim_vdus}
+ Log Many @{vim_volumes}
+
+
Delete NS Instance
[Tags] cleanup
Delete NS ${ns_name}
Delete VNFD ${vnfd_charm_name}
+Delete Objects in VIM
+ [Tags] cleanup
+ ${error}= Set Variable 0
+ FOR ${vol_id} IN @{vim_volumes}
+ Log Checking if volume ${vol_id} is still in VIM
+ ${exists}= Check If Volume Exists ${vol_id}
+ IF ${exists}!=0
+ ${error}= Set Variable 1
+ Log Deleting volume ${vol_id}
+ Run Keyword And Ignore Error Delete Volume ${vol_id}
+ END
+ END
+ FOR ${vdu_id} IN @{vim_vdus}
+ Log Checking if server ${vdu_id} is still in VIM
+ ${status}= Run Keyword And Ignore Error Get Server Property ${vdu_id} id
+ Log ${status}[0]
+ IF '${status}[0]' == 'PASS'
+ ${error}= Set Variable 1
+ Log Deleting server ${vdu_id}
+ Run Keyword And Ignore Error Delete Server ${vdu_id}
+ END
+ END
+ IF ${error}==1
+ Fail Some objects created by test were not deleted in VIM
+ END
+
+
*** Keywords ***
Suite Cleanup
[Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_volumes_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_charm_name}
+ Run Keyword If Any Tests Failed Delete Objects in VIM
${success_return_code} 0
+@{vim_vdus} @{EMPTY}
+@{vim_volumes} @{EMPTY}
+
*** Test Cases ***
Create VNF Descriptors
Run Keyword If ${vdurs} != ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out
+Get VIM Objects
+ Variable Should Exist ${ns_id} msg=NS is not available
+ @{vnf_id_list}= Get Ns Vnf List ${ns_id}
+ Log ${vnf_id_list}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ Log ${vnf_id}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ Append To List ${vim_vdus} @{vdu_ids}
+ END
+ FOR ${vdu_id} IN @{vim_vdus}
+ ${volumes_attached}= Get Server Property ${vdu_id} volumes_attached
+ ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
+ IF ${match} != @{EMPTY}
+ IF not "${match}[0]" in "@{vim_volumes}"
+ Append To List ${vim_volumes} ${match}[0]
+ END
+ END
+ END
+ Log Many @{vim_vdus}
+ Log Many @{vim_volumes}
+
+
Get Charm VNF Info
Variable Should Exist ${ns_id} msg=NS is not available
${variables} Get Variables
${id}= Get VNF VIM ID ${vnf_charm_id}
@{vdu_charm_ids}= Split String ${id}
Set Suite Variable @{vdu_charm_ids} @{vdu_charm_ids}
- log ${vdu_charm_ids}[1]
+ Log ${vdu_charm_ids}[1]
@{charm_ip_list}= Get Vnf Vdur IPs ${vnf_charm_id}
Set Suite Variable @{charm_ip_list} @{charm_ip_list}
Get Volume VNF Info
Variable Should Exist ${ns_id} msg=NS is not available
${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_several_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_volumes_ip_addr} ${ip_addr}
${vnf_id}= Get Vnf Id ${ns_id} ${vnf_several_index}
Set Suite Variable ${vnf_volumes_id} ${vnf_id}
${id}= Get VNF VIM ID ${vnf_id}
Set Suite Variable ${vdu_volumes_id} ${id}
- log ${vdu_volumes_id}
+ Log ${vdu_volumes_id}
@{volumes_ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id}
Set Suite Variable @{volumes_ip_list} @{volumes_ip_list}
- log @{volumes_ip_list}
+ Log @{volumes_ip_list}
Stop VDUs
${ip}= Get Vdu Attribute ${vnf_charm_id} ip-address 1
${stdout}= Execute Remote Command Check Rc Return Output ${ip} ${username} ${password} ${privatekey} sudo ls ${vnf_charm_cloudinit_file}
- log ${stdout}
+ Log ${stdout}
Check If remote File Exists ${ip} ${username} ${password} ${privatekey} ${vnf_charm_day1_file}
+Update VIM Objects
+ Variable Should Exist ${ns_id} msg=NS is not available
+ @{vdu_updated}= Create List
+ @{vnf_id_list}= Get Ns Vnf List ${ns_id}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ Append To List ${vdu_updated} @{vdu_ids}
+ FOR ${id} IN @{vdu_ids}
+ IF not "${id}" in "@{vim_vdus}"
+ Append To List ${vim_vdus} ${id}
+ END
+ END
+ END
+ FOR ${vdu_id} IN @{vdu_updated}
+ ${volumes_attached}= Get Server Property ${vdu_id} volumes_attached
+ ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
+ IF ${match} != @{EMPTY}
+ IF not "${match}[0]" in "@{vim_volumes}"
+ Append To List ${vim_volumes} ${match}[0]
+ END
+ END
+ END
+ Log Many @{vim_vdus}
+ Log Many @{vim_volumes}
+
+
Delete NS Instance
[Tags] cleanup
Delete NS ${ns_name}
Delete VNFD ${vnfd_charm_name}
+Delete Objects in VIM
+ [Tags] cleanup
+ ${error}= Set Variable 0
+ FOR ${vol_id} IN @{vim_volumes}
+ Log Checking if volume ${vol_id} is still in VIM
+ ${exists}= Check If Volume Exists ${vol_id}
+ IF ${exists}!=0
+ ${error}= Set Variable 1
+ Log Deleting volume ${vol_id}
+ Run Keyword And Ignore Error Delete Volume ${vol_id}
+ END
+ END
+ FOR ${vdu_id} IN @{vim_vdus}
+ Log Checking if server ${vdu_id} is still in VIM
+ ${status}= Run Keyword And Ignore Error Get Server Property ${vdu_id} id
+ Log ${status}[0]
+ IF '${status}[0]' == 'PASS'
+ ${error}= Set Variable 1
+ Log Deleting server ${vdu_id}
+ Run Keyword And Ignore Error Delete Server ${vdu_id}
+ END
+ END
+ IF ${error}==1
+ Fail Some objects created by test were not deleted in VIM
+ END
+
+
*** Keywords ***
Suite Cleanup
[Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
${healing_pol_time} 15sec
${healing_max_wait_time} 10m
+@{vim_vdus} @{EMPTY}
+
+
*** Test Cases ***
Create VNF Descriptors
Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
END
+Get VIM Objects
+ Variable Should Exist ${ns_id} msg=NS is not available
+ @{vnf_id_list}= Get Ns Vnf List ${ns_id}
+ Log ${vnf_id_list}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ Log ${vnf_id}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ Append To List ${vim_vdus} @{vdu_ids}
+ END
+ Log Many @{vim_vdus}
+
+
Get VNF Info
Variable Should Exist ${ns_id} msg=NS is not available
${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
${vnf_id}= Get Vnf Id ${ns_id} ${vnf_index}
Set Suite Variable ${vnf_autoheal_id} ${vnf_id}
${id}= Get VNF VIM ID ${vnf_id}
Set Suite Variable ${vdu_autoheal_id} ${id}
- log ${vdu_autoheal_id}
+ Log ${vdu_autoheal_id}
@{autoheal_ip_list}= Get Vnf Vdur IPs ${vnf_autoheal_id}
Set Suite Variable @{autoheal_ip_list} @{autoheal_ip_list}
- log @{autoheal_ip_list}
+ Log @{autoheal_ip_list}
Stop Autoheal VDU
Variable Should Exist ${vnf_autoheal_id} msg=VNF is not available
@{ip_list}= Get Vnf Vdur IPs ${vnf_autoheal_id}
- log @{ip_list}
+ Log @{ip_list}
Should Be Equal ${ip_list} ${autoheal_ip_list} IP addresses have changed after healing
${id}= Get VNF VIM ID ${vnf_autoheal_id}
- log ${id}
+ Log ${id}
Should Not Be Equal ${id} ${vdu_autoheal_id} VDU id has not changed after healing
+Update VIM Objects
+ Variable Should Exist ${ns_id} msg=NS is not available
+ @{vnf_id_list}= Get Ns Vnf List ${ns_id}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ FOR ${id} IN @{vdu_ids}
+ IF not "${id}" in "@{vim_vdus}"
+ Append To List ${vim_vdus} ${id}
+ END
+ END
+ END
+ Log Many @{vim_vdus}
+
+
Delete NS Instance
[Tags] cleanup
Delete NS ${ns_name}
[Tags] cleanup
Delete VNFD ${vnfd_name}
+
+Delete Objects in VIM
+ [Tags] cleanup
+ ${error}= Set Variable 0
+ FOR ${vdu_id} IN @{vim_vdus}
+ Log Checking if server ${vdu_id} is still in VIM
+ ${status}= Run Keyword And Ignore Error Get Server Property ${vdu_id} id
+ Log ${status}[0]
+ IF '${status}[0]' == 'PASS'
+ ${error}= Set Variable 1
+ Log Deleting server ${vdu_id}
+ Run Keyword And Ignore Error Delete Server ${vdu_id}
+ END
+ END
+ IF ${error}==1
+ Fail Some objects created by test were not deleted in VIM
+ END
+
+
*** Keywords ***
Suite Cleanup
[Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
Get Management Ip Addresses
${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
- log ${ip_addr_1}
+ Log ${ip_addr_1}
Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1}
${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
- log ${ip_addr_2}
+ Log ${ip_addr_2}
Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2}
${ip_addr_3} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_3}
- log ${ip_addr_3}
+ Log ${ip_addr_3}
Set Suite Variable ${vnf_3_ip_addr} ${ip_addr_3}
${ip_addr_4} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_4}
- log ${ip_addr_4}
+ Log ${ip_addr_4}
Set Suite Variable ${vnf_4_ip_addr} ${ip_addr_4}
${ip_addr_5} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_5}
- log ${ip_addr_5}
+ Log ${ip_addr_5}
Set Suite Variable ${vnf_5_ip_addr} ${ip_addr_5}
Library Process
Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot
+
+Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_01-crud_operations_on_vim_targets_data.py
Force Tags k8s_02 cluster_k8s daily regression
${k8scluster_version} v1
*** Test Cases ***
+Create VIM Target Basic
+ [Documentation] Creates a VIM for the K8s cluster to be anchored against
+
+ ${rand}= Generate Random String 6 [NUMBERS]
+ ${vim_name}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand}
+ Set Suite Variable ${vim_name}
+ ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type}
+ Set Suite Variable ${created_vim_account_id}
+
Add K8s Cluster To OSM
- Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name}
+ Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} ${vim_name} %{VIM_MGMT_NET} ${k8scluster_name}
Remove K8s Cluster from OSM
[Tags] cleanup
Delete K8s Cluster ${k8scluster_name}
+Delete VIM Target By ID
+ [Documentation] Delete the VIM Target created in previous test-case by its ID.
+ ... Checks whether the VIM Target was created or not before perform the deletion.
+ [Tags] cleanup
+
+ ${vim_account_id}= Get VIM Target ID ${vim_name}
+ Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id}
+ Delete VIM Target ${vim_account_id}
+
+
*** Keywords ***
Suite Cleanup
[Documentation] Test Suit Cleanup: Deleting K8s Cluster
*** Variables ***
-# K8s cluster name and version
-${k8scluster_name} k8s03
-${k8scluster_version} v1
-
# NS and VNF descriptor package folder and ids
${vnfd_pkg} charm-packages/native_k8s_charm_vnf
${vnfd_name} native_k8s_charm-vnf
Create Simple K8s Descriptor
Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
-Add K8s Cluster To OSM
- Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name}
-
Network Service K8s Instance Test
${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
Set Suite Variable ${ns_id} ${id}
[Tags] cleanup
Delete NS ${ns_name}
-Remove K8s Cluster from OSM
- [Tags] cleanup
- Delete K8s Cluster ${k8scluster_name}
-
Delete NS Descriptor Test
[Tags] cleanup
Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete NS ${ns_name}
Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
- Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name}
*** Variables ***
-# K8s cluster name and version
-${k8scluster_name} k8s04
-${k8scluster_version} v1
-
# NS and VNF descriptor package folder and ids
${vnfd_pkg} openldap_knf
${vnfd_name} openldap_knf
[Tags] prepare
Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
-Add K8s Cluster To OSM
- [Tags] prepare
- Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name}
-
Create Network Service Instance
[Tags] prepare
${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
[Tags] verify
Variable Should Exist ${ns_id} msg=Network service instance is not available
${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name}
- log ${count}
+ Log ${count}
Should Be Equal As Integers ${count} ${replica_count}
Execute Rollback Operation
[Tags] verify
Variable Should Exist ${ns_id} msg=Network service instance is not available
${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name}
- log ${count}
+ Log ${count}
Should Be Empty ${count}
Delete Network Service Instance
[Tags] cleanup
Delete NS ${ns_name}
-Remove K8s Cluster from OSM
- [Tags] cleanup
- Delete K8s Cluster ${k8scluster_name}
-
Delete NS Descriptor Test
[Tags] cleanup
Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete NS ${ns_name}
Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
- Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name}
Get Management Ip Addresses
${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
- log ${ip_addr_1}
+ Log ${ip_addr_1}
Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1}
${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
- log ${ip_addr_2}
+ Log ${ip_addr_2}
Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2}
Get Management Ip Addresses
[Tags] verify
${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
- log ${ip_addr_1}
+ Log ${ip_addr_1}
Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1}
${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
- log ${ip_addr_2}
+ Log ${ip_addr_2}
Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2}
*** Variables ***
-# K8s cluster name and version
-${k8scluster_name} k8s08
-${k8scluster_version} v1
-
# NS and VNF descriptor package folder and ids
${vnfd_pkg} charm-packages/native_k8s_scale_charm_vnf
${vnfd_name} native_k8s_scale_charm-vnf
Create Simple K8s Scale NS Descriptor
Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
-Add K8s Cluster To OSM
- Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name}
-
Network Service K8s Instance Test
${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
Set Suite Variable ${ns_id} ${id}
[Tags] cleanup
Delete NS ${ns_name}
-Remove K8s Cluster from OSM
- [Tags] cleanup
- Delete K8s Cluster ${k8scluster_name}
-
Delete NS Descriptor Test
[Tags] cleanup
Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete NS ${ns_name}
Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
- Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name}
*** Variables ***
-# K8s cluster name and version
-${k8scluster_name} k8s-test
-${k8scluster_version} v1
-
# NS and VNF descriptor package folder and ids
${vnfd_pkg} charm-packages/pebble_charm_vnf
${vnfd_name} pebble_charm-vnf
Create Simple K8s Descriptor
Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
-Add K8s Cluster To OSM
- Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name}
-
Network Service K8s Instance Test
${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
Set Suite Variable ${ns_id} ${id}
[Tags] cleanup
Delete NS ${ns_name}
-Remove K8s Cluster from OSM
- [Tags] cleanup
- Delete K8s Cluster ${k8scluster_name}
-
Delete NS Descriptor Test
[Tags] cleanup
Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete NS ${ns_name}
Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
- Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name}
Get Management Ip Addresses
${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
- log ${ip_addr_1}
+ Log ${ip_addr_1}
Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1}
${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
- log ${ip_addr_2}
+ Log ${ip_addr_2}
Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2}
Variable Should Exist ${ns_id} msg=Network service instance is not available
${kdu_count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name}
- log ${kdu_count}
+ Log ${kdu_count}
Set Suite Variable ${initial_kdu_count} ${kdu_count}
Perform Manual KDU Scale Out
Variable Should Exist ${initial_kdu_count} msg=Initial KDU count is not available
${kdu_count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name}
- log ${kdu_count}
+ Log ${kdu_count}
Run Keyword If ${kdu_count} != ${initial_kdu_count} + 2 Fail msg=There is no new KDU in the model after Scale Out
Perform Manual KDU Scale In
Check Replicas After Upgrade Operation
Variable Should Exist ${ns_id} msg=Network service instance is not available
${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name}
- log ${count}
+ Log ${count}
Should Be Equal As Integers ${count} ${replica_count}
Execute Rollback Operation
Check Replicas After Rollback Operation
Variable Should Exist ${ns_id} msg=Network service instance is not available
${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name}
- log ${count}
+ Log ${count}
Should Be Empty ${count}
Delete Network Service Instance
Variable Should Exist ${prometheus_port} msg=Prometheus port is not available
Variable Should Exist ${metric_1_name} msg=Prometheus first metric name is not available
Variable Should Exist ${metric_2_name} msg=Prometheus second metric name is not available
- ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_1_name}
+ ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_1_name}
Run Keyword If ${metric_1_value} <= 0 Fail msg=The metric '${metric_1_name}' value is '${metric_1_value}'
- ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_2_name}
+ ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_2_name}
Run Keyword If ${metric_2_value} <= 0 Fail msg=The metric '${metric_2_name}' value is '${metric_2_value}'
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
${scaleout_threshold}= Convert To Number ${stdout}
Set Suite Variable ${metric_threshold} ${scaleout_threshold}
- log ${metric_threshold}
+ Log ${metric_threshold}
Create NS Descriptor
Get VNF IP Address
${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${vnf_ip_addr} ${ip_addr}
Variable Should Exist ${prometheus_host} msg=Prometheus address is not available
Variable Should Exist ${prometheus_port} msg=Prometheus port is not available
Variable Should Exist ${metric_name} msg=Prometheus metric name is not available
- ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_name}
+ ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_name}
Run Keyword If ${metric_value} <= 0 Fail msg=The metric '${metric_name}' value is '${metric_value}'
Run Keyword If ${metric_value} >= ${metric_threshold} Fail msg=The metric '${metric_name}' value is higher than '${metric_threshold}' before scaling
Variable Should Exist ${prometheus_host} msg=Prometheus address is not available
Variable Should Exist ${prometheus_port} msg=Prometheus port is not available
Variable Should Exist ${metric_name} msg=Prometheus metric name is not available
- ${metric_value}= Get Metric ${prometheus_host} ${prometheus_port} ${metric_name}
+ ${metric_value}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_name}
Run Keyword If ${metric_value} <= ${metric_threshold} Fail msg=The metric '${metric_name}' value is '${metric_value}' which is lower than '${metric_threshold}'
Get Webhook Service VNF IP Address
${ip_addr}= Get Vnf Management Ip Address ${ws_ns_id} ${ws_vnf_member_index}
- log ${ip_addr}
+ Log ${ip_addr}
Set Suite Variable ${ws_vnf_ip_addr} ${ip_addr}
Create VNF Descriptor
${rc} ${stdout}= Run and Return RC and Output mkdir '%{PACKAGES_FOLDER}/${new_vnfd_pkg}' && WEBHOOK_URL="http://${ws_vnf_ip_addr}:${ws_port}" envsubst < '%{PACKAGES_FOLDER}/${vnfd_pkg}'/'${vnfd_file}' > '%{PACKAGES_FOLDER}/${new_vnfd_pkg}'/'${vnfd_file}'
- log ${stdout}
+ Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Create VNFD '%{PACKAGES_FOLDER}/${new_vnfd_pkg}'
Variable Should Exist ${prometheus_host} msg=Prometheus address is not available
Variable Should Exist ${prometheus_port} msg=Prometheus port is not available
Variable Should Exist ${metric_name} msg=Prometheus metric name is not available
- ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_name}
+ ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_name}
Run Keyword If ${metric_value} <= 0 Fail msg=The metric '${metric_name}' value is '${metric_value}'
[Documentation] Removes the temporary package folder created for the test
[Arguments] ${folder_name}
${rc} ${stdout}= Run and Return RC and Output rm -rf '${folder_name}'
- log ${stdout}
+ Log ${stdout}
Variable Should Exist ${prometheus_port} msg=Prometheus port is not available
Variable Should Exist ${metric_1_name} msg=Prometheus first metric name is not available
Variable Should Exist ${metric_2_name} msg=Prometheus second metric name is not available
- ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_1_name} ${metric_1_filter}
+ ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_1_name} ${metric_1_filter}
Run Keyword If ${metric_1_value} <= 0 Fail msg=The metric '${metric_1_name}' value is '${metric_1_value}'
- ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_2_name} ${metric_2_filter}
+ ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_2_name} ${metric_2_filter}
Run Keyword If ${metric_2_value} <= 0 Fail msg=The metric '${metric_2_name}' value is '${metric_2_value}'
# Get all the ns_id in the slice except the middle one to avoid self ping
@{slice_ns_list} Get Slice Ns List Except One ${slice_name} ${middle_ns_name}
- log many @{slice_ns_list}
+ Log many @{slice_ns_list}
@{temp_list}= Create List
# For each ns_id in the list, get all the vnf_id and their IP addresses
FOR ${ns_id} IN @{slice_ns_list}
- log ${ns_id}
+ Log ${ns_id}
@{vnf_id_list} Get Ns Vnf List ${ns_id}
# For each vnf_id in the list, get all its IP addresses
@{ns_ip_list} Get Ns Ip List @{vnf_id_list}
Sleep 60s Waiting for the network to be up
# Ping to the middle VNF
- log ${mgmt_vnf_ip}
+ Log ${mgmt_vnf_ip}
Test Connectivity ${mgmt_vnf_ip}