blob: da8557ba3ccb0a4104cc7a4eb9eb4a0c8ab6c668 [file] [log] [blame]
You Wangf19358c2017-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}
34 \ OperatingSystem.File Should Exist /home/cord/diag-*/docker/${container}
35
36Verify Synchronizer Logs
37 [Documentation] Verify synchronizer logs are correct
38 ${synchronizerLogs} utils.readFiles /home/cord/diag-*/docker/*synchronizer*
39 : FOR ${key} IN @{synchronizerLogs.keys()}
40 \ ${value}= Get From Dictionary ${synchronizerLogs} ${key}
41 \ Should Contain ${value} Waiting for event or timeout
42
43Verify ONOS
44 [Documentation] Verify ONOS status, applications and logs
45 Run Keyword If '${CORD_PROFILE}' != 'ecord-global' Run Keywords
46 Verify ONOS Status onos-fabric
47 Verify ONOS Applications onos-fabric ${CORD_PROFILE}
48 Verify ONOS Logs onos-fabric
49 Verify ONOS Status onos-cord
50 Verify ONOS Applications onos-cord ${CORD_PROFILE}
51 Verify ONOS Logs onos-cord
52
53*** Keywords ***
54Verify ONOS Status
55 [Arguments] ${onosName}
56 ${onosStatus} utils.readFile /home/cord/diag-*/${onosName}/nodes
57 Should Contain ${onosStatus} READY
58
59Verify ONOS Applications
60 [Arguments] ${onosName} ${cordProfile}
61 ${onosAppsExpected} utils.jsonToList ${ONOS_APPS_FILE} ${onosName}-${cordProfile}
62 ${onosApps} utils.readFile /home/cord/diag-*/${onosName}/apps_-s_-a
63 : FOR ${app} IN @{onosAppsExpected}
64 \ Should Contain ${onosApps} ${app}
65
66Verify ONOS Logs
67 [Arguments] ${onosName}
68 ${onosLog} utils.readFile /home/cord/diag-*/${onosName}/log_display
69 Should Not Contain ${onosLog} ERROR