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 | |
Andy Bavier | 2ae1879 | 2016-11-28 21:04:43 -0500 | [diff] [blame] | 6 | - name: Get name of compute node |
| 7 | shell: bash -c "source ~/admin-openrc.sh; nova service-list|grep nova-compute|cut -d '|' -f 3" |
| 8 | register: node_name |
| 9 | tags: |
| 10 | - skip_ansible_lint # running a sub job |
| 11 | |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 12 | - name: Wait for vSG VM to come up |
| 13 | shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep 'vsg.*ACTIVE' > /dev/null" |
| 14 | register: result |
| 15 | until: result | success |
| 16 | retries: 10 |
| 17 | delay: 60 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 18 | tags: |
| 19 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 20 | |
| 21 | - name: Get ID of VM |
| 22 | shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep mysite_vsg|cut -d '|' -f 2" |
| 23 | register: nova_id |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 24 | tags: |
| 25 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 26 | |
| 27 | - name: Get mgmt IP of VM |
Zack Williams | 6e66899 | 2016-11-26 09:54:48 -0700 | [diff] [blame] | 28 | 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] | 29 | register: mgmt_ip |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 30 | tags: |
| 31 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 32 | |
| 33 | - name: Wait for Docker container inside VM to come up |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 34 | 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] | 35 | register: result |
| 36 | until: result | success |
| 37 | retries: 20 |
| 38 | delay: 60 |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 39 | tags: |
| 40 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 41 | |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 42 | - name: start container |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 43 | become: yes |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 44 | lxd_container: |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 45 | name: testclient |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 46 | state: started |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 47 | |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 48 | - name: Make sure testclient has default route to vSG |
| 49 | become: yes |
| 50 | shell: lxc exec testclient -- route | grep default | grep "eth0.222.111" |
| 51 | register: result |
| 52 | until: result | success |
| 53 | retries: 3 |
| 54 | delay: 10 |
| 55 | tags: |
| 56 | - skip_ansible_lint # running a sub job |
| 57 | |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 58 | - name: Test external connectivity in test client |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 59 | become: yes |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 60 | command: lxc exec testclient -- ping -c 3 8.8.8.8 |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 61 | register: pingtest |
Scott Baker | c7a0256 | 2016-10-28 14:38:29 -0700 | [diff] [blame] | 62 | tags: |
| 63 | - skip_ansible_lint # running a sub job |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 64 | |
| 65 | - name: Output from ping test |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 66 | debug: var=pingtest.stdout_lines |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 67 | |