mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
feat(e2e-test): Add e2e-tests for zfs-localpv (#298)
Signed-off-by: w3aman <aman.gupta@mayadata.io>
This commit is contained in:
parent
53f872fcf1
commit
4e73638b5a
137 changed files with 8745 additions and 0 deletions
96
e2e-tests/apps/busybox/liveness/test.yml
Normal file
96
e2e-tests/apps/busybox/liveness/test.yml
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
connection: local
|
||||
gather_facts: False
|
||||
|
||||
vars_files:
|
||||
- test_vars.yml
|
||||
|
||||
tasks:
|
||||
- block:
|
||||
- block:
|
||||
|
||||
- name: Record test instance/run ID
|
||||
set_fact:
|
||||
run_id: "{{ lookup('env','RUN_ID') }}"
|
||||
|
||||
- name: Construct testname appended with runID
|
||||
set_fact:
|
||||
test_name: "{{ test_name }}-{{ run_id }}"
|
||||
|
||||
when: lookup('env','RUN_ID')
|
||||
|
||||
## RECORD START-OF-TEST IN e2e RESULT CR
|
||||
- include_tasks: /e2e-tests/hack/update_e2e_result_resource.yml
|
||||
vars:
|
||||
status: 'SOT'
|
||||
|
||||
- block:
|
||||
|
||||
- name: Getting the application pod name
|
||||
shell: kubectl get pod -n {{ namespace }} -l {{ app_label }} -o jsonpath={.items[0].metadata.name}
|
||||
register: pod_name
|
||||
|
||||
- name: Replacing the placeholder for pod-name
|
||||
replace:
|
||||
path: "{{ busybox_liveness }}"
|
||||
regexp: "pod-name"
|
||||
replace: "{{ pod_name.stdout }}"
|
||||
|
||||
- name: Replacing the placeholder for namespace
|
||||
replace:
|
||||
path: "{{ busybox_liveness }}"
|
||||
regexp: "app-namespace"
|
||||
replace: "{{ namespace }}"
|
||||
|
||||
- name: Replacing the placeholder for liveness-retry-count
|
||||
replace:
|
||||
path: "{{ busybox_liveness }}"
|
||||
regexp: "liveness-retry-count"
|
||||
replace: "{{ liveness_retry }}"
|
||||
|
||||
- name: Replacing the placeholder for liveness-timeout
|
||||
replace:
|
||||
path: "{{ busybox_liveness }}"
|
||||
regexp: "liveness-timeout-seconds"
|
||||
replace: "{{ liveness_timeout }}"
|
||||
|
||||
- name: Creating busybox-liveness job
|
||||
shell: kubectl create -f {{ busybox_liveness }}
|
||||
|
||||
- name: Verifying whether liveness pod is started successfully
|
||||
shell: kubectl get pod -n {{ namespace }} -l liveness=busybox-liveness -o jsonpath={.items[0].status.phase}
|
||||
register: pod_status
|
||||
until: "'Running' in pod_status.stdout"
|
||||
delay: 5
|
||||
retries: 40
|
||||
|
||||
- set_fact:
|
||||
flag: "Pass"
|
||||
|
||||
when: "'deprovision' not in action"
|
||||
|
||||
- block:
|
||||
- name: Getting the busybox liveness job
|
||||
shell: kubectl get job -l liveness=busybox-liveness -n {{ namespace }} -o jsonpath='{.items[0].metadata.name}'
|
||||
register: liveness_job
|
||||
|
||||
- name: Deleting busybox liveness job
|
||||
shell: kubectl delete job {{ liveness_job.stdout }} -n {{ namespace }}
|
||||
|
||||
- set_fact:
|
||||
flag: "Pass"
|
||||
|
||||
when: "'deprovision' is in action"
|
||||
|
||||
rescue:
|
||||
- set_fact:
|
||||
flag: "Fail"
|
||||
|
||||
always:
|
||||
|
||||
## RECORD END-OF-TEST IN e2e RESULT CR
|
||||
- include_tasks: /e2e-tests/hack/update_e2e_result_resource.yml
|
||||
vars:
|
||||
status: 'EOT'
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue