Andy Bavier | a4cf1a7 | 2017-10-16 16:10:12 -0700 | [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 | |
| 17 | --- |
| 18 | # test-mcord-base/tasks/main.yml |
| 19 | # Run tests to check that the base elements of M-CORD are present |
| 20 | |
| 21 | - name: Wait for networks to be synchronized |
Andy Bavier | 3edd75e | 2018-01-10 10:39:03 -0700 | [diff] [blame] | 22 | shell: source /opt/cord_profile/admin-openrc.sh; neutron net-list|grep '{{ item }}' > /dev/null |
| 23 | args: |
| 24 | executable: /bin/bash |
Andy Bavier | a4cf1a7 | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 25 | register: result |
| 26 | until: result | success |
| 27 | retries: 10 |
| 28 | delay: 60 |
Andy Bavier | 50f5317 | 2017-10-24 06:02:36 -0700 | [diff] [blame] | 29 | with_items: "{{ test_networks }}" |
Andy Bavier | a4cf1a7 | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 30 | tags: |
| 31 | - skip_ansible_lint # running a sub job |
| 32 | |
Andy Bavier | 3edd75e | 2018-01-10 10:39:03 -0700 | [diff] [blame] | 33 | - name: Wait for VMs to appear in Nova |
| 34 | shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item }}' > /dev/null |
| 35 | args: |
| 36 | executable: /bin/bash |
| 37 | register: result |
| 38 | until: result | success |
| 39 | retries: 10 |
| 40 | delay: 60 |
| 41 | with_items: "{{ test_services }}" |
| 42 | tags: |
| 43 | - skip_ansible_lint # running a sub job |
| 44 | |
| 45 | - name: Delete any VMs that are in ERROR state (XOS will re-create them) |
| 46 | shell: source /opt/cord_profile/admin-openrc.sh; for vm in $(nova list --all-tenants|grep 'ERROR'|awk '{ print $2 }'); do nova delete $vm; done |
| 47 | args: |
| 48 | executable: /bin/bash |
| 49 | tags: |
| 50 | - skip_ansible_lint # running a sub job |
| 51 | |
Andy Bavier | a4cf1a7 | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 52 | - name: Wait for VMs to come up |
Andy Bavier | 3edd75e | 2018-01-10 10:39:03 -0700 | [diff] [blame] | 53 | shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item }}.*ACTIVE' > /dev/null |
| 54 | args: |
| 55 | executable: /bin/bash |
Andy Bavier | a4cf1a7 | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 56 | register: result |
| 57 | until: result | success |
| 58 | retries: 10 |
| 59 | delay: 60 |
Andy Bavier | 50f5317 | 2017-10-24 06:02:36 -0700 | [diff] [blame] | 60 | with_items: "{{ test_services }}" |
| 61 | tags: |
| 62 | - skip_ansible_lint # running a sub job |
| 63 | |
| 64 | - name: Verify that VMs are properly networked |
Andy Bavier | 3edd75e | 2018-01-10 10:39:03 -0700 | [diff] [blame] | 65 | shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item.vm }}.*ACTIVE.*{{ item.network }}' > /dev/null |
| 66 | args: |
| 67 | executable: /bin/bash |
Andy Bavier | 50f5317 | 2017-10-24 06:02:36 -0700 | [diff] [blame] | 68 | with_items: "{{ test_ports }}" |
Andy Bavier | a4cf1a7 | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 69 | tags: |
| 70 | - skip_ansible_lint # running a sub job |