Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Capuccini committed Jan 11, 2017
1 parent 182a765 commit b5810f9
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 97 deletions.
4 changes: 2 additions & 2 deletions playbooks/roles/start-helm-test/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
tr -d '\n'
register: get_pod_name

- name: "get tiller-deploy ready statuses"
- name: "get tiller-deploy ready status"
command: >
kubectl get pods --namespace=kube-system {{get_pod_name.stdout}}
-o jsonpath='{.status.containerStatuses[*].ready}'
register: get_ready_status

- name: "test tiller-deploy ready statuses"
- name: "test tiller-deploy ready status"
fail:
msg: "unexpected tiller-deploy ready status: {{get_ready_status.stdout}}"
when: get_ready_status.stdout != "true"
18 changes: 18 additions & 0 deletions playbooks/roles/start-helm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,21 @@
- name: start helm
become: yes
command: helm init

- name: "get tiller-deploy pod name"
shell: >
kubectl get pods --namespace=kube-system |
grep tiller-deploy- |
awk '{print $1;}' |
tr -d '\n'
register: get_pod_name

- name: "wait for tiller-deploy ready status"
command: >
kubectl get pods --namespace=kube-system {{get_pod_name.stdout}}
-o jsonpath='{.status.containerStatuses[*].ready}'
register: tiller_ready_status
# Wait for 10 minutes
until: tiller_ready_status.stdout | match( '^(true\s)*true$' )
retries: 120
delay: 5
17 changes: 0 additions & 17 deletions test/cheese-deployment.yml

This file was deleted.

17 changes: 17 additions & 0 deletions test/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- hosts: localhost
connection: local
gather_facts: False
force_handlers: True
vars:
cf_zone: uservices.cloud
pre_tasks:
- name: get KubeNow version (git describe --tags)
command: git describe --tags
register: git_describe
- set_fact:
current_version: "v{{git_describe.stdout | replace('\n','') | replace('.', '')}}"
roles:
- test-packer
- test-terraform
- test-core
7 changes: 0 additions & 7 deletions test/pre_tasks/get_timestamp.yml

This file was deleted.

18 changes: 0 additions & 18 deletions test/roles/test-bootstrap/tasks/main.yml

This file was deleted.

32 changes: 0 additions & 32 deletions test/roles/test-cheese/tasks/main.yml

This file was deleted.

20 changes: 0 additions & 20 deletions test/roles/test-cheese/tasks/test-page.yml

This file was deleted.

File renamed without changes.
16 changes: 16 additions & 0 deletions test/roles/test-core/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: "render cloudflare configuration"
template:
args:
src: "{{playbook_dir}}/secrets-kubenow/cloudflare/conf.yml.j2"
dest: "{{playbook_dir}}/../playbooks/roles/cloudflare/vars/conf.yml"
notify: "clean Cloudflare"

- name: "run install-core.yml playbook"
command: ansible-playbook playbooks/install-core.yml
args:
chdir: "{{playbook_dir}}/.."

- name: "run infra-test.yml playbook"
command: ansible-playbook playbooks/infra-test.yml
args:
chdir: "{{playbook_dir}}/.."
16 changes: 16 additions & 0 deletions test/roles/test-packer/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: "get packer image id (openstack)"
listen: "delete image"
shell: >
glance image-list |
grep 'kubenow-{{current_version}}' |
awk '{print $2;}' |
tr -d "\n"
register: get_image_id
when: host_cloud == "openstack"

- name: "delete packer image (openstack)"
listen: "delete image"
command: glance image-delete {{get_image_id.stdout}}
args:
chdir: "{{playbook_dir}}/.."
when: host_cloud == "openstack"
1 change: 1 addition & 0 deletions test/roles/test-packer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
packer/build-{{host_cloud}}.json
args:
chdir: "{{playbook_dir}}/.."
notify: "delete image"
2 changes: 1 addition & 1 deletion test/secrets-kubenow

0 comments on commit b5810f9

Please sign in to comment.