blob: 27b537b308f0b25a69ec3b6e72aa77530adca8b9 [file] [log] [blame]
Andy Bavier63408b72018-01-23 16:12:07 -08001---
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# test-mcord-base/tasks/main.yml
17# Run tests to check that the base elements of M-CORD are present
18
19- name: Wait for networks to be synchronized
Andy Bavierc4099692018-06-04 09:47:29 -070020 shell: export OS_CLOUD=openstack_helm; openstack network list|grep '{{ item }}' > /dev/null
Andy Bavier63408b72018-01-23 16:12:07 -080021 args:
22 executable: /bin/bash
23 register: result
Andy Bavierc4099692018-06-04 09:47:29 -070024 until: result is success
Andy Bavier63408b72018-01-23 16:12:07 -080025 retries: 10
26 delay: 60
27 with_items: "{{ test_networks }}"
28 tags:
29 - skip_ansible_lint # running a sub job
Andy Bavier6a876b72018-06-07 10:09:53 -070030 changed_when: False
Andy Bavier63408b72018-01-23 16:12:07 -080031
Andy Bavier4ff19102018-01-31 14:27:28 -070032- name: Wait for VMs to come up
Andy Bavierc4099692018-06-04 09:47:29 -070033 shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item }}.*\(ACTIVE\|ERROR\)' > /dev/null
Andy Bavier63408b72018-01-23 16:12:07 -080034 args:
35 executable: /bin/bash
36 register: result
Andy Bavierc4099692018-06-04 09:47:29 -070037 until: result is success
Andy Bavier63408b72018-01-23 16:12:07 -080038 retries: 10
39 delay: 60
40 with_items: "{{ test_services }}"
41 tags:
42 - skip_ansible_lint # running a sub job
Andy Bavier6a876b72018-06-07 10:09:53 -070043 changed_when: False
Andy Bavier63408b72018-01-23 16:12:07 -080044
45- name: Delete any VMs that are in ERROR state (XOS will re-create them)
Andy Bavierc4099692018-06-04 09:47:29 -070046 shell: export OS_CLOUD=openstack_helm; for vm in $(openstack server list --all-projects|grep 'ERROR'|awk '{ print $2 }'); do openstack server delete $vm; done
Andy Bavier63408b72018-01-23 16:12:07 -080047 args:
48 executable: /bin/bash
49 tags:
50 - skip_ansible_lint # running a sub job
51
52- name: Wait for VMs to come up
Andy Bavierc4099692018-06-04 09:47:29 -070053 shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item }}.*ACTIVE' > /dev/null
Andy Bavier63408b72018-01-23 16:12:07 -080054 args:
55 executable: /bin/bash
56 register: result
Andy Bavierc4099692018-06-04 09:47:29 -070057 until: result is success
Andy Bavier63408b72018-01-23 16:12:07 -080058 retries: 10
59 delay: 60
60 with_items: "{{ test_services }}"
61 tags:
62 - skip_ansible_lint # running a sub job
Andy Bavier6a876b72018-06-07 10:09:53 -070063 changed_when: False
Andy Bavier63408b72018-01-23 16:12:07 -080064
65- name: Verify that VMs are properly networked
Andy Bavierc4099692018-06-04 09:47:29 -070066 shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item.vm }}.*ACTIVE.*{{ item.network }}' > /dev/null
Andy Bavier63408b72018-01-23 16:12:07 -080067 args:
68 executable: /bin/bash
69 with_items: "{{ test_ports }}"
70 tags:
71 - skip_ansible_lint # running a sub job
Andy Bavier6a876b72018-06-07 10:09:53 -070072 changed_when: False