Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 1 | --- |
| 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 Bavier | c409969 | 2018-06-04 09:47:29 -0700 | [diff] [blame] | 20 | shell: export OS_CLOUD=openstack_helm; openstack network list|grep '{{ item }}' > /dev/null |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 21 | args: |
| 22 | executable: /bin/bash |
| 23 | register: result |
Andy Bavier | c409969 | 2018-06-04 09:47:29 -0700 | [diff] [blame] | 24 | until: result is success |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 25 | retries: 10 |
| 26 | delay: 60 |
| 27 | with_items: "{{ test_networks }}" |
| 28 | tags: |
| 29 | - skip_ansible_lint # running a sub job |
Andy Bavier | 6a876b7 | 2018-06-07 10:09:53 -0700 | [diff] [blame] | 30 | changed_when: False |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 31 | |
Andy Bavier | 4ff1910 | 2018-01-31 14:27:28 -0700 | [diff] [blame] | 32 | - name: Wait for VMs to come up |
Andy Bavier | c409969 | 2018-06-04 09:47:29 -0700 | [diff] [blame] | 33 | shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item }}.*\(ACTIVE\|ERROR\)' > /dev/null |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 34 | args: |
| 35 | executable: /bin/bash |
| 36 | register: result |
Andy Bavier | c409969 | 2018-06-04 09:47:29 -0700 | [diff] [blame] | 37 | until: result is success |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 38 | retries: 10 |
| 39 | delay: 60 |
| 40 | with_items: "{{ test_services }}" |
| 41 | tags: |
| 42 | - skip_ansible_lint # running a sub job |
Andy Bavier | 6a876b7 | 2018-06-07 10:09:53 -0700 | [diff] [blame] | 43 | changed_when: False |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 44 | |
| 45 | - name: Delete any VMs that are in ERROR state (XOS will re-create them) |
Andy Bavier | c409969 | 2018-06-04 09:47:29 -0700 | [diff] [blame] | 46 | 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 Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 47 | 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 Bavier | c409969 | 2018-06-04 09:47:29 -0700 | [diff] [blame] | 53 | shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item }}.*ACTIVE' > /dev/null |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 54 | args: |
| 55 | executable: /bin/bash |
| 56 | register: result |
Andy Bavier | c409969 | 2018-06-04 09:47:29 -0700 | [diff] [blame] | 57 | until: result is success |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 58 | retries: 10 |
| 59 | delay: 60 |
| 60 | with_items: "{{ test_services }}" |
| 61 | tags: |
| 62 | - skip_ansible_lint # running a sub job |
Andy Bavier | 6a876b7 | 2018-06-07 10:09:53 -0700 | [diff] [blame] | 63 | changed_when: False |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 64 | |
| 65 | - name: Verify that VMs are properly networked |
Andy Bavier | c409969 | 2018-06-04 09:47:29 -0700 | [diff] [blame] | 66 | shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item.vm }}.*ACTIVE.*{{ item.network }}' > /dev/null |
Andy Bavier | 63408b7 | 2018-01-23 16:12:07 -0800 | [diff] [blame] | 67 | args: |
| 68 | executable: /bin/bash |
| 69 | with_items: "{{ test_ports }}" |
| 70 | tags: |
| 71 | - skip_ansible_lint # running a sub job |
Andy Bavier | 6a876b7 | 2018-06-07 10:09:53 -0700 | [diff] [blame] | 72 | changed_when: False |