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 | |
| 15 | |
| 16 | *** Settings *** |
| 17 | Documentation Test suite for checking results collected by `make collect-diag` command |
| 18 | Library OperatingSystem |
| 19 | Library ../cord-api/Framework/utils/onosUtils.py |
| 20 | Library ../cord-api/Framework/utils/utils.py |
| 21 | Resource ../cord-api/Framework/utils/utils.robot |
| 22 | |
| 23 | *** Variables *** |
| 24 | ${DOCKER_CONTAINERS_FILE} ${CURDIR}/dockerContainers.json |
| 25 | ${ONOS_APPS_FILE} ${CURDIR}/onosApps.json |
| 26 | ${CORD_PROFILE} rcord |
| 27 | ${CORD_SCENARIO} cord |
| 28 | |
| 29 | *** Test Cases *** |
| 30 | Verify Docker Containers |
| 31 | [Documentation] Verify expected containers are up and running |
| 32 | ${dockerContainersExpected} utils.jsonToList ${DOCKER_CONTAINERS_FILE} docker-containers-${CORD_PROFILE} |
| 33 | : FOR ${container} IN @{dockerContainersExpected} |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 34 | \ Run Keyword And Continue On Failure Verify Docker Container ${container} |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 35 | |
| 36 | Verify Synchronizer Logs |
| 37 | [Documentation] Verify synchronizer logs are correct |
| 38 | ${synchronizerLogs} utils.readFiles /home/cord/diag-*/docker/*synchronizer* |
| 39 | : FOR ${key} IN @{synchronizerLogs.keys()} |
You Wang | 0894ffa | 2017-11-30 23:00:59 -0800 | [diff] [blame] | 40 | \ @{name}= Split String ${key} -synchronizer |
| 41 | \ @{name}= Split String From Right @{name}[0] _ 1 |
| 42 | \ ${synchronizerConfig} utils.readFile /opt/cord/orchestration/xos_services/*/xos/synchronizer/@{name}[1]_config.yaml |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 43 | \ ${synchronizerLog}= Get From Dictionary ${synchronizerLogs} ${key} |
| 44 | \ Run Keyword And Continue On Failure Verify Synchronizer Log ${synchronizerConfig} ${synchronizerLog} |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 45 | |
| 46 | Verify ONOS |
| 47 | [Documentation] Verify ONOS status, applications and logs |
You Wang | d65eb85 | 2017-11-20 15:04:32 -0800 | [diff] [blame] | 48 | Run Keyword If '${CORD_PROFILE}' != 'ecord-global' Verify ONOS-Fabric ${CORD_PROFILE} |
| 49 | Verify ONOS-CORD ${CORD_PROFILE} |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 50 | |
| 51 | *** Keywords *** |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 52 | Verify Docker Container |
| 53 | [Arguments] ${container} |
| 54 | OperatingSystem.File Should Exist /home/cord/diag-*/docker/${container} |
| 55 | |
| 56 | Verify Synchronizer Log |
| 57 | [Arguments] ${config} ${log} |
| 58 | Run Keyword If 'steps_dir' in '''${config}''' Should Contain ${log} Waiting for event or timeout |
| 59 | Run Keyword If 'model_policies_dir' in '''${config}''' Should Contain ${log} Loaded model policies |
| 60 | |
You Wang | d65eb85 | 2017-11-20 15:04:32 -0800 | [diff] [blame] | 61 | Verify ONOS-Fabric |
| 62 | [Arguments] ${cord_profile} |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 63 | Run Keyword And Continue On Failure Verify ONOS Status onos-fabric |
| 64 | Run Keyword And Continue On Failure Verify ONOS Applications onos-fabric ${cord_profile} |
| 65 | Run Keyword And Continue On Failure Verify ONOS Log onos-fabric |
You Wang | d65eb85 | 2017-11-20 15:04:32 -0800 | [diff] [blame] | 66 | |
| 67 | Verify ONOS-CORD |
| 68 | [Arguments] ${cord_profile} |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 69 | Run Keyword And Continue On Failure Verify ONOS Status onos-cord |
| 70 | Run Keyword And Continue On Failure Verify ONOS Applications onos-cord ${cord_profile} |
| 71 | Run Keyword And Continue On Failure Verify ONOS Log onos-cord |
You Wang | d65eb85 | 2017-11-20 15:04:32 -0800 | [diff] [blame] | 72 | |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 73 | Verify ONOS Status |
| 74 | [Arguments] ${onosName} |
| 75 | ${onosStatus} utils.readFile /home/cord/diag-*/${onosName}/nodes |
| 76 | Should Contain ${onosStatus} READY |
| 77 | |
| 78 | Verify ONOS Applications |
| 79 | [Arguments] ${onosName} ${cordProfile} |
| 80 | ${onosAppsExpected} utils.jsonToList ${ONOS_APPS_FILE} ${onosName}-${cordProfile} |
| 81 | ${onosApps} utils.readFile /home/cord/diag-*/${onosName}/apps_-s_-a |
| 82 | : FOR ${app} IN @{onosAppsExpected} |
| 83 | \ Should Contain ${onosApps} ${app} |
| 84 | |
You Wang | 046fa86 | 2017-11-21 13:13:26 -0800 | [diff] [blame] | 85 | Verify ONOS Log |
You Wang | aabb283 | 2017-11-16 17:24:09 -0800 | [diff] [blame] | 86 | [Arguments] ${onosName} |
| 87 | ${onosLog} utils.readFile /home/cord/diag-*/${onosName}/log_display |
| 88 | Should Not Contain ${onosLog} ERROR |