blob: 8fc494f90de0de707006a95c8623bd100ef6322f [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
Scott Bakerdb5c8c72016-11-08 08:40:06 -08006- name: Create cord subscriber
7 command: chdir="{{ service_profile_repo_dest }}/{{ xos_configuration }}" bash -c "make cord-subscriber |& tee xos-make-cord-subscriber.out"
Zack Williams35624562016-08-28 17:12:26 -07008 tags:
Scott Bakerdb5c8c72016-11-08 08:40:06 -08009 - skip_ansible_lint
Andy Baviera27effe2016-07-18 19:23:26 -040010
11- name: Pause 60 seconds (work around bug in synchronizer)
12 pause: seconds=60
13
14- name: Re-run 'make vtn' (work around bug in synchronizer)
Scott Bakerdb5c8c72016-11-08 08:40:06 -080015 command: chdir="{{ service_profile_repo_dest }}/{{ xos_configuration }}" bash -c "make vtn |& tee xos-makevtn2.out"
Zack Williams35624562016-08-28 17:12:26 -070016 tags:
Scott Bakerdb5c8c72016-11-08 08:40:06 -080017 - skip_ansible_lint
Andy Baviera27effe2016-07-18 19:23:26 -040018
19- name: Wait for vSG VM to come up
20 shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep 'vsg.*ACTIVE' > /dev/null"
21 register: result
22 until: result | success
23 retries: 10
24 delay: 60
Zack Williams35624562016-08-28 17:12:26 -070025 tags:
26 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040027
28- name: Get ID of VM
29 shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep mysite_vsg|cut -d '|' -f 2"
30 register: nova_id
Zack Williams35624562016-08-28 17:12:26 -070031 tags:
32 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040033
34- name: Get mgmt IP of VM
35 shell: bash -c "source ~/admin-openrc.sh; nova interface-list {{ nova_id.stdout }}|grep -o -m 1 172.27.[[:digit:]]*.[[:digit:]]*"
36 register: mgmt_ip
Zack Williams35624562016-08-28 17:12:26 -070037 tags:
38 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040039
Andy Bavier30d27c92016-09-15 15:59:17 -040040- name: Get name of compute node
41 shell: bash -c "source ~/admin-openrc.sh; nova service-list|grep nova-compute|cut -d '|' -f 3"
42 register: node_name
43 tags:
44 - skip_ansible_lint # running a sub job
45
Andy Baviera27effe2016-07-18 19:23:26 -040046- name: Wait for Docker container inside VM to come up
Andy Bavier30d27c92016-09-15 15:59:17 -040047 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 -040048 register: result
49 until: result | success
50 retries: 20
51 delay: 60
Zack Williams35624562016-08-28 17:12:26 -070052 tags:
53 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040054
Andy Bavierbef56282016-11-14 08:22:43 -080055- name: start container
Andy Bavierb83beac2016-10-20 15:54:08 -040056 become: yes
Andy Bavierbef56282016-11-14 08:22:43 -080057 lxd_container:
Andy Bavierb83beac2016-10-20 15:54:08 -040058 name: testclient
Andy Bavierb83beac2016-10-20 15:54:08 -040059 state: started
Andy Bavierb83beac2016-10-20 15:54:08 -040060
Andy Bavierbef56282016-11-14 08:22:43 -080061- name: Make sure testclient has default route to vSG
62 become: yes
63 shell: lxc exec testclient -- route | grep default | grep "eth0.222.111"
64 register: result
65 until: result | success
66 retries: 3
67 delay: 10
68 tags:
69 - skip_ansible_lint # running a sub job
70
Andy Baviera27effe2016-07-18 19:23:26 -040071- name: Test external connectivity in test client
Andy Bavierb83beac2016-10-20 15:54:08 -040072 become: yes
Andy Bavierbef56282016-11-14 08:22:43 -080073 command: lxc exec testclient -- ping -c 3 8.8.8.8
Andy Baviera27effe2016-07-18 19:23:26 -040074 register: pingtest
Scott Bakerc7a02562016-10-28 14:38:29 -070075 tags:
76 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040077
78- name: Output from ping test
Zack Williams35624562016-08-28 17:12:26 -070079 debug: var=pingtest.stdout_lines