Initial commit. Moved previous robot test to robot-systest/deprecated. Added basic tests.
Change-Id: I2457a8e66da3df639e4f9e7d4aa91045494055c6
Signed-off-by: romeromonser <garomero@indra.es>
diff --git a/robot-systest/lib/api/common.robot b/robot-systest/lib/api/common.robot
deleted file mode 100644
index 4724016..0000000
--- a/robot-systest/lib/api/common.robot
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- 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/lib/api/vim_lib.robot b/robot-systest/lib/api/vim_lib.robot
deleted file mode 100644
index a52354f..0000000
--- a/robot-systest/lib/api/vim_lib.robot
+++ /dev/null
@@ -1,60 +0,0 @@
-# -*- 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/lib/cli/network_slicing_lib.robot b/robot-systest/lib/cli/network_slicing_lib.robot
deleted file mode 100644
index 9a3ff37..0000000
--- a/robot-systest/lib/cli/network_slicing_lib.robot
+++ /dev/null
@@ -1,118 +0,0 @@
-# -*- 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/lib/cli/ns_lib.robot b/robot-systest/lib/cli/ns_lib.robot
deleted file mode 100644
index e0eb0c2..0000000
--- a/robot-systest/lib/cli/ns_lib.robot
+++ /dev/null
@@ -1,193 +0,0 @@
-# -*- 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/lib/cli/nsd_lib.robot b/robot-systest/lib/cli/nsd_lib.robot
deleted file mode 100644
index da27b4f..0000000
--- a/robot-systest/lib/cli/nsd_lib.robot
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- 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/lib/cli/osm_package_tools_lib.robot b/robot-systest/lib/cli/osm_package_tools_lib.robot
deleted file mode 100644
index c8a864c..0000000
--- a/robot-systest/lib/cli/osm_package_tools_lib.robot
+++ /dev/null
@@ -1,88 +0,0 @@
-# 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/lib/cli/osm_platform_resiliancy_recovery_lib.robot b/robot-systest/lib/cli/osm_platform_resiliancy_recovery_lib.robot
deleted file mode 100644
index fb86768..0000000
--- a/robot-systest/lib/cli/osm_platform_resiliancy_recovery_lib.robot
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- 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/lib/cli/rbac_lib.robot b/robot-systest/lib/cli/rbac_lib.robot
deleted file mode 100644
index bbf717a..0000000
--- a/robot-systest/lib/cli/rbac_lib.robot
+++ /dev/null
@@ -1,245 +0,0 @@
-##
-# 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/lib/cli/sdnc_account_lib.robot b/robot-systest/lib/cli/sdnc_account_lib.robot
deleted file mode 100644
index 71680b8..0000000
--- a/robot-systest/lib/cli/sdnc_account_lib.robot
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- 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/lib/cli/vim_account_lib.robot b/robot-systest/lib/cli/vim_account_lib.robot
deleted file mode 100644
index c3c8242..0000000
--- a/robot-systest/lib/cli/vim_account_lib.robot
+++ /dev/null
@@ -1,136 +0,0 @@
-# -*- 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/lib/cli/vnfd_lib.robot b/robot-systest/lib/cli/vnfd_lib.robot
deleted file mode 100644
index 1b99f43..0000000
--- a/robot-systest/lib/cli/vnfd_lib.robot
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- 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/lib/client_lib/client_lib.py b/robot-systest/lib/client_lib/client_lib.py
deleted file mode 100644
index c9390ae..0000000
--- a/robot-systest/lib/client_lib/client_lib.py
+++ /dev/null
@@ -1,69 +0,0 @@
-##
-# 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/lib/connectivity_lib.robot b/robot-systest/lib/connectivity_lib.robot
new file mode 100644
index 0000000..7b86593
--- /dev/null
+++ b/robot-systest/lib/connectivity_lib.robot
@@ -0,0 +1,19 @@
+# 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.
+
+*** Keywords ***
+Test Connectivity
+ [Arguments] ${host}
+
+ ${result} Run Process ping -c 5 -W 1 ${host} > /dev/null && echo OK shell=True
+ Log all output: ${result.stdout}
+ Should Contain ${result.stdout} OK
diff --git a/robot-systest/lib/custom_lib.py b/robot-systest/lib/custom_lib.py
deleted file mode 100644
index 2a3d23f..0000000
--- a/robot-systest/lib/custom_lib.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- 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/lib/gui/login_gui.robot b/robot-systest/lib/gui/login_gui.robot
deleted file mode 100644
index c125664..0000000
--- a/robot-systest/lib/gui/login_gui.robot
+++ /dev/null
@@ -1,87 +0,0 @@
-# -*- 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/lib/ns_lib.robot b/robot-systest/lib/ns_lib.robot
new file mode 100644
index 0000000..cc252fb
--- /dev/null
+++ b/robot-systest/lib/ns_lib.robot
@@ -0,0 +1,82 @@
+# 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
+${ns_launch_max_wait_time} 5min
+${ns_launch_pol_time} 30sec
+${ns_delete_max_wait_time} 1min
+${ns_delete_pol_time} 15sec
+
+*** Keywords ***
+Create Network Service
+ [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config} ${publickey}
+
+ ${config_attr} Set Variable If '${ns_config}'!='${EMPTY}' --config '${ns_config}' \
+ ${sshkeys_attr} Set Variable If '${publickey}'!='${EMPTY}' --ssh_keys ${publickey} \
+
+ ${ns_id}= Instantiate Network Service ${ns_name} ${nsd} ${vim_name} ${config_attr} ${sshkeys_attr}
+ log ${ns_id}
+
+ WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For NS Instance To Configured ${ns_name}
+ Check For NS Instance For Failure ${ns_name}
+ [Return] ${ns_id}
+
+Instantiate Network Service
+ [Arguments] ${ns_name} ${nsd} ${vim_name} ${ns_extra_args}
+
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name} ${ns_extra_args}
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
+
+Get Vnf Management Ip Address
+ [Arguments] ${ns_id} ${vnf_member_index}
+
+ Should Not Be Empty ${ns_id}
+ Should Not Be Empty ${vnf_member_index}
+ ${rc} ${stdout}= Run and Return RC and Output osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $14}' 2>&1
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
+
+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 Deleted
+ [Arguments] ${ns}
+
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-list | awk '{print $2}' | grep ${ns}
+ Should Not Be Equal As Strings ${stdout} ${ns}
+
+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 Deleted ${ns}
diff --git a/robot-systest/lib/nsd_lib.robot b/robot-systest/lib/nsd_lib.robot
new file mode 100644
index 0000000..8af1379
--- /dev/null
+++ b/robot-systest/lib/nsd_lib.robot
@@ -0,0 +1,59 @@
+# -*- 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
+ ${rc} ${stdout}= Run and Return RC and Output osm nsd-list
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+
+
+Create NSD
+ [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
+ [Arguments] ${nsd_id}
+
+ ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm nsd-delete ${nsd_id}
+ log ${stdout}
+ 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 | awk '{print $2}' | grep ${nsd_id}
+ Should Not Be Equal As Strings ${stdout} ${nsd_id}
diff --git a/robot-systest/lib/ssh_lib.robot b/robot-systest/lib/ssh_lib.robot
new file mode 100644
index 0000000..3d2d708
--- /dev/null
+++ b/robot-systest/lib/ssh_lib.robot
@@ -0,0 +1,54 @@
+# 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.
+
+*** Keywords ***
+Test SSH Connection
+ [Arguments] ${host} ${username} ${password} ${privatekey}
+
+ Open Connection ${host}
+ Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password}
+ ... ELSE Login With Public Key ${username} ${privatekey}
+ Execute Command hostname
+ Close All Connections
+
+Check If remote File Exists
+ [Arguments] ${host} ${username} ${password} ${privatekey} ${file}
+
+ Open Connection ${host}
+ Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password}
+ ... ELSE Login With Public Key ${username} ${privatekey}
+ ${rc}= Execute Command ls ${file} >& /dev/null return_stdout=False return_rc=True
+ Close All Connections
+ Should Be Equal As Integers ${rc} 0
+
+Get Remote File Content
+ [Arguments] ${host} ${username} ${password} ${privatekey} ${file}
+
+ Open Connection ${host}
+ Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password}
+ ... ELSE Login With Public Key ${username} ${privatekey}
+ ${output}= Execute Command cat ${file}
+ Close All Connections
+ [Return] ${output}
+
+Execute Remote Command Check Rc Return Output
+ [Arguments] ${host} ${username} ${password} ${privatekey} ${command}
+
+ Open Connection ${host}
+ Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password}
+ ... ELSE Login With Public Key ${username} ${privatekey}
+ ${stdout} ${rc}= Execute Command ${command} return_rc=True return_stdout=True
+ log ${rc}
+ log ${stdout}
+ Close All Connections
+ Should Be Equal As Integers ${rc} 0
+ [Return] ${stdout}
\ No newline at end of file
diff --git a/robot-systest/lib/vnfd_lib.robot b/robot-systest/lib/vnfd_lib.robot
new file mode 100644
index 0000000..828ea0a
--- /dev/null
+++ b/robot-systest/lib/vnfd_lib.robot
@@ -0,0 +1,61 @@
+# -*- 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
+ ${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
+ [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
+ [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 | awk '{print $2}' | grep ${vnfd_id}
+ Should Not Be Equal As Strings ${stdout} ${vnfd_id}