From 5020a8f9c93746d526bd062630e8ab73e0306bbd Mon Sep 17 00:00:00 2001 From: Felipe Vicens Date: Wed, 1 Jul 2020 18:41:38 +0200 Subject: [PATCH] Moving robot-systests deprecated to tests Change-Id: I9008b7e8a2fe47d2f8f50becc74d8aea50bb1c14 Signed-off-by: Felipe Vicens --- robot-systest/deprecated/README_Robot_Test.md | 86 ++++++ robot-systest/deprecated/lib/api/common.robot | 64 +++++ .../deprecated/lib/api/vim_lib.robot | 60 +++++ .../lib/cli/network_slicing_lib.robot | 118 +++++++++ robot-systest/deprecated/lib/cli/ns_lib.robot | 193 ++++++++++++++ .../deprecated/lib/cli/nsd_lib.robot | 85 ++++++ .../lib/cli/osm_package_tools_lib.robot | 88 +++++++ ...osm_platform_resiliancy_recovery_lib.robot | 55 ++++ .../deprecated/lib/cli/rbac_lib.robot | 245 ++++++++++++++++++ .../deprecated/lib/cli/sdnc_account_lib.robot | 65 +++++ .../deprecated/lib/cli/vim_account_lib.robot | 136 ++++++++++ .../deprecated/lib/cli/vnfd_lib.robot | 85 ++++++ .../deprecated/lib/client_lib/client_lib.py | 69 +++++ robot-systest/deprecated/lib/custom_lib.py | 67 +++++ .../deprecated/lib/gui/login_gui.robot | 87 +++++++ .../deprecated/resource/api/common.robot | 46 ++++ .../deprecated/resource/api/variables.py | 33 +++ .../cli/disable_port_security_ns_data.py | 29 +++ .../resource/cli/hackfest_basic_ns_data.py | 32 +++ .../cli/hackfest_cloudinit_ns_data.py | 32 +++ .../resource/cli/hackfest_epa_ns_data.py | 32 +++ .../resource/cli/hackfest_multivdu_ns_data.py | 32 +++ .../cli/hackfest_simplecharm_ns_data.py | 32 +++ .../deprecated/resource/cli/test_vnf_data.py | 32 +++ .../resource/cli/ubuntu-cloudinit_ns_data.py | 30 +++ robot-systest/deprecated/run_test.sh | 109 ++++++++ .../testsuite/api/TS01__Vim_Account.robot | 54 ++++ .../testsuite/cli/TS008__Test_SDNC.robot | 45 ++++ ...9__Feature_6283_Network_Slicing_Test.robot | 117 +++++++++ ...latform_Resiliency_and_Recovery_Test.robot | 62 +++++ ..._Feature_1415_RBAC_For_Platform_Test.robot | 106 ++++++++ ...nstantiation_Parameters_in_CloudInit.robot | 87 +++++++ ...Visibility_Of_Packages_And_Instances.robot | 144 ++++++++++ ...Feature_7921_MongoDB_Filesystem_Test.robot | 124 +++++++++ ...ient_Package_Creation_And_Validation.robot | 84 ++++++ .../TS016__Manual_VNF_VDU_Scaling_Test.robot | 129 +++++++++ ...sable_Port_Security_at_Network_level.robot | 122 +++++++++ .../testsuite/cli/TS01__Test_VNF.robot | 107 ++++++++ .../testsuite/cli/TS02__Test_Vim.robot | 49 ++++ .../cli/TS03__Hackfest_Basic_NS.robot | 108 ++++++++ .../cli/TS04__Hackfest_Simplecharm_NS.robot | 113 ++++++++ .../cli/TS05__Hackfest_Multivdu_NS.robot | 108 ++++++++ .../cli/TS06__Hackfest_Cloudinit_NS.robot | 108 ++++++++ .../testsuite/cli/TS07__Hackfest_EPA_NS.robot | 108 ++++++++ .../deprecated/testsuite/cli/__init__.robot | 39 +++ .../TS01__OSMClient_Library_Test.robot | 82 ++++++ .../testsuite/gui/TS01__Test_GUI_Login.robot | 41 +++ 47 files changed, 3879 insertions(+) create mode 100644 robot-systest/deprecated/README_Robot_Test.md create mode 100644 robot-systest/deprecated/lib/api/common.robot create mode 100644 robot-systest/deprecated/lib/api/vim_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/network_slicing_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/ns_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/nsd_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/osm_package_tools_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/osm_platform_resiliancy_recovery_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/rbac_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/sdnc_account_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/vim_account_lib.robot create mode 100644 robot-systest/deprecated/lib/cli/vnfd_lib.robot create mode 100644 robot-systest/deprecated/lib/client_lib/client_lib.py create mode 100644 robot-systest/deprecated/lib/custom_lib.py create mode 100644 robot-systest/deprecated/lib/gui/login_gui.robot create mode 100644 robot-systest/deprecated/resource/api/common.robot create mode 100644 robot-systest/deprecated/resource/api/variables.py create mode 100644 robot-systest/deprecated/resource/cli/disable_port_security_ns_data.py create mode 100644 robot-systest/deprecated/resource/cli/hackfest_basic_ns_data.py create mode 100644 robot-systest/deprecated/resource/cli/hackfest_cloudinit_ns_data.py create mode 100644 robot-systest/deprecated/resource/cli/hackfest_epa_ns_data.py create mode 100644 robot-systest/deprecated/resource/cli/hackfest_multivdu_ns_data.py create mode 100644 robot-systest/deprecated/resource/cli/hackfest_simplecharm_ns_data.py create mode 100644 robot-systest/deprecated/resource/cli/test_vnf_data.py create mode 100644 robot-systest/deprecated/resource/cli/ubuntu-cloudinit_ns_data.py create mode 100644 robot-systest/deprecated/run_test.sh create mode 100644 robot-systest/deprecated/testsuite/api/TS01__Vim_Account.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS008__Test_SDNC.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS009__Feature_6283_Network_Slicing_Test.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS010__OSM_Platform_Resiliency_and_Recovery_Test.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS011__Feature_1415_RBAC_For_Platform_Test.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS012__Feature_7181_Allow_Instantiation_Parameters_in_CloudInit.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS013__Feature_1415_RBAC_Visibility_Of_Packages_And_Instances.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS014__Feature_7921_MongoDB_Filesystem_Test.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS015__Feature_8047_OSMClient_Package_Creation_And_Validation.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS016__Manual_VNF_VDU_Scaling_Test.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS017__Feature_7326_Disable_Port_Security_at_Network_level.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS01__Test_VNF.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS02__Test_Vim.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS03__Hackfest_Basic_NS.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS04__Hackfest_Simplecharm_NS.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS05__Hackfest_Multivdu_NS.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS06__Hackfest_Cloudinit_NS.robot create mode 100644 robot-systest/deprecated/testsuite/cli/TS07__Hackfest_EPA_NS.robot create mode 100644 robot-systest/deprecated/testsuite/cli/__init__.robot create mode 100644 robot-systest/deprecated/testsuite/client_library/TS01__OSMClient_Library_Test.robot create mode 100644 robot-systest/deprecated/testsuite/gui/TS01__Test_GUI_Login.robot diff --git a/robot-systest/deprecated/README_Robot_Test.md b/robot-systest/deprecated/README_Robot_Test.md new file mode 100644 index 0000000..083e1dd --- /dev/null +++ b/robot-systest/deprecated/README_Robot_Test.md @@ -0,0 +1,86 @@ + + + +# 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= +``` + +OpenStack Details +``` +export OS_AUTH_URL= +export OS_PASSWORD= +export OS_PROJECT_NAME= +export OS_VIM_CONFIG= +``` + +VCD Details +``` +export VCD_AUTH_URL= +export VCD_USERNAME= +export VCD_PASSWORD= +export VCD_TENANT_NAME= +export VCD_ORGANIZATION= +export VCD_VIM_CONFIG= +``` + +Note:- Optional +``` +export NS_CONFIG= +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 diff --git a/robot-systest/deprecated/lib/api/common.robot b/robot-systest/deprecated/lib/api/common.robot new file mode 100644 index 0000000..4724016 --- /dev/null +++ b/robot-systest/deprecated/lib/api/common.robot @@ -0,0 +1,64 @@ +# -*- 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 diff --git a/robot-systest/deprecated/lib/api/vim_lib.robot b/robot-systest/deprecated/lib/api/vim_lib.robot new file mode 100644 index 0000000..a52354f --- /dev/null +++ b/robot-systest/deprecated/lib/api/vim_lib.robot @@ -0,0 +1,60 @@ +# -*- 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} diff --git a/robot-systest/deprecated/lib/cli/network_slicing_lib.robot b/robot-systest/deprecated/lib/cli/network_slicing_lib.robot new file mode 100644 index 0000000..9a3ff37 --- /dev/null +++ b/robot-systest/deprecated/lib/cli/network_slicing_lib.robot @@ -0,0 +1,118 @@ +# -*- 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} diff --git a/robot-systest/deprecated/lib/cli/ns_lib.robot b/robot-systest/deprecated/lib/cli/ns_lib.robot new file mode 100644 index 0000000..e0eb0c2 --- /dev/null +++ b/robot-systest/deprecated/lib/cli/ns_lib.robot @@ -0,0 +1,193 @@ +# -*- 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} diff --git a/robot-systest/deprecated/lib/cli/nsd_lib.robot b/robot-systest/deprecated/lib/cli/nsd_lib.robot new file mode 100644 index 0000000..da27b4f --- /dev/null +++ b/robot-systest/deprecated/lib/cli/nsd_lib.robot @@ -0,0 +1,85 @@ +# -*- 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} diff --git a/robot-systest/deprecated/lib/cli/osm_package_tools_lib.robot b/robot-systest/deprecated/lib/cli/osm_package_tools_lib.robot new file mode 100644 index 0000000..c8a864c --- /dev/null +++ b/robot-systest/deprecated/lib/cli/osm_package_tools_lib.robot @@ -0,0 +1,88 @@ +# 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} diff --git a/robot-systest/deprecated/lib/cli/osm_platform_resiliancy_recovery_lib.robot b/robot-systest/deprecated/lib/cli/osm_platform_resiliancy_recovery_lib.robot new file mode 100644 index 0000000..fb86768 --- /dev/null +++ b/robot-systest/deprecated/lib/cli/osm_platform_resiliancy_recovery_lib.robot @@ -0,0 +1,55 @@ +# -*- 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 diff --git a/robot-systest/deprecated/lib/cli/rbac_lib.robot b/robot-systest/deprecated/lib/cli/rbac_lib.robot new file mode 100644 index 0000000..bbf717a --- /dev/null +++ b/robot-systest/deprecated/lib/cli/rbac_lib.robot @@ -0,0 +1,245 @@ +## +# 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} diff --git a/robot-systest/deprecated/lib/cli/sdnc_account_lib.robot b/robot-systest/deprecated/lib/cli/sdnc_account_lib.robot new file mode 100644 index 0000000..71680b8 --- /dev/null +++ b/robot-systest/deprecated/lib/cli/sdnc_account_lib.robot @@ -0,0 +1,65 @@ +# -*- 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 diff --git a/robot-systest/deprecated/lib/cli/vim_account_lib.robot b/robot-systest/deprecated/lib/cli/vim_account_lib.robot new file mode 100644 index 0000000..c3c8242 --- /dev/null +++ b/robot-systest/deprecated/lib/cli/vim_account_lib.robot @@ -0,0 +1,136 @@ +# -*- 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} diff --git a/robot-systest/deprecated/lib/cli/vnfd_lib.robot b/robot-systest/deprecated/lib/cli/vnfd_lib.robot new file mode 100644 index 0000000..1b99f43 --- /dev/null +++ b/robot-systest/deprecated/lib/cli/vnfd_lib.robot @@ -0,0 +1,85 @@ +# -*- 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} diff --git a/robot-systest/deprecated/lib/client_lib/client_lib.py b/robot-systest/deprecated/lib/client_lib/client_lib.py new file mode 100644 index 0000000..c9390ae --- /dev/null +++ b/robot-systest/deprecated/lib/client_lib/client_lib.py @@ -0,0 +1,69 @@ +## +# 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) diff --git a/robot-systest/deprecated/lib/custom_lib.py b/robot-systest/deprecated/lib/custom_lib.py new file mode 100644 index 0000000..2a3d23f --- /dev/null +++ b/robot-systest/deprecated/lib/custom_lib.py @@ -0,0 +1,67 @@ +# -*- 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() diff --git a/robot-systest/deprecated/lib/gui/login_gui.robot b/robot-systest/deprecated/lib/gui/login_gui.robot new file mode 100644 index 0000000..c125664 --- /dev/null +++ b/robot-systest/deprecated/lib/gui/login_gui.robot @@ -0,0 +1,87 @@ +# -*- 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} diff --git a/robot-systest/deprecated/resource/api/common.robot b/robot-systest/deprecated/resource/api/common.robot new file mode 100644 index 0000000..9342316 --- /dev/null +++ b/robot-systest/deprecated/resource/api/common.robot @@ -0,0 +1,46 @@ +# -*- 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 diff --git a/robot-systest/deprecated/resource/api/variables.py b/robot-systest/deprecated/resource/api/variables.py new file mode 100644 index 0000000..a97763a --- /dev/null +++ b/robot-systest/deprecated/resource/api/variables.py @@ -0,0 +1,33 @@ +# -*- 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' diff --git a/robot-systest/deprecated/resource/cli/disable_port_security_ns_data.py b/robot-systest/deprecated/resource/cli/disable_port_security_ns_data.py new file mode 100644 index 0000000..e1383bd --- /dev/null +++ b/robot-systest/deprecated/resource/cli/disable_port_security_ns_data.py @@ -0,0 +1,29 @@ +# -*- 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' diff --git a/robot-systest/deprecated/resource/cli/hackfest_basic_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_basic_ns_data.py new file mode 100644 index 0000000..8b8054b --- /dev/null +++ b/robot-systest/deprecated/resource/cli/hackfest_basic_ns_data.py @@ -0,0 +1,32 @@ +# -*- 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' diff --git a/robot-systest/deprecated/resource/cli/hackfest_cloudinit_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_cloudinit_ns_data.py new file mode 100644 index 0000000..d725a36 --- /dev/null +++ b/robot-systest/deprecated/resource/cli/hackfest_cloudinit_ns_data.py @@ -0,0 +1,32 @@ +# -*- 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' diff --git a/robot-systest/deprecated/resource/cli/hackfest_epa_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_epa_ns_data.py new file mode 100644 index 0000000..8975e31 --- /dev/null +++ b/robot-systest/deprecated/resource/cli/hackfest_epa_ns_data.py @@ -0,0 +1,32 @@ +# -*- 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' diff --git a/robot-systest/deprecated/resource/cli/hackfest_multivdu_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_multivdu_ns_data.py new file mode 100644 index 0000000..5ecb9e8 --- /dev/null +++ b/robot-systest/deprecated/resource/cli/hackfest_multivdu_ns_data.py @@ -0,0 +1,32 @@ +# -*- 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' diff --git a/robot-systest/deprecated/resource/cli/hackfest_simplecharm_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_simplecharm_ns_data.py new file mode 100644 index 0000000..5ffcd35 --- /dev/null +++ b/robot-systest/deprecated/resource/cli/hackfest_simplecharm_ns_data.py @@ -0,0 +1,32 @@ +# -*- 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' diff --git a/robot-systest/deprecated/resource/cli/test_vnf_data.py b/robot-systest/deprecated/resource/cli/test_vnf_data.py new file mode 100644 index 0000000..02ee065 --- /dev/null +++ b/robot-systest/deprecated/resource/cli/test_vnf_data.py @@ -0,0 +1,32 @@ +# -*- 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' diff --git a/robot-systest/deprecated/resource/cli/ubuntu-cloudinit_ns_data.py b/robot-systest/deprecated/resource/cli/ubuntu-cloudinit_ns_data.py new file mode 100644 index 0000000..ce68037 --- /dev/null +++ b/robot-systest/deprecated/resource/cli/ubuntu-cloudinit_ns_data.py @@ -0,0 +1,30 @@ +# -*- 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' diff --git a/robot-systest/deprecated/run_test.sh b/robot-systest/deprecated/run_test.sh new file mode 100644 index 0000000..3f86ff9 --- /dev/null +++ b/robot-systest/deprecated/run_test.sh @@ -0,0 +1,109 @@ +#!/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 diff --git a/robot-systest/deprecated/testsuite/api/TS01__Vim_Account.robot b/robot-systest/deprecated/testsuite/api/TS01__Vim_Account.robot new file mode 100644 index 0000000..be04c3f --- /dev/null +++ b/robot-systest/deprecated/testsuite/api/TS01__Vim_Account.robot @@ -0,0 +1,54 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS008__Test_SDNC.robot b/robot-systest/deprecated/testsuite/cli/TS008__Test_SDNC.robot new file mode 100644 index 0000000..3b2b21a --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS008__Test_SDNC.robot @@ -0,0 +1,45 @@ +# -*- 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 diff --git a/robot-systest/deprecated/testsuite/cli/TS009__Feature_6283_Network_Slicing_Test.robot b/robot-systest/deprecated/testsuite/cli/TS009__Feature_6283_Network_Slicing_Test.robot new file mode 100644 index 0000000..fa8c44a --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS009__Feature_6283_Network_Slicing_Test.robot @@ -0,0 +1,117 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS010__OSM_Platform_Resiliency_and_Recovery_Test.robot b/robot-systest/deprecated/testsuite/cli/TS010__OSM_Platform_Resiliency_and_Recovery_Test.robot new file mode 100644 index 0000000..2475e74 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS010__OSM_Platform_Resiliency_and_Recovery_Test.robot @@ -0,0 +1,62 @@ +# -*- 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 diff --git a/robot-systest/deprecated/testsuite/cli/TS011__Feature_1415_RBAC_For_Platform_Test.robot b/robot-systest/deprecated/testsuite/cli/TS011__Feature_1415_RBAC_For_Platform_Test.robot new file mode 100644 index 0000000..c8e44e1 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS011__Feature_1415_RBAC_For_Platform_Test.robot @@ -0,0 +1,106 @@ +## +# 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 diff --git a/robot-systest/deprecated/testsuite/cli/TS012__Feature_7181_Allow_Instantiation_Parameters_in_CloudInit.robot b/robot-systest/deprecated/testsuite/cli/TS012__Feature_7181_Allow_Instantiation_Parameters_in_CloudInit.robot new file mode 100644 index 0000000..c5e1c75 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS012__Feature_7181_Allow_Instantiation_Parameters_in_CloudInit.robot @@ -0,0 +1,87 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS013__Feature_1415_RBAC_Visibility_Of_Packages_And_Instances.robot b/robot-systest/deprecated/testsuite/cli/TS013__Feature_1415_RBAC_Visibility_Of_Packages_And_Instances.robot new file mode 100644 index 0000000..4302951 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS013__Feature_1415_RBAC_Visibility_Of_Packages_And_Instances.robot @@ -0,0 +1,144 @@ +## +# 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS014__Feature_7921_MongoDB_Filesystem_Test.robot b/robot-systest/deprecated/testsuite/cli/TS014__Feature_7921_MongoDB_Filesystem_Test.robot new file mode 100644 index 0000000..3070d41 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS014__Feature_7921_MongoDB_Filesystem_Test.robot @@ -0,0 +1,124 @@ +## +# 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS015__Feature_8047_OSMClient_Package_Creation_And_Validation.robot b/robot-systest/deprecated/testsuite/cli/TS015__Feature_8047_OSMClient_Package_Creation_And_Validation.robot new file mode 100644 index 0000000..e717c10 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS015__Feature_8047_OSMClient_Package_Creation_And_Validation.robot @@ -0,0 +1,84 @@ +## +# 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 diff --git a/robot-systest/deprecated/testsuite/cli/TS016__Manual_VNF_VDU_Scaling_Test.robot b/robot-systest/deprecated/testsuite/cli/TS016__Manual_VNF_VDU_Scaling_Test.robot new file mode 100644 index 0000000..3f7bce8 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS016__Manual_VNF_VDU_Scaling_Test.robot @@ -0,0 +1,129 @@ +## +# 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS017__Feature_7326_Disable_Port_Security_at_Network_level.robot b/robot-systest/deprecated/testsuite/cli/TS017__Feature_7326_Disable_Port_Security_at_Network_level.robot new file mode 100644 index 0000000..562dc15 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS017__Feature_7326_Disable_Port_Security_at_Network_level.robot @@ -0,0 +1,122 @@ +# -*- 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 , 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS01__Test_VNF.robot b/robot-systest/deprecated/testsuite/cli/TS01__Test_VNF.robot new file mode 100644 index 0000000..84e1f92 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS01__Test_VNF.robot @@ -0,0 +1,107 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS02__Test_Vim.robot b/robot-systest/deprecated/testsuite/cli/TS02__Test_Vim.robot new file mode 100644 index 0000000..18f2a50 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS02__Test_Vim.robot @@ -0,0 +1,49 @@ +# -*- 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 diff --git a/robot-systest/deprecated/testsuite/cli/TS03__Hackfest_Basic_NS.robot b/robot-systest/deprecated/testsuite/cli/TS03__Hackfest_Basic_NS.robot new file mode 100644 index 0000000..40492f7 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS03__Hackfest_Basic_NS.robot @@ -0,0 +1,108 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS04__Hackfest_Simplecharm_NS.robot b/robot-systest/deprecated/testsuite/cli/TS04__Hackfest_Simplecharm_NS.robot new file mode 100644 index 0000000..2a22478 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS04__Hackfest_Simplecharm_NS.robot @@ -0,0 +1,113 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS05__Hackfest_Multivdu_NS.robot b/robot-systest/deprecated/testsuite/cli/TS05__Hackfest_Multivdu_NS.robot new file mode 100644 index 0000000..e3cc440 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS05__Hackfest_Multivdu_NS.robot @@ -0,0 +1,108 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS06__Hackfest_Cloudinit_NS.robot b/robot-systest/deprecated/testsuite/cli/TS06__Hackfest_Cloudinit_NS.robot new file mode 100644 index 0000000..87bf22f --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS06__Hackfest_Cloudinit_NS.robot @@ -0,0 +1,108 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/TS07__Hackfest_EPA_NS.robot b/robot-systest/deprecated/testsuite/cli/TS07__Hackfest_EPA_NS.robot new file mode 100644 index 0000000..5316598 --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/TS07__Hackfest_EPA_NS.robot @@ -0,0 +1,108 @@ +# -*- 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} diff --git a/robot-systest/deprecated/testsuite/cli/__init__.robot b/robot-systest/deprecated/testsuite/cli/__init__.robot new file mode 100644 index 0000000..2d959da --- /dev/null +++ b/robot-systest/deprecated/testsuite/cli/__init__.robot @@ -0,0 +1,39 @@ +# -*- 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 diff --git a/robot-systest/deprecated/testsuite/client_library/TS01__OSMClient_Library_Test.robot b/robot-systest/deprecated/testsuite/client_library/TS01__OSMClient_Library_Test.robot new file mode 100644 index 0000000..88d8b5c --- /dev/null +++ b/robot-systest/deprecated/testsuite/client_library/TS01__OSMClient_Library_Test.robot @@ -0,0 +1,82 @@ +## +# 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 diff --git a/robot-systest/deprecated/testsuite/gui/TS01__Test_GUI_Login.robot b/robot-systest/deprecated/testsuite/gui/TS01__Test_GUI_Login.robot new file mode 100644 index 0000000..4f20a18 --- /dev/null +++ b/robot-systest/deprecated/testsuite/gui/TS01__Test_GUI_Login.robot @@ -0,0 +1,41 @@ +# -*- 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 -- 2.17.1