Skip to content

Commit 0d9a187

Browse files
committed
Add CEL test cases
Signed-off-by: Leonardo Cecchi <[email protected]>
1 parent 5af2237 commit 0d9a187

27 files changed

+318
-17
lines changed

client/hack/README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,9 @@ are correctly working.
121121
```
122122
./hack/run-cel-tests.sh
123123
124-
cel-tests/volumegroupsnapshotcontent/vgsc-change-ref-namespace.post.yaml: SUCCESS
125-
cel-tests/volumegroupsnapshotcontent/vgsc-source-volume-to-groupsnapshot.post.yaml: SUCCESS
126-
cel-tests/volumegroupsnapshotcontent/vgsc-source-empty.yaml: SUCCESS (expected failure)
127-
cel-tests/volumegroupsnapshotcontent/vgsc-change-ref-namespace.pre.yaml: SUCCESS
128-
cel-tests/volumegroupsnapshotcontent/vgsc-ref-only-name.yaml: SUCCESS (expected failure)
129-
[...]
130-
cel-tests/volumegroupsnapshotcontent/vgsc-change-ref-namespace.pre.yaml -> cel-tests/volumegroupsnapshotcontent/vgsc-change-ref-namespace.post.yaml: SUCCESS (expected failure)
131-
cel-tests/volumegroupsnapshotcontent/vgsc-source-volume-immutable.pre.yaml -> cel-tests/volumegroupsnapshotcontent/vgsc-source-volume-immutable.post.yaml: SUCCESS (expected failure)
132-
cel-tests/volumegroupsnapshotcontent/vgsc-source-volume-to-groupsnapshot.pre.yaml -> cel-tests/volumegroupsnapshotcontent/vgsc-source-volume-to-groupsnapshot.post.yaml: SUCCESS (expected failure)
133-
cel-tests/volumegroupsnapshotcontent/vgsc-source-groupsnapshot-immutable.pre.yaml -> cel-tests/volumegroupsnapshotcontent/vgsc-source-groupsnapshot-immutable.post.yaml: SUCCESS (expected failure)
134-
[...]
135-
136-
SUCCESS: 90
124+
SUCCESS: 108
137125
FAILURES: 0
138126
```
127+
128+
Adding the `-v` option to `run-cel-tests.sh` will show the output of each
129+
test case.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: groupsnapshot.storage.k8s.io/v1beta2
3+
kind: VolumeGroupSnapshotClass
4+
metadata:
5+
name: csi-hostpath-groupsnapclass
6+
driver: hostpath.csi.k8s.io
7+
deletionPolicy: Retain
8+
parameters:
9+
one: two
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deletionPolicy: Invalid value: "string": deletionPolicy is immutable once set
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: groupsnapshot.storage.k8s.io/v1beta2
3+
kind: VolumeGroupSnapshotClass
4+
metadata:
5+
name: csi-hostpath-groupsnapclass
6+
driver: hostpath.csi.k8s.io
7+
deletionPolicy: Delete
8+
parameters:
9+
one: two
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: groupsnapshot.storage.k8s.io/v1beta2
3+
kind: VolumeGroupSnapshotClass
4+
metadata:
5+
name: csi-hostpath-groupsnapclass
6+
driver: hostpath.csi.k8s.io
7+
deletionPolicy: Delete
8+
parameters:
9+
one: three
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
parameters: Invalid value: "object": parameters are immutable once set
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: groupsnapshot.storage.k8s.io/v1beta2
3+
kind: VolumeGroupSnapshotClass
4+
metadata:
5+
name: csi-hostpath-groupsnapclass
6+
driver: hostpath.csi.k8s.io
7+
deletionPolicy: Delete
8+
parameters:
9+
one: two
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
apiVersion: groupsnapshot.storage.k8s.io/v1beta2
3+
kind: VolumeGroupSnapshotContent
4+
metadata:
5+
name: new-groupsnapshotcontent-demo
6+
spec:
7+
volumeGroupSnapshotRef:
8+
name: new-groupsnapshot-demo
9+
namespace: default
10+
driver: hostpath.csi.k8s.io
11+
volumeGroupSnapshotClassName: class-post
12+
source:
13+
groupSnapshotHandles:
14+
volumeGroupSnapshotHandle: this-handle
15+
volumeSnapshotHandles:
16+
- handle
17+
- another-handle
18+
deletionPolicy: Retain
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Invalid value: "string": volumeGroupSnapshotClassName is immutable once set
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
apiVersion: groupsnapshot.storage.k8s.io/v1beta2
3+
kind: VolumeGroupSnapshotContent
4+
metadata:
5+
name: new-groupsnapshotcontent-demo
6+
spec:
7+
volumeGroupSnapshotRef:
8+
name: new-groupsnapshot-demo
9+
namespace: default
10+
driver: hostpath.csi.k8s.io
11+
volumeGroupSnapshotClassName: class-pre
12+
source:
13+
groupSnapshotHandles:
14+
volumeGroupSnapshotHandle: this-handle
15+
volumeSnapshotHandles:
16+
- handle
17+
- another-handle
18+
deletionPolicy: Retain

0 commit comments

Comments
 (0)