Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests succeed on OpenShift #324

Merged
merged 7 commits into from
Dec 12, 2023
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
30 changes: 30 additions & 0 deletions tests/templates/kuttl/kerberos/00-rbac.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-integration-tests-scc
rules:
{% if test_scenario['values']['openshift'] == "true" %}
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames: ["privileged"]
verbs: ["use"]
{% endif %}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: integration-tests-sa
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-integration-tests-scc
subjects:
- kind: ServiceAccount
name: integration-tests-sa
roleRef:
kind: Role
name: use-integration-tests-scc
apiGroup: rbac.authorization.k8s.io

3 changes: 3 additions & 0 deletions tests/templates/kuttl/kerberos/01-install-kdc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ spec:
labels:
app: krb5-kdc
spec:
serviceAccount: integration-tests-sa
securityContext:
runAsUser: 0
initContainers:
- name: init
image: docker.stackable.tech/stackable/krb5:1.18.2-stackable23.4.0-rc1
Expand Down
1 change: 1 addition & 0 deletions tests/templates/kuttl/kerberos/kinit-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
spec:
template:
spec:
serviceAccount: integration-tests-sa
containers:
- name: client
image: docker.stackable.tech/stackable/krb5:1.18.2-stackable23.4.0-rc1
Expand Down
30 changes: 30 additions & 0 deletions tests/templates/kuttl/listener/00-rbac.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-integration-tests-scc
rules:
{% if test_scenario['values']['openshift'] == "true" %}
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames: ["privileged"]
verbs: ["use"]
{% endif %}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: integration-tests-sa
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-integration-tests-scc
subjects:
- kind: ServiceAccount
name: integration-tests-sa
roleRef:
kind: Role
name: use-integration-tests-scc
apiGroup: rbac.authorization.k8s.io

3 changes: 3 additions & 0 deletions tests/templates/kuttl/listener/01-install-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ spec:
labels:
app: nginx
spec:
serviceAccount: integration-tests-sa
securityContext:
runAsUser: 0
containers:
- name: nginx
image: nginx:latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ rules:
- pods
verbs:
- get
{% if test_scenario['values']['openshift'] == "true" %}
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames: ["privileged"]
verbs: ["use"]
{% endif %}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand All @@ -41,6 +47,7 @@ metadata:
spec:
template:
spec:
serviceAccount: client-sa
containers:
- name: client
image: docker.stackable.tech/stackable/testing-tools:0.2.0-stackable0.0.0-dev
Expand Down
30 changes: 30 additions & 0 deletions tests/templates/kuttl/tls/02-rbac.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-integration-tests-scc
rules:
{% if test_scenario['values']['openshift'] == "true" %}
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames: ["privileged"]
verbs: ["use"]
{% endif %}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: integration-tests-sa
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-integration-tests-scc
subjects:
- kind: ServiceAccount
name: integration-tests-sa
roleRef:
kind: Role
name: use-integration-tests-scc
apiGroup: rbac.authorization.k8s.io

1 change: 1 addition & 0 deletions tests/templates/kuttl/tls/consumer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ spec:
fsGroup: 1000
restartPolicy: Never
terminationGracePeriodSeconds: 0
serviceAccount: integration-tests-sa
19 changes: 15 additions & 4 deletions tests/test-definition.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
---
dimensions: []
dimensions:
- name: openshift
values:
- "false"
tests:
- name: kerberos
dimensions: []
dimensions:
- openshift
# Requires manual connection to an AD cluster
# - name: kerberos-ad
# dimensions: []
- name: listener
dimensions: []
dimensions:
- openshift
- name: tls
dimensions: []
dimensions:
- openshift
suites:
- name: nightly
- name: openshift
patch:
- dimensions:
- name: openshift
expr: "true"