Bug 873: Robot Automation improvement to install chrome driver only for gui test
Change-Id: If11bbb9a2f8e0b011fcdc3d16d7a6b72a035343f
Signed-off-by: yadavmr <my00514913@techmahindra.com>
diff --git a/robot-systest/lib/cli/ns_lib.robot b/robot-systest/lib/cli/ns_lib.robot
index e3e3a02..18f6430 100644
--- a/robot-systest/lib/cli/ns_lib.robot
+++ b/robot-systest/lib/cli/ns_lib.robot
@@ -35,59 +35,59 @@
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}
@@ -95,27 +95,27 @@
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}
@@ -123,7 +123,7 @@
[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}
diff --git a/robot-systest/lib/cli/sdnc_account_lib.robot b/robot-systest/lib/cli/sdnc_account_lib.robot
index 3085c1c..71680b8 100644
--- a/robot-systest/lib/cli/sdnc_account_lib.robot
+++ b/robot-systest/lib/cli/sdnc_account_lib.robot
@@ -27,14 +27,14 @@
${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}
@@ -50,7 +50,7 @@
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}
@@ -59,7 +59,7 @@
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
diff --git a/robot-systest/lib/cli/vim_account_lib.robot b/robot-systest/lib/cli/vim_account_lib.robot
index 699d199..76e6ff1 100644
--- a/robot-systest/lib/cli/vim_account_lib.robot
+++ b/robot-systest/lib/cli/vim_account_lib.robot
@@ -22,13 +22,19 @@
# 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"
@@ -63,16 +69,18 @@
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 ''
@@ -84,12 +92,17 @@
${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 ''
@@ -102,7 +115,11 @@
${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}