blob: eaad0a5de21073e1dfa3b16a6e446a5b7583864f [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#
4# Run tests to check that the single-node deployment has worked
5
6- name: Create a sample CORD subscriber
7 command: ansible xos-1 -u ubuntu -m shell \
8 -a "cd ~/service-profile/cord-pod; make cord-subscriber"
Zack Williams35624562016-08-28 17:12:26 -07009 tags:
10 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040011
12- name: Pause 60 seconds (work around bug in synchronizer)
13 pause: seconds=60
14
15- name: Re-run 'make vtn' (work around bug in synchronizer)
16 command: ansible xos-1 -u ubuntu -m shell \
17 -a "cd ~/service-profile/cord-pod; make vtn"
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: Wait for vSG VM to come up
22 shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep 'vsg.*ACTIVE' > /dev/null"
23 register: result
24 until: result | success
25 retries: 10
26 delay: 60
Zack Williams35624562016-08-28 17:12:26 -070027 tags:
28 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040029
30- name: Get ID of VM
31 shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep mysite_vsg|cut -d '|' -f 2"
32 register: nova_id
Zack Williams35624562016-08-28 17:12:26 -070033 tags:
34 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040035
36- name: Get mgmt IP of VM
37 shell: bash -c "source ~/admin-openrc.sh; nova interface-list {{ nova_id.stdout }}|grep -o -m 1 172.27.[[:digit:]]*.[[:digit:]]*"
38 register: mgmt_ip
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
42- name: Wait for Docker container inside VM to come up
43 shell: ssh -o ProxyCommand="ssh -W %h:%p ubuntu@nova-compute-1" ubuntu@{{ mgmt_ip.stdout }} "sudo docker ps|grep vcpe" > /dev/null
44 register: result
45 until: result | success
46 retries: 20
47 delay: 60
Zack Williams35624562016-08-28 17:12:26 -070048 tags:
49 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040050
51- name: Run dhclient inside testclient to get IP address from vSG
52 command: ansible nova-compute-1 -u ubuntu -m shell \
53 -s -a "lxc-attach -n testclient -- dhclient eth0.222.111"
Zack Williams35624562016-08-28 17:12:26 -070054 tags:
55 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040056
57- name: Test external connectivity in test client
58 command: ansible nova-compute-1 -u ubuntu -m shell \
59 -s -a "lxc-attach -n testclient -- ping -c 3 8.8.8.8"
60 register: pingtest
Zack Williams35624562016-08-28 17:12:26 -070061 tags:
62 - skip_ansible_lint # running a sub job
Andy Baviera27effe2016-07-18 19:23:26 -040063
64- name: Output from ping test
Zack Williams35624562016-08-28 17:12:26 -070065 debug: var=pingtest.stdout_lines