Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,45 @@ spec:
tenant: MY_TENANT
customFields:
netboxOperatorRestorationHash: 00b8772de73cdac083b0732d5bb85ab4f0caa16c
- name: Set preserveInNetbox to false
description: Set preserveInNetbox to false to clean up the NetBox test instance
try:
- patch:
resource:
apiVersion: netbox.dev/v1
kind: PrefixClaim
metadata:
name: prefixclaim-ipv4-parentprefix-restore-1
spec:
preserveInNetbox: false
- patch:
resource:
apiVersion: netbox.dev/v1
kind: PrefixClaim
metadata:
name: prefixclaim-ipv4-parentprefix-restore-2
spec:
preserveInNetbox: false
- assert:
resource:
apiVersion: netbox.dev/v1
kind: Prefix
metadata:
name: prefixclaim-ipv4-parentprefix-restore-1
status:
(conditions[?type == 'Ready']):
- observedGeneration: 2
status: 'True'
- assert:
resource:
apiVersion: netbox.dev/v1
kind: Prefix
metadata:
name: prefixclaim-ipv4-parentprefix-restore-2
status:
(conditions[?type == 'Ready']):
- observedGeneration: 2
status: 'True'
- name: Cleanup events
description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource
cleanup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,27 @@ spec:
tenant: MY_TENANT_2
customFields:
netboxOperatorRestorationHash: 8a5e15cd391ec02a7a2b2e316bc163f4fe46ef0b
- name: Set preserveInNetbox to false
description: Set preserveInNetbox to false to clean up the NetBox test instance
try:
- patch:
resource:
apiVersion: netbox.dev/v1
kind: PrefixClaim
metadata:
name: prefixclaim-ipv4-parentprefixselector-restore-1
spec:
preserveInNetbox: false
- assert:
resource:
apiVersion: netbox.dev/v1
kind: Prefix
metadata:
name: prefixclaim-ipv4-parentprefixselector-restore-1
status:
(conditions[?type == 'Ready']):
- observedGeneration: 2
status: 'True'
- name: Cleanup events
description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource
cleanup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ spec:
tenant: MY_TENANT_2
customFields:
netboxOperatorRestorationHash: 46116345cc81820fdb412dc83e7147d4b1dc1afa
- name: Set preserveInNetbox to false
description: Set preserveInNetbox to false to clean up the NetBox test instance
try:
- patch:
resource:
apiVersion: netbox.dev/v1
kind: PrefixClaim
metadata:
name: prefixclaim-ipv4-parentprefixselector-apply
spec:
preserveInNetbox: false
- assert:
resource:
apiVersion: netbox.dev/v1
kind: Prefix
metadata:
name: prefixclaim-ipv4-parentprefixselector-apply
status:
(conditions[?type == 'Ready']):
- observedGeneration: 2
status: 'True'
- name: Cleanup events
description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource
cleanup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,27 @@ spec:
prefix: 2::/124
preserveInNetbox: true
tenant: MY_TENANT_2
- name: Set preserveInNetbox to false
description: Set preserveInNetbox to false to clean up the NetBox test instance
try:
- patch:
resource:
apiVersion: netbox.dev/v1
kind: PrefixClaim
metadata:
name: prefixclaim-ipv6-apply-update
spec:
preserveInNetbox: false
- assert:
resource:
apiVersion: netbox.dev/v1
kind: Prefix
metadata:
name: prefixclaim-ipv6-apply-update
status:
(conditions[?type == 'Ready']):
- observedGeneration: 3
status: 'True'
- name: Cleanup events
description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource
cleanup:
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# How to run the test locally?

- [Install](https://kyverno.github.io/chainsaw/latest/quick-start/install/) `chainsaw`: `go install github.com/kyverno/chainsaw@latest`
- Execute `make test-e2e`
- Execute `make test-e2e` or `chainsaw test --namespace e2e` with specific flags (see Makefile)
- Use `--test-dir` flag if you want to execute a specific test.
- Use `--skip-delete` flag in case you want to skip the deletion of the Kubernetes resources (e.g. for debugging). Note that this results in leftovers and you might need to clean up things.

# How to add a new test locally?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,27 @@ spec:
status:
(conditions[?type == 'Ready']):
- status: 'True'
- name: Set preserveInNetbox to false
description: Set preserveInNetbox to false to clean up the NetBox test instance
try:
- patch:
resource:
apiVersion: netbox.dev/v1
kind: IpAddressClaim
metadata:
name: ipaddressclaim-ipv4-restore-1
spec:
preserveInNetbox: false
- assert:
resource:
apiVersion: netbox.dev/v1
kind: IpAddress
metadata:
name: ipaddressclaim-ipv4-restore-1
status:
(conditions[?type == 'Ready']):
- observedGeneration: 2
status: 'True'
- name: Cleanup events
description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource
cleanup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,27 @@ spec:
status:
(conditions[?type == 'Ready']):
- status: 'True'
- name: Set preserveInNetbox to false
description: Set preserveInNetbox to false to clean up the NetBox test instance
try:
- patch:
resource:
apiVersion: netbox.dev/v1
kind: IpAddressClaim
metadata:
name: ipaddressclaim-ipv6-restore-1
spec:
preserveInNetbox: false
- assert:
resource:
apiVersion: netbox.dev/v1
kind: IpAddress
metadata:
name: ipaddressclaim-ipv6-restore-1
status:
(conditions[?type == 'Ready']):
- observedGeneration: 2
status: 'True'
- name: Cleanup events
description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource
cleanup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,27 @@ spec:
status:
(conditions[?type == 'Ready']):
- status: 'True'
- name: Set preserveInNetbox to false
description: Set preserveInNetbox to false to clean up the NetBox test instance
try:
- patch:
resource:
apiVersion: netbox.dev/v1
kind: IpRangeClaim
metadata:
name: iprangeclaim-ipv4-restore-1
spec:
preserveInNetbox: false
- assert:
resource:
apiVersion: netbox.dev/v1
kind: IpRange
metadata:
name: iprangeclaim-ipv4-restore-1
status:
(conditions[?type == 'Ready']):
- observedGeneration: 2
status: 'True'
- name: Cleanup events and leases
description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests)
cleanup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,27 @@ spec:
status:
(conditions[?type == 'Ready']):
- status: 'True'
- name: Set preserveInNetbox to false
description: Set preserveInNetbox to false to clean up the NetBox test instance
try:
- patch:
resource:
apiVersion: netbox.dev/v1
kind: IpRangeClaim
metadata:
name: iprangeclaim-ipv6-restore-1
spec:
preserveInNetbox: false
- assert:
resource:
apiVersion: netbox.dev/v1
kind: IpRange
metadata:
name: iprangeclaim-ipv6-restore-1
status:
(conditions[?type == 'Ready']):
- observedGeneration: 2
status: 'True'
- name: Cleanup events and leases
description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests)
cleanup:
Expand Down