blob: 51028ae4724575ade9761df064dffb2ac7130636 [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
Scott Baker995641b2016-11-15 17:09:26 -08007 make:
8 chdir: "{{ service_profile_repo_dest }}/{{ xos_configuration }}"
9 target: cord-subscriber
Andy Baviera27effe2016-07-18 19:23:26 -040010
Andy Baviera27effe2016-07-18 19:23:26 -040011- name: Re-run 'make vtn' (work around bug in synchronizer)
Scott Baker995641b2016-11-15 17:09:26 -080012 make:
13 chdir: "{{ service_profile_repo_dest }}/{{ xos_configuration }}"
14 target: vtn
Andy Baviera27effe2016-07-18 19:23:26 -040015
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 Williams35624562016-08-28 17:12:26 -070022 tags:
23 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040024
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 Williams35624562016-08-28 17:12:26 -070028 tags:
29 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040030
31- name: Get mgmt IP of VM
Zack Williams6e668992016-11-26 09:54:48 -070032 shell: bash -c "source ~/admin-openrc.sh; nova interface-list {{ nova_id.stdout }}|grep -o -m 1 '172\.27\.[[:digit:]]*\.[[:digit:]]*'"
Andy Baviera27effe2016-07-18 19:23:26 -040033 register: mgmt_ip
Zack Williams35624562016-08-28 17:12:26 -070034 tags:
35 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040036
Andy Bavier30d27c92016-09-15 15:59:17 -040037- 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 Baviera27effe2016-07-18 19:23:26 -040043- name: Wait for Docker container inside VM to come up
Andy Bavier30d27c92016-09-15 15:59:17 -040044 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 -040045 register: result
46 until: result | success
47 retries: 20
48 delay: 60
Zack Williams35624562016-08-28 17:12:26 -070049 tags:
50 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040051
Andy Bavierbef56282016-11-14 08:22:43 -080052- name: start container
Andy Bavierb83beac2016-10-20 15:54:08 -040053 become: yes
Andy Bavierbef56282016-11-14 08:22:43 -080054 lxd_container:
Andy Bavierb83beac2016-10-20 15:54:08 -040055 name: testclient
Andy Bavierb83beac2016-10-20 15:54:08 -040056 state: started
Andy Bavierb83beac2016-10-20 15:54:08 -040057
Andy Bavierbef56282016-11-14 08:22:43 -080058- 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 Baviera27effe2016-07-18 19:23:26 -040068- name: Test external connectivity in test client
Andy Bavierb83beac2016-10-20 15:54:08 -040069 become: yes
Andy Bavierbef56282016-11-14 08:22:43 -080070 command: lxc exec testclient -- ping -c 3 8.8.8.8
Andy Baviera27effe2016-07-18 19:23:26 -040071 register: pingtest
Scott Bakerc7a02562016-10-28 14:38:29 -070072 tags:
73 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040074
75- name: Output from ping test
Zack Williams35624562016-08-28 17:12:26 -070076 debug: var=pingtest.stdout_lines