From 19a4fea88bf1479bccc30c18b15a0ea8514ac86b Mon Sep 17 00:00:00 2001 From: yadavmr Date: Tue, 17 Dec 2019 01:11:05 +0530 Subject: [PATCH] Bug 873: Robot Automation improvement: NS_CONFIG Provided via both 1. Using Environment variable/file 2. Using Testsuit Variable Change-Id: I762e6a6f00ec02604b588f808955bd780f679555 Signed-off-by: yadavmr --- jenkins/ci-pipelines/ci_stage_3.groovy | 5 ----- robot-systest/README_Robot_Test.md | 2 +- robot-systest/lib/cli/ns_lib.robot | 22 ++++++++++++++++++---- robot-systest/run_test.sh | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 64378d8b..153abcbf 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -50,7 +50,6 @@ properties([ booleanParam(defaultValue: false, description: '', name: 'SAVE_ARTIFACTS_OVERRIDE'), string(defaultValue: '/home/jenkins/hive/openstack-etsi.rc', description: '', name: 'HIVE_VIM_1'), booleanParam(defaultValue: false, description: '', name: 'DO_ROBOT'), - booleanParam(defaultValue: false, description: '', name: 'DO_RBAC'), string(defaultValue: 'sanity', description: 'smoke/vim/sanity/comprehensive are the options', name: 'TEST_NAME'), string(defaultValue: '/home/jenkins/hive/robot-systest.cfg', description: '', name: 'ROBOT_VIM'), ]) @@ -310,10 +309,6 @@ node("${params.NODE}") { stage_archive = false stage("System Integration Test") { if ( params.DO_ROBOT ) { - if (params.DO_RBAC) { - sh "docker service update ${container_name}_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" - sh "installers/osm_health.sh -w 30 -s ${container_name}" - } run_robot_systest(container_name,container_name,params.TEST_NAME,params.ROBOT_VIM) } //else { run_systest(container_name,container_name,"openstack_stage_4",params.HIVE_VIM_1) diff --git a/robot-systest/README_Robot_Test.md b/robot-systest/README_Robot_Test.md index 7067946c..083e1dd2 100644 --- a/robot-systest/README_Robot_Test.md +++ b/robot-systest/README_Robot_Test.md @@ -22,7 +22,7 @@ under the License. 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 +>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 diff --git a/robot-systest/lib/cli/ns_lib.robot b/robot-systest/lib/cli/ns_lib.robot index 9588527c..8be124dd 100644 --- a/robot-systest/lib/cli/ns_lib.robot +++ b/robot-systest/lib/cli/ns_lib.robot @@ -29,6 +29,7 @@ ${ns_launch_max_wait_time} 5min ${ns_launch_pol_time} 30sec ${ns_delete_max_wait_time} 1min ${ns_delete_pol_time} 15sec +${nsconfig} *** Keywords *** @@ -41,20 +42,33 @@ Get NS List Launch Network Services and Return - [Arguments] ${vim_name} + [Arguments] ${vim_name} ${ns_config}='' + 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} + \ Create Network Service ${nsd} ${vim_name} ${ns_name} ${nsconfig} + + +Set NS Config + [Arguments] ${ns_config} + ${nsconfig}= Get Variable Value ${ns_config} '' + Set Test Variable ${nsconfig} + + +Get NS Config + ${nsconfig}= Get Environment Variable NS_CONFIG '' + Set Test Variable ${nsconfig} Create Network Service [Documentation] Create ns at osm - [Arguments] ${nsd} ${vim_name} ${ns_name} + [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config} - ${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} diff --git a/robot-systest/run_test.sh b/robot-systest/run_test.sh index 42b23284..3f86ff9c 100644 --- a/robot-systest/run_test.sh +++ b/robot-systest/run_test.sh @@ -31,7 +31,7 @@ DESCRIPTOR_DIR=$TOPDIR/descriptor-packages robot_prerequisite(){ echo -e "\nInstalling robot requirements" # installing python packages - pip install haikunator requests robotframework robotframework-seleniumlibrary robotframework-requests + pip install haikunator requests robotframework robotframework-seleniumlibrary robotframework-requests robotframework-jsonlibrary } while getopts ":t:-:" o; do -- 2.25.1