blob: 5899cbe93d2745fc4cc5c941778a28e5c71c4194 [file] [log] [blame]
Gunaseelaned0eb1b2017-08-08 08:12:12 -05001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# Copyright 2017-present Radisys Corporation
17#
18# Licensed under the Apache License, Version 2.0 (the "License");
19# you may not use this file except in compliance with the License.
20# You may obtain a copy of the License at
21#
22# http://www.apache.org/licenses/LICENSE-2.0
23#
24# Unless required by applicable law or agreed to in writing, software
25# distributed under the License is distributed on an "AS IS" BASIS,
26# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27# See the License for the specific language governing permissions and
28# limitations under the License.
29
30
31
32
33
34*** Settings ***
35Documentation Test suite for checking default maas,xos and onos containers and fabric switch default services and maas cli commands
36Library OperatingSystem
37Resource ../cord-api/Framework/utils/utils.robot
38
39*** Variables ***
40@{MAAS_SERVICE_STATUS} start/running is running
41@{JUJU_SERVICE_STATUS} active is ready
42@{LXD_CONTAINER_STATUS} RUNNING
43@{BOOT_RESOURCES_OUTPUT} ubuntu/trusty
44${FABRIC_SWITCH_PROMPT} #
45${FABRIC_SWITCH_USER} root
46${FABRIC_SWITCH_PASSWD} onl
47@{FABRIC_SERVICE_STATUS} is running
48${IP_PATTERN} (\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)
49
50*** Test Cases ***
51Verify headnode interfaces detected
52 Verify HeadNode Interfaces
53
54Verify the state MAAS service
55 [Template] Verify MAAS Service
56 maas-dhcpd
57 maas-regiond
58 maas-clusterd
59 maas-proxy
60 bind9
61
62Verify the state of MAAS Containers
63 [Template] Verify Containers
64 cord-maas-automation
65 cord-maas-switchq
66 cord-provisioner
67 cord-ip-allocator
68 cord-dhcp-harvester
69 config-generator
70
71Verify the state of XOS Containers
72 [Template] Verify Containers
73 xos-gui
74 xos-ws
75 chameleon
76 xos-ui
77 onos-synchronizer
78 vrouter-synchronizer
79 exampleservice-synchronizer
80 vsg-synchronizer
81 gui-extension-rcord
82 gui-extension-vtr
83 vtn-synchronizer
84 vtr-synchronizer
85 fabric-synchronizer
86 openstack-synchronizer
87 xos-postgres
88
89Verify the state of ONOS Containers
90 [Template] Verify Containers
91 onosproject/onos
92 xos/onos
93
94Verify the state of other Containers
95 [Template] Verify Containers
96 redis
97 mavenrepo
98 registry-mirror
99 registry
100
101Verify the state of juju services
102 [Template] Verify JUJU Service
103 ceilometer
104 ceilometer-agent
105 glance
106 keystone
107 mongodb
108 nagios
109 neturon-api
110 nova-cloud-controller
111 nova-compute
112 openstack-dashboard
113 percona-cluster
114 rabbitmq-server
115
116Verify the state of openstack lxd containers
117 [Template] Verify Openstack LXD Containers
118 ceilometer
119 glance
120 keystone
121 mongodb
122 nagios
123 neutron-api
124 nova-cloud-controller
125 openstack-dashboard
126 percona-cluster
127 rabbitmq-server
128 #testclient
129
130Verify MAAS CLI commands
131 Login MAAS Server
132 Verify MAAS CLI Commands boot-resources read | jq 'map(select(.type == "Synced"))' ubuntu/trusty
133 Verify MAAS CLI Commands devices list | jq '.' | jq '.[]'.hostname | wc -l 3
134 #Verify MAAS CLI Commands events query | jq '.' | jq .events[].id | wc -l 100
135 Verify MAAS CLI Commands fabrics read | jq '.' | jq .[].name | wc -l 4
136 Verify MAAS CLI Commands networks read | jq '.' | jq .[].name | wc -l 4
137 Verify MAAS CLI Commands node-groups list | jq '.' | jq .[].status | wc -l 1
138 Verify MAAS CLI Commands subnets read | jq '.' | jq .[].name | wc -l 4
139 Verify MAAS CLI Commands nodes list | jq '.' | jq .[].substatus_name | wc -l 1
140 Verify MAAS CLI Commands zones read | jq '.' | jq .[].name | wc -l 2
141 Logout MAAS Server
142
143Verify Fabric Switch Service
144 ${fabric_ip}= Discover FABRIC IP ${FABRIC_SWITCH_MAC}
145 Verify Fabric Switch Service ${fabric_ip} faultd
146 Verify Fabric Switch Service ${fabric_ip} netplug
147 Verify Fabric Switch Service ${fabric_ip} ofdpa
148 Verify Fabric Switch Service ${fabric_ip} onlp-snmpd
149 Verify Fabric Switch Service ${fabric_ip} onlpd
150 Verify Fabric Switch Service ${fabric_ip} resolvconf
151 Verify Fabric Switch Service ${fabric_ip} rsyslog
152 Verify Fabric Switch Service ${fabric_ip} snmpd
153 Verify Fabric Switch Service ${fabric_ip} ssh
154 Verify Fabric Switch Service ${fabric_ip} sxdkernel
155 Verify Fabric Switch Service ${fabric_ip} udev
156 Verify Fabric Switch Service ${fabric_ip} watchdog
157
158
159*** Keywords ***
160Verify HeadNode Interfaces
161 ${cmd}= Catenate SEPARATOR=| sudo ethtool mgmtbr grep 'Link detected:' awk '{ print $3 }'
162 ${output}= Run ${cmd}
163 Should Contain ${output} yes msg= mgmtbr is not detected !!!. Reason:
164 ${cmd}= Catenate SEPARATOR=| sudo ethtool fabric grep 'Link detected:' awk '{ print $3 }'
165 ${output}= Run ${cmd}
166 Should Contain ${output} yes msg= fabric interface is not detected !!!. Reason:
167
168
169Verify Containers
170 [Arguments] ${name}
171 ${cmd}= Catenate SEPARATOR=| docker ps -a grep -v grep grep ${name} awk '{print $7,$8,$9,$10,$11}'
172 ${output}= Run ${cmd}
173 Should Contain ${output} Up msg= ${name} is not running !!!. Reason:
174
175Verify MAAS Service
176 [Arguments] ${name}
177 ${cmd}= Catenate sudo service ${name} status
178 ${output}= Run ${cmd}
179 Should Contain Any ${output} @{MAAS_SERVICE_STATUS} msg= ${name} is not running !!!. Reason:
180
181
182Verify JUJU Service
183 [Arguments] ${name}
184 ${cmd} Catenate SEPARATOR=| juju status --format=tabular grep -v grep grep ${name}/0 awk '{ print $2,$7,$8,$9,$10}'
185 ${output}= Run ${cmd}
186 Should Contain Any ${output} @{JUJU_SERVICE_STATUS} msg= ${name} is not running !!!. Reason:
187
188Verify Openstack LXD Containers
189 [Arguments] ${name}
190 ${cmd} Catenate SEPARATOR=| sudo lxc list grep -v grep grep ${name}-1 awk '{ print $2,$4 }'
191 ${output}= Run ${cmd}
192 Should Contain Any ${output} @{LXD_CONTAINER_STATUS} msg= ${name} is not running !!!. Reason:
193
194Verify MAAS CLI Commands
195 [Arguments] ${name} ${expected}
196 ${cmd} Catenate maas cord ${name}
197 ${output}= Run ${cmd}
198 Should Contain ${output} ${expected} msg=Reason:
199
200Login MAAS Server
201 ${cmd} Catenate maas login cord http://localhost/MAAS/api/1.0 $(sudo maas-region-admin apikey --user=cord)
202 ${output}= Run ${cmd}
203 Should Contain ${output} You are now logged in to the MAAS msg= MAAS login failure !!!. Reason:
204
205Logout MAAS Server
206 ${cmd} Catenate maas logout cord
207 ${output}= Run ${cmd}
208
209Discover FABRIC IP
210 [Arguments] ${fabric_mac}
211 ${cmd} Catenate SEPARATOR=| cord switch list grep -v IP awk '{ print $3 }'
212 ${output}= Run ${cmd}
213 ${ret}= Should Match Regexp ${output} ${IP_PATTERN} msg="unable to get ip"
214 [Return] ${ret[0]}
215
216Verify Fabric Switch Service
217 [Arguments] ${ip} ${name}
218 ${cmd}= Catenate service ${name} status
219 ${output}= Run Command On Remote System ${ip} ${cmd} ${FABRIC_SWITCH_USER} ${FABRIC_SWITCH_PASSWD} ${FABRIC_SWITCH_PROMPT} 60s False
220 Should Contain Any ${output} @{FABRIC_SERVICE_STATUS} msg= ${name} is not running !!!. Reason: