Get NS List
[Documentation] Get ns instance list
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-list
log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
+ Should Be Equal As Integers ${rc} ${success_return_code}
Launch Network Services and Return
[Arguments] ${vim_name}
-
- Should Not Be Empty ${nsd_ids} There are no NS descriptors to launch the NS
+
+ 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}
\ Delete NS ${ns_name}
-
+
Create Network Service
[Documentation] Create ns at osm
[Arguments] ${nsd} ${vim_name} ${ns_name}
- ${ns_config}= Get Environment Variable NS_CONFIG ${EMPTY}
- Run Keyword If ${ns_config}!='${EMPTY}' Create Network Service With Config ${nsd} ${vim_name} ${ns_name} ${ns_config}
- ... ELSE Create Network Service Without Config ${nsd} ${vim_name} ${ns_name}
-
+ ${ns_config}= Get Environment Variable 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}
+ ${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}
+ 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}
+ ${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}
+ 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}
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns}
log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
+ 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}"
+ ${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 Be Equal As Integers ${rc} ${success_return_code}
Should Contain Any ${stdout} configured failed
Check For NS Instance For Failure
[Arguments] ${ns_name}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${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 Be Equal As Integers ${rc} ${success_return_code}
Should Not Contain ${stdout} failed
Check For NS Instance To Be Delete
[Arguments] ${ns}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-list
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-list
log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
+ Should Be Equal As Integers ${rc} ${success_return_code}
Should Not Contain ${stdout} ${ns}
[Documentation] Forcely Delete ns
[Arguments] ${ns}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns}
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns}
log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
+ 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}
${ip} "1.1.1.1"
${type} "onos"
${port} "5858"
-${dpid} ""
+${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} return_rc=True
+ ${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}
Show SDNC Account
[Documentation] Get sdnc account details
- ${rc} ${stdout}= Run and Return RC and Output osm sdnc-show ${name} return_rc=True
+ ${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} return_rc=True
+ ${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
# 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
${name} "helloworld-os"
${user} "robottest"
${password} "fred"
-${authurl} "https://169.254.169.245/"
+${authurl} "https://127.0.0.1/"
${type} "openstack"
${desc} "a test vim"
${tenant} "robottest2"
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 ''
${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 ''
${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}
echo -e "\nInstalling robot requirements"
# installing python packages
pip install haikunator requests robotframework robotframework-seleniumlibrary robotframework-requests
-
- # 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
}
while getopts ":t:-:" o; do
exit 0
elif [[ "$TEST" == "smoke" ]]; then
echo "Robot Framework SMOKE test"
- robot -d $BASEDIR/reports -i smoke $BASEDIR/testsuite/
+ 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"
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 -d $BASEDIR/reports -i sanity $BASEDIR/testsuite/
+ 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)
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 -d $BASEDIR/reports -i comprehensive $BASEDIR/testsuite/
+ robot --removekeywords tag:vim-setup --removekeywords WUKS -d $BASEDIR/reports -i comprehensive $BASEDIR/testsuite/
exit 0
else
echo "wrong test provided"
@{vnfd_ids}
@{nsd_ids}
@{ns_ids}
-@{vim}
-#${vim_name} robot_test
*** Test Cases ***
Network Service Instance Test
[Documentation] Launch and terminate network services
[Tags] sanity
- [Setup] VIM Setup To Launch Network Services
[Teardown] Run Keyword And Ignore Error Network Service Instance Cleanup
- Should Not Be Empty ${vim} VIM details not provided
:FOR ${vim_name} IN @{vim}
\ Launch Network Services and Return ${vim_name}
:FOR ${ns} IN @{ns_ids}
\ Force Delete NS ${ns}
-
- :FOR ${vim_id} IN @{vim}
- \ Force Delete Vim Account ${vim_id}
${nsd_id}
@{nsd_ids}
@{ns_ids}
-@{vim}
*** Test Cases ***
Network Service Instance Test
[Documentation] Launch and terminate network services
[Tags] comprehensive hackfest_basic_ns
- [Setup] VIM Setup To Launch Network Services
[Teardown] Run Keyword And Ignore Error Network Service Instance Cleanup
- Should Not Be Empty ${vim} VIM details not provided
:FOR ${vim_name} IN @{vim}
\ Launch Network Services and Return ${vim_name}
:FOR ${ns_id} IN @{ns_ids}
\ Force Delete NS ${ns_id}
-
- :FOR ${vim_id} IN @{vim}
- \ Force Delete Vim Account ${vim_id}
${nsd_id}
@{nsd_ids}
@{ns_ids}
-@{vim}
${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
#Build VNF Descriptor ${vnfdPckgPath}
#Workarround for charm build issue
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../..${vnfdPckgPath}${/}build/' ${vnfdftpPath}
+ ${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}
[Tags] hackfest_simplecharm comprehensive
#Build NS Descriptor ${nsdPckgPath}
- ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../..${nsdPckgPath}${/}build/' ${nsdftpPath}
+ ${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
- [Setup] VIM Setup To Launch Network Services
[Teardown] Run Keyword And Ignore Error Network Service Instance Cleanup
- Should Not Be Empty ${vim} VIM details not provided
:FOR ${vim_name} IN @{vim}
\ Launch Network Services and Return ${vim_name}
:FOR ${ns_id} IN @{ns_ids}
\ Force Delete NS ${ns_id}
-
- :FOR ${vim_id} IN @{vim}
- \ Force Delete Vim Account ${vim_id}
${nsd_id}
@{nsd_ids}
@{ns_ids}
-@{vim}
*** Test Cases ***
Network Service Instance Test
[Documentation] Launch and terminate network services
[Tags] comprehensive hackfest_multivdu
- [Setup] VIM Setup To Launch Network Services
[Teardown] Run Keyword And Ignore Error Network Service Instance Cleanup
- Should Not Be Empty ${vim} VIM details not provided
:FOR ${vim_name} IN @{vim}
\ Launch Network Services and Return ${vim_name}
:FOR ${ns_id} IN @{ns_ids}
\ Force Delete NS ${ns_id}
-
- :FOR ${vim_id} IN @{vim}
- \ Force Delete Vim Account ${vim_id}
${nsd_id}
@{nsd_ids}
@{ns_ids}
-@{vim}
*** Test Cases ***
Network Service Instance Test
[Documentation] Launch and terminate network services
[Tags] comprehensive hackfest_cloudinit
- [Setup] VIM Setup To Launch Network Services
[Teardown] Run Keyword And Ignore Error Network Service Instance Cleanup
- Should Not Be Empty ${vim} VIM details not provided
:FOR ${vim_name} IN @{vim}
\ Launch Network Services and Return ${vim_name}
:FOR ${ns_id} IN @{ns_ids}
\ Force Delete NS ${ns_id}
-
- :FOR ${vim_id} IN @{vim}
- \ Force Delete Vim Account ${vim_id}
${nsd_id}
@{nsd_ids}
@{ns_ids}
-@{vim}
*** Test Cases ***
Network Service Instance Test
[Documentation] Launch and terminate network services
[Tags] hackfest_epa
- [Setup] VIM Setup To Launch Network Services
[Teardown] Run Keyword And Ignore Error Network Service Instance Cleanup
- Should Not Be Empty ${vim} VIM details not provided
:FOR ${vim_name} IN @{vim}
\ Launch Network Services and Return ${vim_name}
:FOR ${ns_id} IN @{ns_ids}
\ Force Delete NS ${ns_id}
-
- :FOR ${vim_id} IN @{vim}
- \ Force Delete Vim Account ${vim_id}
--- /dev/null
+# -*- coding: utf-8 -*-
+
+##
+# Copyright 2019 Tech Mahindra Limited
+#
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+##
+
+*** Settings ***
+Library OperatingSystem
+Library String
+Library Collections
+Library ../../lib/custom_lib.py
+Resource ../../lib/cli/vim_account_lib.robot
+
+Suite Setup Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services
+Suite Teardown Run Keyword And Ignore Error Suite Cleanup
+
+
+*** Variables ***
+@{vim}
+
+
+*** Keywords ***
+Suite Cleanup
+ :FOR ${vim_id} IN @{vim}
+ \ Force Delete Vim Account ${vim_id}
\ No newline at end of file
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 ClientLib host=${host} WITH NAME osmclient
+ Import Library client_lib.ClientLib host=${host} WITH NAME osmclient