-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathchainsaw-test.yaml
executable file
·60 lines (60 loc) · 1.74 KB
/
chainsaw-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: byovpc
spec:
steps:
- name: step-00
try:
- assert:
file: 00-assert.yaml
- name: step-01
try:
- command:
args:
- createVPC
entrypoint: make
- script:
content: |-
VPC_ID=$(make fetchVPCID) \
TS="$(TPL="$PWD/01-create-vpc.tpl.yml" make renderTestCase)" make runTestSuit
- command:
args:
- enableVPC
entrypoint: make
- script:
content: |-
VPC_UID="$(OBJ=linodevpcs/linodevpc-sample make getKubeUid)" \
TS="$(TPL="$PWD/01-create-cluster.tpl.yml" make renderTestCase)" make runTestSuit
- apply:
file: 01-create-cluster.tpl.yml
- apply:
file: 01-create-vpc.tpl.yml
- assert:
file: 01-assert.yaml
- name: step-02
try:
- script:
content: |-
MACHINE_UID="$(OBJ=machines/machine-sample make getKubeUid)" \
TS="$(TPL="$PWD/02-create-linodemachine.tpl.yml" make renderTestCase)" make runTestSuit
- apply:
file: 02-create-linodemachine.tpl.yml
- assert:
file: 02-assert.yaml
- name: step-03
try:
- delete:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachine
name: linodemachine-sample
- error:
file: 03-error.yaml
- name: step-04
try:
- script:
content: 'URI="linode/instances" FILTER="{\"tags\":\"$(OBJ=linodemachines/linodemachine-sample
make getKubeUid)\"}" make callLinodeApiGet | grep ''results": 0'''