mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-11 22:10:11 +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
23
e2e-tests/hack/crds.yaml
Normal file
23
e2e-tests/hack/crds.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1beta1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
# name must match the spec fields below, and be in the form: <plural>.<group>
|
||||
name: e2eresults.e2e.io
|
||||
spec:
|
||||
# group name to use for REST API: /apis/<group>/<version>
|
||||
group: e2e.io
|
||||
# version name to use for REST API: /apis/<group>/<version>
|
||||
version: v1alpha1
|
||||
# either Namespaced or Cluster
|
||||
scope: Cluster
|
||||
names:
|
||||
# plural name to be used in the URL: /apis/<group>/<version>/<plural>
|
||||
plural: e2eresults
|
||||
# singular name to be used as an alias on the CLI and for display
|
||||
singular: e2eresult
|
||||
# kind is normally the CamelCased singular type. Your resource manifests use this.
|
||||
kind: e2eResult
|
||||
# shortNames allow shorter string to match your resource name on the CLI
|
||||
shortNames:
|
||||
- e2er
|
||||
11
e2e-tests/hack/create_testname.yml
Normal file
11
e2e-tests/hack/create_testname.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- 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')
|
||||
10
e2e-tests/hack/e2e-result.j2
Normal file
10
e2e-tests/hack/e2e-result.j2
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
apiVersion: e2e.io/v1alpha1
|
||||
kind: e2eResult
|
||||
metadata:
|
||||
# name of the e2e testcase
|
||||
name: {{ test }}
|
||||
spec:
|
||||
testStatus:
|
||||
phase: {{ phase }}
|
||||
result: {{ verdict }}
|
||||
38
e2e-tests/hack/rbac.yaml
Normal file
38
e2e-tests/hack/rbac.yaml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: e2e
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: e2e
|
||||
namespace: e2e
|
||||
labels:
|
||||
name: e2e
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: e2e
|
||||
labels:
|
||||
name: e2e
|
||||
rules:
|
||||
- apiGroups: ["*"]
|
||||
resources: ["*"]
|
||||
verbs: ["*"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: e2e
|
||||
labels:
|
||||
name: e2e
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: e2e
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: e2e
|
||||
namespace: e2e
|
||||
45
e2e-tests/hack/update_e2e_result_resource.yml
Normal file
45
e2e-tests/hack/update_e2e_result_resource.yml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
- block:
|
||||
- name: Generate the e2e result CR to reflect SOT (Start of Test)
|
||||
template:
|
||||
src: e2e-result.j2
|
||||
dest: e2e-result.yaml
|
||||
vars:
|
||||
test: "{{ test_name }}"
|
||||
phase: in-progress
|
||||
verdict: none
|
||||
|
||||
- name: Analyze the e2e cr yaml
|
||||
shell: cat e2e-result.yaml
|
||||
|
||||
- name: Apply the e2e result CR
|
||||
k8s:
|
||||
state: present
|
||||
src: e2e-result.yaml
|
||||
register: e2er_status
|
||||
failed_when: "e2er_status is failed"
|
||||
|
||||
when: status == "SOT"
|
||||
|
||||
- block:
|
||||
- name: Generate the e2e result CR to reflect EOT (End of Test)
|
||||
template:
|
||||
src: e2e-result.j2
|
||||
dest: e2e-result.yaml
|
||||
vars:
|
||||
test: "{{ test_name }}"
|
||||
phase: completed
|
||||
verdict: "{{ flag }}"
|
||||
|
||||
- name: Analyze the e2e cr yaml
|
||||
shell: cat e2e-result.yaml
|
||||
|
||||
- name: Apply the e2e result CR
|
||||
k8s:
|
||||
state: present
|
||||
src: e2e-result.yaml
|
||||
merge_type: merge
|
||||
register: e2er_status
|
||||
failed_when: "e2er_status is failed"
|
||||
|
||||
when: status == "EOT"
|
||||
Loading…
Add table
Add a link
Reference in a new issue