blob: 6254b9ed502e3668c4ab5bfae233b2ddfbeb74e7 [file] [log] [blame]
You Wangaabb2832017-11-16 17:24:09 -08001# 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 ***
17Documentation Test suite for checking results collected by `make collect-diag` command
18Library OperatingSystem
19Library ../cord-api/Framework/utils/onosUtils.py
20Library ../cord-api/Framework/utils/utils.py
21Resource ../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 ***
30Verify 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 Wang046fa862017-11-21 13:13:26 -080034 \ Run Keyword And Continue On Failure Verify Docker Container ${container}
You Wangaabb2832017-11-16 17:24:09 -080035
36Verify Synchronizer Logs
37 [Documentation] Verify synchronizer logs are correct
Kailash Khalasi71ee3232018-01-16 15:20:45 -080038 ${synchronizerLogs} utils.readFiles /home/cord/diag-*/docker/*synchronizer*.logs
You Wangaabb2832017-11-16 17:24:09 -080039 : FOR ${key} IN @{synchronizerLogs.keys()}
You Wang0894ffa2017-11-30 23:00:59 -080040 \ @{name}= Split String ${key} -synchronizer
41 \ @{name}= Split String From Right @{name}[0] _ 1
You Wang046fa862017-11-21 13:13:26 -080042 \ ${synchronizerLog}= Get From Dictionary ${synchronizerLogs} ${key}
You Wangf89c8e72017-12-05 13:06:46 -080043 \ Run Keyword And Continue On Failure Verify Synchronizer Log ${name} ${synchronizerLog}
You Wangaabb2832017-11-16 17:24:09 -080044
45Verify ONOS
46 [Documentation] Verify ONOS status, applications and logs
You Wangd65eb852017-11-20 15:04:32 -080047 Run Keyword If '${CORD_PROFILE}' != 'ecord-global' Verify ONOS-Fabric ${CORD_PROFILE}
48 Verify ONOS-CORD ${CORD_PROFILE}
You Wangaabb2832017-11-16 17:24:09 -080049
50*** Keywords ***
You Wang046fa862017-11-21 13:13:26 -080051Verify Docker Container
52 [Arguments] ${container}
Kailash Khalasi71ee3232018-01-16 15:20:45 -080053 OperatingSystem.File Should Exist /home/cord/diag-*/docker/${container}.logs
You Wang046fa862017-11-21 13:13:26 -080054
55Verify Synchronizer Log
You Wangf89c8e72017-12-05 13:06:46 -080056 [Arguments] ${name} ${log}
You Wangf35df4a2018-01-24 11:00:58 -080057 ${config} utils.readFile /opt/cord/orchestration/*/*/xos/synchronizer/@{name}[1]_config.yaml
You Wang4c09fae2017-12-06 13:30:34 -080058 ${match1}= Get Lines Matching Regexp ${config} ^steps_dir: ".*"$
59 ${match2}= Get Lines Matching Regexp ${config} ^model_policies_dir: ".*"$
60 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
61 ... ELSE IF '${match2}' != '${EMPTY}' Should Contain ${log} Loaded model policies msg= "Loaded model policies" not found in @{name}[1] synchronizer log
You Wang046fa862017-11-21 13:13:26 -080062
You Wangd65eb852017-11-20 15:04:32 -080063Verify ONOS-Fabric
64 [Arguments] ${cord_profile}
You Wang046fa862017-11-21 13:13:26 -080065 Run Keyword And Continue On Failure Verify ONOS Status onos-fabric
66 Run Keyword And Continue On Failure Verify ONOS Applications onos-fabric ${cord_profile}
67 Run Keyword And Continue On Failure Verify ONOS Log onos-fabric
You Wangd65eb852017-11-20 15:04:32 -080068
69Verify ONOS-CORD
70 [Arguments] ${cord_profile}
You Wang046fa862017-11-21 13:13:26 -080071 Run Keyword And Continue On Failure Verify ONOS Status onos-cord
72 Run Keyword And Continue On Failure Verify ONOS Applications onos-cord ${cord_profile}
73 Run Keyword And Continue On Failure Verify ONOS Log onos-cord
You Wangd65eb852017-11-20 15:04:32 -080074
You Wangaabb2832017-11-16 17:24:09 -080075Verify ONOS Status
76 [Arguments] ${onosName}
77 ${onosStatus} utils.readFile /home/cord/diag-*/${onosName}/nodes
78 Should Contain ${onosStatus} READY
79
80Verify ONOS Applications
81 [Arguments] ${onosName} ${cordProfile}
82 ${onosAppsExpected} utils.jsonToList ${ONOS_APPS_FILE} ${onosName}-${cordProfile}
83 ${onosApps} utils.readFile /home/cord/diag-*/${onosName}/apps_-s_-a
84 : FOR ${app} IN @{onosAppsExpected}
85 \ Should Contain ${onosApps} ${app}
86
You Wang046fa862017-11-21 13:13:26 -080087Verify ONOS Log
You Wangaabb2832017-11-16 17:24:09 -080088 [Arguments] ${onosName}
89 ${onosLog} utils.readFile /home/cord/diag-*/${onosName}/log_display
90 Should Not Contain ${onosLog} ERROR