Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 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 | # Copyright 2017-present Radisys Corporation |
| 16 | # |
| 17 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 18 | # you may not use this file except in compliance with the License. |
| 19 | # You may obtain a copy of the License at |
| 20 | # |
| 21 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 22 | # |
| 23 | # Unless required by applicable law or agreed to in writing, software |
| 24 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 26 | # See the License for the specific language governing permissions and |
| 27 | # limitations under the License. |
| 28 | |
| 29 | |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 30 | *** Settings *** |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 31 | Documentation Test suite for checking default maas,xos and onos containers and fabric switch default services and maas cli commands |
| 32 | Library OperatingSystem |
| 33 | Library ../cord-api/Framework/utils/onosUtils.py |
| 34 | Resource ../cord-api/Framework/utils/utils.robot |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 35 | |
| 36 | *** Variables *** |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 37 | @{MAAS_SERVICE_STATUS} start/running is running |
| 38 | @{JUJU_SERVICE_STATUS} active is ready unknown |
| 39 | @{LXD_CONTAINER_STATUS} RUNNING |
| 40 | @{BOOT_RESOURCES_OUTPUT} ubuntu/trusty |
| 41 | ${FABRIC_SWITCH_PROMPT} \# |
| 42 | ${FABRIC_SWITCH_USER} root |
| 43 | ${FABRIC_SWITCH_PASSWD} onl |
| 44 | @{FABRIC_SERVICE_STATUS} is running |
| 45 | ${IP_PATTERN} (\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+) |
| 46 | ${public_iface} eth2 |
| 47 | ${num_nodes} 2 |
| 48 | ${num_of_switches} 4 |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 49 | |
| 50 | *** Test Cases *** |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 51 | Verify Headnode Interfaces |
| 52 | [Documentation] Verifies the headnode interface is up and has external connectivity |
| 53 | Verify HeadNode Interfaces Detected |
| 54 | Test Ping ${public_iface} www.opennetworking.org |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 55 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 56 | Get Compute Node and Fabric Info |
| 57 | [Documentation] Get all information pretaining to the compute nodes and fabric |
| 58 | ${nodes}= Create List |
| 59 | ${hostnames}= Create List |
| 60 | ${hostname_prefixes}= Create List |
| 61 | ${node_ips}= Create List |
| 62 | ${node_data_ips}= Create List |
| 63 | ${node_count} Run cord prov list | grep node | wc -l |
| 64 | ${node_count}= Convert To Integer ${node_count} |
| 65 | Log ${node_count} |
| 66 | ##Get hostname |
| 67 | : FOR ${INDEX} IN RANGE 1 ${node_count}+1 |
| 68 | \ ${hostname}= Run cord prov list | grep node | awk '{print $2}' | sed -n ${INDEX}p |
| 69 | \ Append To List ${hostnames} ${hostname} |
| 70 | ##Get hostname prefixes |
| 71 | : FOR ${INDEX} IN RANGE 0 ${node_count} |
| 72 | \ ${hostname_prefix}= Remove String ${hostnames[${INDEX}]} .cord.lab |
| 73 | \ Append To List ${hostname_prefixes} ${hostname_prefix} |
| 74 | ##Get compute node data ips |
| 75 | ${cordvtnnodes}= ONOS Command Execute onos-cord 8102 cordvtn-nodes | grep fabric |
| 76 | ${nds}= Split To Lines ${cordvtnnodes} |
| 77 | : FOR ${i} IN @{nds} |
| 78 | \ ${data_ip}= Get Compute Node IP ${i} |
| 79 | \ Append To List ${node_data_ips} ${data_ip} |
| 80 | ##Get compute node ips |
| 81 | : FOR ${i} IN @{hostname_prefixes} |
| 82 | \ ${node_ip}= Run cord harvest list | grep ${i} | awk '{print $4}' |
| 83 | \ Append To List ${node_ips} ${node_ip} |
| 84 | @{switch_ips}= Discover FABRIC IPs |
| 85 | Set Suite Variable ${switch_ips} |
| 86 | Set Suite Variable ${hostnames} |
| 87 | Set Suite Variable ${hostname_prefixes} |
| 88 | Set Suite Variable ${node_ips} |
| 89 | Set Suite Variable ${node_data_ips} |
| 90 | |
| 91 | Verify Compute Nodes Pingability |
| 92 | [Documentation] Verifies that the two compute nodes can ping each other |
| 93 | [Tags] fabric |
| 94 | ##Verify pingablilty across compute nodes |
| 95 | : FOR ${i} IN @{node_data_ips} |
| 96 | \ ${result}= Run ssh -A ubuntu@${i} "ping -c 3 ${node_data_ips[0]}" |
| 97 | \ Should Contain ${result} 64 bytes |
| 98 | \ Should Not Contain ${result} Destination Host Unreachable |
| 99 | \ ${result}= Run ssh -A ubuntu@${i} "ping -c 3 ${node_data_ips[1]}" |
| 100 | \ Should Contain ${result} 64 bytes |
| 101 | \ Should Not Contain ${result} Destination Host Unreachable |
| 102 | |
| 103 | Verify Compute Nodes to Fabric Pingability |
| 104 | [Documentation] Verifies that the two compute nodes can ping the switches |
| 105 | [Tags] fabric |
| 106 | ##Verify pingability from compute nodes to fabric |
| 107 | ${switch_len}= Get Length ${switch_ips} |
| 108 | : FOR ${INDEX} IN RANGE 0 ${switch_len} |
| 109 | \ ${result}= Run ssh -A ubuntu@${node_data_ips[0]} "ping -c 3 ${switch_ips[${INDEX}]}" |
| 110 | \ Should Contain ${result} 64 bytes |
| 111 | \ Should Not Contain ${result} Destination Host Unreachable |
| 112 | \ ${result}= Run ssh -A ubuntu@${node_data_ips[1]} "ping -c 3 ${switch_ips[${INDEX}]}" |
| 113 | \ Should Contain ${result} 64 bytes |
| 114 | \ Should Not Contain ${result} Destination Host Unreachable |
| 115 | |
| 116 | Verify CordVTN Nodes |
| 117 | [Documentation] Verifies that the cordvtn app running in onos identifies the nodes and devices (fabric) |
| 118 | ${nodes}= Execute ONOS Command onos-cord 8102 cordvtn-nodes |
| 119 | : FOR ${i} IN @{node_ips} |
| 120 | \ ${node_1}= Get Lines Containing String ${nodes} ${i} |
| 121 | \ Should Contain ${node_1} COMPLETE |
| 122 | \ Should Contain ${node_1} ${i} |
| 123 | ${ports}= Execute ONOS Command onos-cord 8102 cordvtn-ports |
| 124 | ${devices}= Execute ONOS Command onos-fabric 8101 devices |
| 125 | @{switch_ips}= Discover FABRIC IPs |
| 126 | : FOR ${i} IN @{switch_ips} |
| 127 | \ Should Contain ${devices} ${i} |
| 128 | |
| 129 | Verify MAAS Service State |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 130 | [Template] Verify MAAS Service |
| 131 | maas-dhcpd |
| 132 | maas-regiond |
| 133 | maas-clusterd |
| 134 | maas-proxy |
| 135 | bind9 |
| 136 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 137 | Verify MAAS Containers State |
| 138 | [Template] Verify Containers |
| 139 | maas-automation |
| 140 | maas-switchq |
| 141 | maas-provisioner |
| 142 | maas-allocator |
| 143 | maas-harvester |
| 144 | maas-generator |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 145 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 146 | Verify XOS Containers State |
| 147 | [Template] Verify Containers |
| 148 | xos-gui |
| 149 | xos-ws |
| 150 | chameleon |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 151 | xos-ui |
| 152 | onos-synchronizer |
| 153 | vrouter-synchronizer |
| 154 | exampleservice-synchronizer |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 155 | vsg-synchronizer |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 156 | vtn-synchronizer |
| 157 | vtr-synchronizer |
| 158 | fabric-synchronizer |
| 159 | openstack-synchronizer |
| 160 | xos-postgres |
| 161 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 162 | Verify ONOS Containers State |
| 163 | [Template] Verify Containers |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 164 | onosproject/onos |
| 165 | xos/onos |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 166 | |
| 167 | Verify Other Containers State |
| 168 | [Template] Verify Containers |
| 169 | redis |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 170 | mavenrepo |
| 171 | registry-mirror |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 172 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 173 | Verify Juju Services State |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 174 | [Template] Verify JUJU Service |
| 175 | ceilometer |
| 176 | ceilometer-agent |
| 177 | glance |
| 178 | keystone |
| 179 | mongodb |
| 180 | nagios |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 181 | neutron-api |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 182 | nova-cloud-controller |
| 183 | nova-compute |
| 184 | openstack-dashboard |
| 185 | percona-cluster |
| 186 | rabbitmq-server |
| 187 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 188 | Verify Openstack LXD Containers State |
| 189 | [Template] Verify Openstack LXD Containers |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 190 | ceilometer |
| 191 | glance |
| 192 | keystone |
| 193 | mongodb |
| 194 | nagios |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 195 | neutron-api |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 196 | nova-cloud-controller |
| 197 | openstack-dashboard |
| 198 | percona-cluster |
| 199 | rabbitmq-server |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 200 | |
| 201 | Verify MAAS CLI commands |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 202 | [Tags] notready |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 203 | Login MAAS Server |
| 204 | Verify MAAS CLI Commands boot-resources read | jq 'map(select(.type == "Synced"))' ubuntu/trusty |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 205 | Verify MAAS CLI Commands devices list | jq '.' | jq '.[]'.hostname | wc -l ${num_of_switches} |
| 206 | #Verify MAAS CLI Commands events query | jq '.' | jq .events[].id | wc -l 100 |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 207 | Verify MAAS CLI Commands fabrics read | jq '.' | jq .[].name | wc -l 4 |
| 208 | Verify MAAS CLI Commands networks read | jq '.' | jq .[].name | wc -l 4 |
| 209 | Verify MAAS CLI Commands node-groups list | jq '.' | jq .[].status | wc -l 1 |
| 210 | Verify MAAS CLI Commands subnets read | jq '.' | jq .[].name | wc -l 4 |
| 211 | Verify MAAS CLI Commands nodes list | jq '.' | jq .[].substatus_name | wc -l 1 |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 212 | Verify MAAS CLI Commands zones read | jq '.' | jq .[].name | wc -l 2 |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 213 | Logout MAAS Server |
| 214 | |
| 215 | Verify Fabric Switch Service |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 216 | [Tags] fabric |
| 217 | @{switch_ips}= Discover FABRIC IPs |
| 218 | : FOR ${i} IN @{switch_ips} |
| 219 | \ Verify Fabric Switch Service ${i} faultd |
| 220 | \ Verify Fabric Switch Service ${i} netplug |
| 221 | \ Verify Fabric Switch Service ${i} onlp-snmpd |
| 222 | \ Verify Fabric Switch Service ${i} onlpd |
| 223 | \ Verify Fabric Switch Service ${i} rsyslog |
| 224 | \ Verify Fabric Switch Service ${i} snmpd |
| 225 | \ Verify Fabric Switch Service ${i} ssh |
| 226 | \ Verify Fabric Switch Service ${i} udev |
| 227 | \ Verify Fabric Switch Service ${i} watchdog |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 228 | |
| 229 | *** Keywords *** |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 230 | Verify HeadNode Interfaces Detected |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 231 | ${cmd}= Catenate SEPARATOR=| sudo ethtool mgmtbr grep 'Link detected:' awk '{ print $3 }' |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 232 | ${output}= Run ${cmd} |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 233 | Should Contain ${output} yes msg= mgmtbr is not detected !!!. Reason: |
| 234 | ${cmd}= Catenate SEPARATOR=| sudo ethtool fabric grep 'Link detected:' awk '{ print $3 }' |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 235 | ${output}= Run ${cmd} |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 236 | Should Contain ${output} yes msg= fabric interface is not detected !!!. Reason: |
| 237 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 238 | Verify Containers |
| 239 | [Arguments] ${name} |
| 240 | ${container_id}= Get Docker Container ID ${name} |
| 241 | ${output}= Run docker inspect --format="{{ .State.Running }}" ${container_id} |
| 242 | Should Contain ${output} true msg=${name} is not running !!!. Reason: |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 243 | |
| 244 | Verify MAAS Service |
| 245 | [Arguments] ${name} |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 246 | ${cmd}= Catenate sudo service ${name} status |
| 247 | ${output}= Run ${cmd} |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 248 | Should Contain Any ${output} @{MAAS_SERVICE_STATUS} msg= ${name} is not running !!!. Reason: |
| 249 | |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 250 | Verify JUJU Service |
| 251 | [Arguments] ${name} |
| 252 | ${cmd} Catenate SEPARATOR=| juju status --format=tabular grep -v grep grep ${name}/0 awk '{ print $2,$7,$8,$9,$10}' |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 253 | ${output}= Run ${cmd} |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 254 | Should Contain Any ${output} @{JUJU_SERVICE_STATUS} msg= ${name} is not running !!!. Reason: |
| 255 | |
| 256 | Verify Openstack LXD Containers |
| 257 | [Arguments] ${name} |
| 258 | ${cmd} Catenate SEPARATOR=| sudo lxc list grep -v grep grep ${name}-1 awk '{ print $2,$4 }' |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 259 | ${output}= Run ${cmd} |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 260 | Should Contain Any ${output} @{LXD_CONTAINER_STATUS} msg= ${name} is not running !!!. Reason: |
| 261 | |
| 262 | Verify MAAS CLI Commands |
| 263 | [Arguments] ${name} ${expected} |
| 264 | ${cmd} Catenate maas cord ${name} |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 265 | ${output}= Run ${cmd} |
| 266 | Should Contain ${output} ${expected} msg=Reason: |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 267 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 268 | Login MAAS Server |
| 269 | ${cmd} Catenate maas login cord http://localhost/MAAS/api/1.0 $(sudo maas-region-admin apikey --user=cord) |
| 270 | ${output}= Run ${cmd} |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 271 | Should Contain ${output} You are now logged in to the MAAS msg= MAAS login failure !!!. Reason: |
| 272 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 273 | Logout MAAS Server |
| 274 | ${cmd} Catenate maas logout cord |
| 275 | ${output}= Run ${cmd} |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 276 | |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 277 | Discover FABRIC IPs |
| 278 | ${switches}= Run cord prov list | grep fabric | awk '{print $4}' |
| 279 | @{switch_ips}= Split To Lines ${switches} |
| 280 | [Return] ${switch_ips} |
Gunaseelan | ed0eb1b | 2017-08-08 08:12:12 -0500 | [diff] [blame] | 281 | |
| 282 | Verify Fabric Switch Service |
| 283 | [Arguments] ${ip} ${name} |
Kailash Khalasi | 8c34e85 | 2017-09-27 13:50:05 -0700 | [diff] [blame^] | 284 | ${cmd}= Catenate service ${name} status |
| 285 | ${output}= Run Command On Remote System ${ip} ${cmd} ${FABRIC_SWITCH_USER} ${FABRIC_SWITCH_PASSWD} ${FABRIC_SWITCH_PROMPT} 60s False |
| 286 | Should Contain Any ${output} @{FABRIC_SERVICE_STATUS} msg= ${name} is not running !!!. Reason: |