Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 1 | --- |
Andy Bavier | 8a7b8b6 | 2016-07-26 18:35:06 -0400 | [diff] [blame] | 2 | # test-vsg/tasks/main.yml |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 3 | # |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 4 | # Run tests to check that the CORD-in-a-Box deployment has worked. |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 5 | |
Scott Baker | db5c8c7 | 2016-11-08 08:40:06 -0800 | [diff] [blame] | 6 | - name: Create cord subscriber |
Scott Baker | 995641b | 2016-11-15 17:09:26 -0800 | [diff] [blame] | 7 | make: |
| 8 | chdir: "{{ service_profile_repo_dest }}/{{ xos_configuration }}" |
| 9 | target: cord-subscriber |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 10 | |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 11 | - name: Re-run 'make vtn' (work around bug in synchronizer) |
Scott Baker | 995641b | 2016-11-15 17:09:26 -0800 | [diff] [blame] | 12 | make: |
| 13 | chdir: "{{ service_profile_repo_dest }}/{{ xos_configuration }}" |
| 14 | target: vtn |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 15 | |
| 16 | - name: Wait for vSG VM to come up |
| 17 | shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep 'vsg.*ACTIVE' > /dev/null" |
| 18 | register: result |
| 19 | until: result | success |
| 20 | retries: 10 |
| 21 | delay: 60 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 22 | tags: |
| 23 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 24 | |
| 25 | - name: Get ID of VM |
| 26 | shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep mysite_vsg|cut -d '|' -f 2" |
| 27 | register: nova_id |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 28 | tags: |
| 29 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 30 | |
| 31 | - name: Get mgmt IP of VM |
Zack Williams | 6e66899 | 2016-11-26 09:54:48 -0700 | [diff] [blame] | 32 | shell: bash -c "source ~/admin-openrc.sh; nova interface-list {{ nova_id.stdout }}|grep -o -m 1 '172\.27\.[[:digit:]]*\.[[:digit:]]*'" |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 33 | register: mgmt_ip |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 34 | tags: |
| 35 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 36 | |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 37 | - name: Get name of compute node |
| 38 | shell: bash -c "source ~/admin-openrc.sh; nova service-list|grep nova-compute|cut -d '|' -f 3" |
| 39 | register: node_name |
| 40 | tags: |
| 41 | - skip_ansible_lint # running a sub job |
| 42 | |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 43 | - name: Wait for Docker container inside VM to come up |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 44 | shell: ssh -o ProxyCommand="ssh -W %h:%p -l ubuntu {{ node_name.stdout }}" ubuntu@{{ mgmt_ip.stdout }} "sudo docker ps|grep vcpe" > /dev/null |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 45 | register: result |
| 46 | until: result | success |
| 47 | retries: 20 |
| 48 | delay: 60 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 49 | tags: |
| 50 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 51 | |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 52 | - name: start container |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 53 | become: yes |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 54 | lxd_container: |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 55 | name: testclient |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 56 | state: started |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 57 | |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 58 | - name: Make sure testclient has default route to vSG |
| 59 | become: yes |
| 60 | shell: lxc exec testclient -- route | grep default | grep "eth0.222.111" |
| 61 | register: result |
| 62 | until: result | success |
| 63 | retries: 3 |
| 64 | delay: 10 |
| 65 | tags: |
| 66 | - skip_ansible_lint # running a sub job |
| 67 | |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 68 | - name: Test external connectivity in test client |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 69 | become: yes |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 70 | command: lxc exec testclient -- ping -c 3 8.8.8.8 |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 71 | register: pingtest |
Scott Baker | c7a0256 | 2016-10-28 14:38:29 -0700 | [diff] [blame] | 72 | tags: |
| 73 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 74 | |
| 75 | - name: Output from ping test |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 76 | debug: var=pingtest.stdout_lines |