Integrate the integration test

This commit is contained in:
Tristan Cacqueray
2020-02-12 12:40:02 +00:00
parent 42cf348eeb
commit 9c80a5756c
2 changed files with 20 additions and 11 deletions

View File

@@ -326,6 +326,7 @@
register: k8s_info_testing6
failed_when: not k8s_info_testing6.resources or k8s_info_testing6.resources[0].status.phase != "Active"
- include_tasks: test_k8s_exec.yml
- include_tasks: crd.yml
- include_tasks: lists.yml
- include_tasks: append_hash.yml

View File

@@ -2,24 +2,26 @@
- vars:
ns: k8s-exec
pod: sleep-pod
pod_def:
apiVersion: v1
kind: Pod
metadata:
name: "{{ pod }}"
namespace: "{{ ns }}"
spec:
containers:
- image: busybox
command: ["sleep", "infinity"]
block:
- name: ensure that k8s-log namespace exists
- name: Ensure that k8s-log namespace exists
k8s:
kind: Namespace
name: "{{ ns }}"
- name: Create a pod
k8s:
definition:
apiVersion: v1
kind: Pod
metadata:
name: "{{ pod }}"
namespace: "{{ ns }}"
spec:
containers:
- image: busybox
command: ["sleep", "infinity"]
definition: "{{ pod_def }}"
wait: yes
wait_sleep: 1
wait_timeout: 30
@@ -39,3 +41,9 @@
assert:
that:
- "'nameserver' in output.stdout"
- name: Cleanup namespace
k8s:
kind: Namespace
name: "{{ ns }}"
state: absent