blob: 2529262aa665ba7ad6da3dbdb9c644d5d0138701 [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 Baviera27effe2016-07-18 19:23:26 -04006- name: Wait for vSG VM to come up
Zack Williamsc989f262017-05-11 13:02:59 -07007 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 -04008 register: result
9 until: result | success
10 retries: 10
11 delay: 60
Zack Williams35624562016-08-28 17:12:26 -070012 tags:
13 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040014
15- name: Get ID of VM
Zack Williamsc989f262017-05-11 13:02:59 -070016 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 -040017 register: nova_id
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 mgmt IP of VM
Zack Williamsc989f262017-05-11 13:02:59 -070022 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 -040023 register: mgmt_ip
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
Moshe Levi8f2867c2017-07-17 03:52:42 +030027- name: Get name of compute node
28 shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova show {{ nova_id.stdout }}|grep hypervisor_hostname|cut -d '|' -f 3"
29 register: node_name
30 tags:
31 - skip_ansible_lint # running a sub job
32
Andy Baviera27effe2016-07-18 19:23:26 -040033- 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