mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-13 23:03:57 +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
83
e2e-tests/experiments/infra-chaos/service_failure/test.yml
Normal file
83
e2e-tests/experiments/infra-chaos/service_failure/test.yml
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
connection: local
|
||||
gather_facts: False
|
||||
|
||||
vars_files:
|
||||
- test_vars.yml
|
||||
- /mnt/parameters.yml
|
||||
|
||||
tasks:
|
||||
- block:
|
||||
|
||||
## Generating the testname for service failure chaos test
|
||||
- include_tasks: /e2e-tests/hack/create_testname.yml
|
||||
|
||||
## Record SOT (start of test) in e2e result e2e-cr (e2e-custom-resource)
|
||||
- include_tasks: /e2e-tests/hack/update_e2e_result_resource.yml
|
||||
vars:
|
||||
status: 'SOT'
|
||||
|
||||
- name: Identify the data consistency util to be invoked
|
||||
template:
|
||||
src: data_persistence.j2
|
||||
dest: data_persistence.yml
|
||||
|
||||
- include_vars:
|
||||
file: data_persistence.yml
|
||||
|
||||
- name: Record the data consistency util path
|
||||
set_fact:
|
||||
data_consistency_util_path: "{{ consistencyutil }}"
|
||||
when: data_persistence != ''
|
||||
|
||||
- name: Get the application pod name
|
||||
shell: >
|
||||
kubectl get pods -n {{ namespace }} -l {{ label }} --no-headers
|
||||
-o custom-columns=:.metadata.name
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: app_pod_name
|
||||
|
||||
- name: Create some test data
|
||||
include: "{{ data_consistency_util_path }}"
|
||||
vars:
|
||||
status: 'LOAD'
|
||||
ns: "{{ namespace }}"
|
||||
pod_name: "{{ app_pod_name.stdout }}"
|
||||
when: data_persistence != ''
|
||||
|
||||
- include_tasks: /e2e-tests/chaoslib/service_failure/service_chaos.yml
|
||||
vars:
|
||||
app_ns: "{{ namespace }}"
|
||||
app_label: "{{ label }}"
|
||||
action: "svc_stop"
|
||||
app_pod: "{{ app_pod_name.stdout }}"
|
||||
|
||||
- include_tasks: /e2e-tests/chaoslib/service_failure/service_chaos.yml
|
||||
vars:
|
||||
app_ns: "{{ namespace }}"
|
||||
app_label: "{{ label }}"
|
||||
action: "svc_start"
|
||||
app_pod: "{{ app_pod_name.stdout }}"
|
||||
|
||||
- name: Verify application data persistence
|
||||
include: "{{ data_consistency_util_path }}"
|
||||
vars:
|
||||
status: 'VERIFY'
|
||||
ns: "{{ namespace }}"
|
||||
pod_name: "{{ new_app_pod }}"
|
||||
when: data_persistence != ''
|
||||
|
||||
- set_fact:
|
||||
flag: "Pass"
|
||||
|
||||
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