Skip to content

Commit

Permalink
Add Kubernetes conformance tests (kubernetes-sigs#4614)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miouge1 authored and k8s-ci-robot committed May 27, 2019
1 parent 333f1a4 commit e30a703
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/files/tf-ovh_ubuntu18-calico.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dns_min_replicas: 1
deploy_netchecker: true
sonobuoy_enabled: true
3 changes: 3 additions & 0 deletions tests/scripts/testcases_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ ansible-playbook -e ansible_python_interpreter=${PYPATH} --limit "all:!fake_host
## Advanced DNS checks
ansible-playbook -e ansible_python_interpreter=${PYPATH} --limit "all:!fake_hosts" tests/testcases/040_check-network-adv.yml $LOG_LEVEL

## Kubernetes conformance tests
ansible-playbook -i ${ANSIBLE_INVENTORY} -e ansible_python_interpreter=${PYPATH} -e @${CI_TEST_VARS} --limit "all:!fake_hosts" tests/testcases/100_check-k8s-conformance.yml $LOG_LEVEL

## Idempotency checks 1/5 (repeat deployment)
if [ "${IDEMPOT_CHECK}" = "true" ]; then
ansible-playbook ${LOG_LEVEL} -e @${CI_TEST_VARS} -e ansible_python_interpreter=${PYPATH} -e local_release_dir=${PWD}/downloads --limit "all:!fake_hosts" cluster.yml
Expand Down
37 changes: 37 additions & 0 deletions tests/testcases/100_check-k8s-conformance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
- hosts: kube-master[0]
vars:
sonobuoy_version: 0.14.1
sonobuoy_arch: amd64
sonobuoy_parallel: 30
sonobuoy_path: /usr/local/bin/sonobuoy
sonobuoy_skip: 'Alpha|Disruptive|Feature|Flaky|Slow|Serial'
sonobuoy_mode: Quick

tasks:
- name: Run sonobuoy
when:
- sonobuoy_enabled is defined
- sonobuoy_enabled
block:
- name: Download sonobuoy
get_url:
url: "https://github.com/heptio/sonobuoy/releases/download/v{{ sonobuoy_version }}/sonobuoy_{{ sonobuoy_version }}_linux_{{ sonobuoy_arch }}.tar.gz"
dest: /tmp/sonobuoy.tar.gz

- name: Extract sonobuoy
unarchive:
src: /tmp/sonobuoy.tar.gz
dest: /usr/local/bin/
copy: no

- name: Run sonobuoy
command: "{{ sonobuoy_path }} run --mode {{ sonobuoy_mode }} --e2e-parallel {{ sonobuoy_parallel }} --e2e-skip {{ sonobuoy_skip }} --wait"
when: sonobuoy_enabled | default(false)

- name: Run sonobuoy retrieve
command: "{{ sonobuoy_path }} retrieve"
register: sonobuoy_retrieve

- name: Run inspect results
command: "{{ sonobuoy_path }} e2e {{ sonobuoy_retrieve.stdout }}"

0 comments on commit e30a703

Please sign in to comment.