blob: 972dc7bbbebcddfaa0290cb5c481a2934fc5fee0 [file] [log] [blame]
Andy Baviera27effe2016-07-18 19:23:26 -04001---
Andy Bavier8a7b8b62016-07-26 18:35:06 -04002# test-vsg/tasks/main.yml
Andy Baviera27effe2016-07-18 19:23:26 -04003#
Andy Bavierb83beac2016-10-20 15:54:08 -04004# Run tests to check that the CORD-in-a-Box deployment has worked.
Andy Baviera27effe2016-07-18 19:23:26 -04005
Andy Bavier2ae18792016-11-28 21:04:43 -05006- name: Get name of compute node
Zack Williamsc989f262017-05-11 13:02:59 -07007 shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova service-list|grep nova-compute|cut -d '|' -f 3"
Andy Bavier2ae18792016-11-28 21:04:43 -05008 register: node_name
9 tags:
10 - skip_ansible_lint # running a sub job
11
Andy Baviera27effe2016-07-18 19:23:26 -040012- name: Wait for vSG VM to come up
Zack Williamsc989f262017-05-11 13:02:59 -070013 shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep 'vsg.*ACTIVE' > /dev/null"
Andy Baviera27effe2016-07-18 19:23:26 -040014 register: result
15 until: result | success
16 retries: 10
17 delay: 60
Zack Williams35624562016-08-28 17:12:26 -070018 tags:
19 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040020
21- name: Get ID of VM
Zack Williamsc989f262017-05-11 13:02:59 -070022 shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep mysite_vsg|cut -d '|' -f 2"
Andy Baviera27effe2016-07-18 19:23:26 -040023 register: nova_id
Zack Williams35624562016-08-28 17:12:26 -070024 tags:
25 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040026
27- name: Get mgmt IP of VM
Zack Williamsc989f262017-05-11 13:02:59 -070028 shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova interface-list {{ nova_id.stdout }}|grep -o -m 1 '172\.27\.[[:digit:]]*\.[[:digit:]]*'"
Andy Baviera27effe2016-07-18 19:23:26 -040029 register: mgmt_ip
Zack Williams35624562016-08-28 17:12:26 -070030 tags:
31 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040032
33- name: Wait for Docker container inside VM to come up
Andy Bavier30d27c92016-09-15 15:59:17 -040034 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 Baviera27effe2016-07-18 19:23:26 -040035 register: result
36 until: result | success
37 retries: 20
38 delay: 60
Zack Williams35624562016-08-28 17:12:26 -070039 tags:
40 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040041
Andy Bavierbef56282016-11-14 08:22:43 -080042- name: start container
Andy Bavierb83beac2016-10-20 15:54:08 -040043 become: yes
Andy Bavierbef56282016-11-14 08:22:43 -080044 lxd_container:
Andy Bavierb83beac2016-10-20 15:54:08 -040045 name: testclient
Andy Bavierb83beac2016-10-20 15:54:08 -040046 state: started
Andy Bavierb83beac2016-10-20 15:54:08 -040047
Andy Bavierbef56282016-11-14 08:22:43 -080048- 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
Zack Williams904e87f2017-03-02 14:35:28 -070053 retries: 20
54 delay: 30
Andy Bavierbef56282016-11-14 08:22:43 -080055 tags:
56 - skip_ansible_lint # running a sub job
57
Andy Baviera27effe2016-07-18 19:23:26 -040058- name: Test external connectivity in test client
Andy Bavierb83beac2016-10-20 15:54:08 -040059 become: yes
Andy Bavierbef56282016-11-14 08:22:43 -080060 command: lxc exec testclient -- ping -c 3 8.8.8.8
Andy Baviera27effe2016-07-18 19:23:26 -040061 register: pingtest
Scott Bakerc7a02562016-10-28 14:38:29 -070062 tags:
63 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040064
65- name: Output from ping test
Zack Williams35624562016-08-28 17:12:26 -070066 debug: var=pingtest.stdout_lines
Zack Williamsa2763112017-01-03 11:38:38 -070067