Kailash Khalasi | ab1a076 | 2018-01-04 21:48:04 -0800 | [diff] [blame] | 1 | # Copyright 2018-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | *** Settings *** |
| 16 | Suite Setup Suite Setup |
| 17 | Documentation Test runner suite for executing NG4T Tests inside the venb vm instance |
| 18 | Library OperatingSystem |
| 19 | Library SSHLibrary |
| 20 | Library ../cord-api/Framework/utils/utils.py |
| 21 | Resource ../cord-api/Framework/utils/utils.robot |
| 22 | |
| 23 | *** Variables *** |
| 24 | ${compute_node_user} ubuntu |
| 25 | ${instance_user} ng4t |
| 26 | ${instance_pass} ng4t |
| 27 | ${NG4T_TESTS_FILE} ${CURDIR}/ng4t-tests.json |
| 28 | |
| 29 | *** Test Cases *** |
| 30 | Execute Tests |
| 31 | [Documentation] SSHs into venb instance inside the compute node and executes tests |
| 32 | : FOR ${test} IN @{ng4t_tests} |
| 33 | \ ${conn_id}= SSHLibrary.Open Connection ${compute_hostname} prompt=~$ timeout=300s |
| 34 | \ SSHLibrary.Login With Public Key ubuntu /home/cord/.ssh/cord_rsa |
| 35 | \ SSHLibrary.Read |
| 36 | \ SSHLibrary.Write ssh -q ng40@${mgmt_ip} "./${test}" |
| 37 | \ SSHLibrary.Read Until password: |
| 38 | \ SSHLibrary.Write ng40 |
| 39 | \ ${result}= SSHLibrary.Read Until Prompt |
| 40 | \ Run Keyword And Continue On Failure Should Contain ${result} VERDICT_PASS |
| 41 | \ SSHLibrary.Close Connection |
| 42 | |
| 43 | *** Keywords *** |
| 44 | Suite Setup |
| 45 | ${nova_id}= Run . /opt/cord_profile/admin-openrc.sh; nova list --all-tenants | grep venb | awk '{print $2}' |
| 46 | ${mgmt_ip}= Run . /opt/cord_profile/admin-openrc.sh; nova show ${nova_id} | grep management | awk '{print $5}' |
| 47 | ${compute_hostname}= Run . /opt/cord_profile/admin-openrc.sh; nova show ${nova_id} | grep :host | awk '{print $4}' |
| 48 | ${ng4t_tests} utils.jsonToList ${NG4T_TESTS_FILE} mcord-ng4t-tests |
| 49 | Set Suite Variable ${compute_hostname} |
| 50 | Set Suite Variable ${ng4t_tests} |
| 51 | Set Suite Variable ${mgmt_ip} |