Zack Williams | fc6b64b | 2017-12-22 15:57:50 -0700 | [diff] [blame] | 1 | --- |
Andy Bavier | 5ce21eb | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 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 | |
Andy Bavier | 5ce21eb | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 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 | 50e51c0 | 2018-01-10 10:39:03 -0700 | [diff] [blame^] | 20 | shell: source /opt/cord_profile/admin-openrc.sh; neutron net-list|grep '{{ item }}' > /dev/null |
| 21 | args: |
| 22 | executable: /bin/bash |
Andy Bavier | 5ce21eb | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 23 | register: result |
| 24 | until: result | success |
| 25 | retries: 10 |
| 26 | delay: 60 |
Andy Bavier | 444007e | 2017-10-24 06:02:36 -0700 | [diff] [blame] | 27 | with_items: "{{ test_networks }}" |
Andy Bavier | 5ce21eb | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 28 | tags: |
| 29 | - skip_ansible_lint # running a sub job |
| 30 | |
Andy Bavier | 50e51c0 | 2018-01-10 10:39:03 -0700 | [diff] [blame^] | 31 | - name: Wait for VMs to appear in Nova |
| 32 | shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item }}' > /dev/null |
| 33 | args: |
| 34 | executable: /bin/bash |
| 35 | register: result |
| 36 | until: result | success |
| 37 | retries: 10 |
| 38 | delay: 60 |
| 39 | with_items: "{{ test_services }}" |
| 40 | tags: |
| 41 | - skip_ansible_lint # running a sub job |
| 42 | |
| 43 | - name: Delete any VMs that are in ERROR state (XOS will re-create them) |
| 44 | 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 |
| 45 | args: |
| 46 | executable: /bin/bash |
| 47 | tags: |
| 48 | - skip_ansible_lint # running a sub job |
| 49 | |
Andy Bavier | 5ce21eb | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 50 | - name: Wait for VMs to come up |
Andy Bavier | 50e51c0 | 2018-01-10 10:39:03 -0700 | [diff] [blame^] | 51 | shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item }}.*ACTIVE' > /dev/null |
| 52 | args: |
| 53 | executable: /bin/bash |
Andy Bavier | 5ce21eb | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 54 | register: result |
| 55 | until: result | success |
| 56 | retries: 10 |
| 57 | delay: 60 |
Andy Bavier | 444007e | 2017-10-24 06:02:36 -0700 | [diff] [blame] | 58 | with_items: "{{ test_services }}" |
| 59 | tags: |
| 60 | - skip_ansible_lint # running a sub job |
| 61 | |
| 62 | - name: Verify that VMs are properly networked |
Andy Bavier | 50e51c0 | 2018-01-10 10:39:03 -0700 | [diff] [blame^] | 63 | shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item.vm }}.*ACTIVE.*{{ item.network }}' > /dev/null |
| 64 | args: |
| 65 | executable: /bin/bash |
Andy Bavier | 444007e | 2017-10-24 06:02:36 -0700 | [diff] [blame] | 66 | with_items: "{{ test_ports }}" |
Andy Bavier | 5ce21eb | 2017-10-16 16:10:12 -0700 | [diff] [blame] | 67 | tags: |
| 68 | - skip_ansible_lint # running a sub job |