You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 1 | # Copyright 2017-present Radisys Corporation |
| 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 | |
You Wang | 0991196 | 2018-02-09 15:34:06 -0800 | [diff] [blame] | 15 | # NOTE: `make collect-diag` command needs to be executed on the head-node |
| 16 | # before running this test |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 17 | |
| 18 | *** Settings *** |
| 19 | Documentation Test suite for checking results collected by `make collect-diag` command |
| 20 | Library OperatingSystem |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 21 | Library CORDRobot |
| 22 | Library ImportResource resources=CORDRobot |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 23 | |
| 24 | *** Variables *** |
| 25 | ${DOCKER_CONTAINERS_FILE} ${CURDIR}/dockerContainers.json |
| 26 | ${ONOS_APPS_FILE} ${CURDIR}/onosApps.json |
| 27 | ${CORD_PROFILE} rcord |
| 28 | ${CORD_SCENARIO} cord |
| 29 | |
| 30 | *** Test Cases *** |
| 31 | Verify Docker Containers |
| 32 | [Documentation] Verify expected containers are up and running |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 33 | ${dockerContainersExpected} CORDRobot.jsonToList ${DOCKER_CONTAINERS_FILE} docker-containers-${CORD_PROFILE} |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 34 | : FOR ${container} IN @{dockerContainersExpected} |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 35 | \ Run Keyword And Continue On Failure Verify Docker Container ${container} |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 36 | |
| 37 | Verify Synchronizer Logs |
| 38 | [Documentation] Verify synchronizer logs are correct |
You Wang | dc60493 | 2018-02-09 17:21:29 -0800 | [diff] [blame] | 39 | ${latestDiag}= Run ls -1t /home/cord | head -1 |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 40 | ${synchronizerLogs} CORDRobot.readFiles /home/cord/${latestDiag}/docker/*synchronizer*.logs |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 41 | : FOR ${key} IN @{synchronizerLogs.keys()} |
You Wang | 0894ffa | 2017-11-30 23:00:59 -0800 | [diff] [blame] | 42 | \ @{name}= Split String ${key} -synchronizer |
| 43 | \ @{name}= Split String From Right @{name}[0] _ 1 |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 44 | \ ${synchronizerLog}= Get From Dictionary ${synchronizerLogs} ${key} |
You Wang | f89c8e7 | 2017-12-05 13:06:46 -0800 | [diff] [blame] | 45 | \ Run Keyword And Continue On Failure Verify Synchronizer Log ${name} ${synchronizerLog} |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 46 | |
| 47 | Verify ONOS |
| 48 | [Documentation] Verify ONOS status, applications and logs |
You Wang | d65eb85 | 2017-11-20 15:04:32 -0800 | [diff] [blame] | 49 | Run Keyword If '${CORD_PROFILE}' != 'ecord-global' Verify ONOS-Fabric ${CORD_PROFILE} |
| 50 | Verify ONOS-CORD ${CORD_PROFILE} |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 51 | |
| 52 | *** Keywords *** |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 53 | Verify Docker Container |
| 54 | [Arguments] ${container} |
Kailash Khalasi | 71ee323 | 2018-01-16 15:20:45 -0800 | [diff] [blame] | 55 | OperatingSystem.File Should Exist /home/cord/diag-*/docker/${container}.logs |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 56 | |
| 57 | Verify Synchronizer Log |
You Wang | f89c8e7 | 2017-12-05 13:06:46 -0800 | [diff] [blame] | 58 | [Arguments] ${name} ${log} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 59 | ${config} CORDRobot.readFile /opt/cord/orchestration/*/*/xos/synchronizer/@{name}[1]_config.yaml |
You Wang | 4c09fae | 2017-12-06 13:30:34 -0800 | [diff] [blame] | 60 | ${match1}= Get Lines Matching Regexp ${config} ^steps_dir: ".*"$ |
| 61 | ${match2}= Get Lines Matching Regexp ${config} ^model_policies_dir: ".*"$ |
| 62 | Run Keyword If '${match1}' != '${EMPTY}' Should Contain ${log} Waiting for event or timeout msg= "Waiting for event or timeout" not found in @{name}[1] synchronizer log |
| 63 | ... ELSE IF '${match2}' != '${EMPTY}' Should Contain ${log} Loaded model policies msg= "Loaded model policies" not found in @{name}[1] synchronizer log |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 64 | |
You Wang | d65eb85 | 2017-11-20 15:04:32 -0800 | [diff] [blame] | 65 | Verify ONOS-Fabric |
| 66 | [Arguments] ${cord_profile} |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 67 | Run Keyword And Continue On Failure Verify ONOS Status onos-fabric |
| 68 | Run Keyword And Continue On Failure Verify ONOS Applications onos-fabric ${cord_profile} |
| 69 | Run Keyword And Continue On Failure Verify ONOS Log onos-fabric |
You Wang | d65eb85 | 2017-11-20 15:04:32 -0800 | [diff] [blame] | 70 | |
| 71 | Verify ONOS-CORD |
| 72 | [Arguments] ${cord_profile} |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 73 | Run Keyword And Continue On Failure Verify ONOS Status onos-cord |
| 74 | Run Keyword And Continue On Failure Verify ONOS Applications onos-cord ${cord_profile} |
| 75 | Run Keyword And Continue On Failure Verify ONOS Log onos-cord |
You Wang | d65eb85 | 2017-11-20 15:04:32 -0800 | [diff] [blame] | 76 | |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 77 | Verify ONOS Status |
| 78 | [Arguments] ${onosName} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 79 | ${onosStatus} CORDRobot.readFile /home/cord/diag-*/${onosName}/nodes |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 80 | Should Contain ${onosStatus} READY |
| 81 | |
| 82 | Verify ONOS Applications |
| 83 | [Arguments] ${onosName} ${cordProfile} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 84 | ${onosAppsExpected} CORDRobot.jsonToList ${ONOS_APPS_FILE} ${onosName}-${cordProfile} |
| 85 | ${onosApps} CORDRobot.readFile /home/cord/diag-*/${onosName}/apps_-s_-a |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 86 | : FOR ${app} IN @{onosAppsExpected} |
| 87 | \ Should Contain ${onosApps} ${app} |
| 88 | |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 89 | Verify ONOS Log |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 90 | [Arguments] ${onosName} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 91 | ${onosLog} CORDRobot.readFile /home/cord/diag-*/${onosName}/log_display |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 92 | Should Not Contain ${onosLog} ERROR |