Skip to content

Commit b7d9738

Browse files
committed
kraftify smoke test
1 parent 03bcb41 commit b7d9738

5 files changed

Lines changed: 74 additions & 4 deletions

File tree

tests/templates/kuttl/smoke/20-assert.yaml renamed to tests/templates/kuttl/smoke/20-assert.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% if test_scenario['values']['use-kraft-controller'] == 'false' %}
12
---
23
apiVersion: kuttl.dev/v1beta1
34
kind: TestAssert
@@ -10,3 +11,4 @@ metadata:
1011
status:
1112
readyReplicas: 1
1213
replicas: 1
14+
{% endif %}

tests/templates/kuttl/smoke/20-install-zk.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% if test_scenario['values']['use-kraft-controller'] == 'false' %}
12
---
23
apiVersion: zookeeper.stackable.tech/v1alpha1
34
kind: ZookeeperCluster
@@ -18,3 +19,4 @@ spec:
1819
roleGroups:
1920
default:
2021
replicas: 1
22+
{% endif %}

tests/templates/kuttl/smoke/30-assert.yaml.j2

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ spec:
1515
resources:
1616
limits:
1717
cpu: 1100m # From podOverrides
18-
memory: 1Gi
18+
memory: 2Gi
1919
requests:
2020
cpu: 300m # From podOverrides
21-
memory: 1Gi
21+
memory: 2Gi
2222
- name: kcat-prober
2323
resources:
2424
limits:
@@ -86,3 +86,55 @@ status:
8686
expectedPods: 1
8787
currentHealthy: 1
8888
disruptionsAllowed: 1
89+
{% if test_scenario['values']['use-kraft-controller'] == 'true' %}
90+
---
91+
apiVersion: apps/v1
92+
kind: StatefulSet
93+
metadata:
94+
name: test-kafka-controller-default
95+
status:
96+
readyReplicas: 3
97+
replicas: 3
98+
---
99+
apiVersion: v1
100+
kind: PersistentVolumeClaim
101+
metadata:
102+
name: log-dirs-test-kafka-controller-default-0
103+
spec:
104+
resources:
105+
requests:
106+
storage: 2Gi
107+
status:
108+
phase: Bound
109+
---
110+
apiVersion: v1
111+
kind: PersistentVolumeClaim
112+
metadata:
113+
name: log-dirs-test-kafka-controller-default-1
114+
spec:
115+
resources:
116+
requests:
117+
storage: 2Gi
118+
status:
119+
phase: Bound
120+
---
121+
apiVersion: v1
122+
kind: PersistentVolumeClaim
123+
metadata:
124+
name: log-dirs-test-kafka-controller-default-2
125+
spec:
126+
resources:
127+
requests:
128+
storage: 2Gi
129+
status:
130+
phase: Bound
131+
---
132+
apiVersion: policy/v1
133+
kind: PodDisruptionBudget
134+
metadata:
135+
name: test-kafka-controller
136+
status:
137+
expectedPods: 3
138+
currentHealthy: 3
139+
disruptionsAllowed: 1
140+
{% endif %}

tests/templates/kuttl/smoke/30-install-kafka.yaml.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,21 @@ spec:
2626
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
2727
vectorAggregatorConfigMapName: vector-aggregator-discovery
2828
{% endif %}
29+
{% if test_scenario['values']['use-kraft-controller'] == 'false' %}
2930
zookeeperConfigMapName: test-zk
31+
{% else %}
32+
controllers:
33+
envOverrides:
34+
COMMON_VAR: role-value # overridden by role group below
35+
ROLE_VAR: role-value # only defined here at role level
36+
config:
37+
logging:
38+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
39+
requestedSecretLifetime: 7d
40+
roleGroups:
41+
default:
42+
replicas: 3
43+
{% endif %}
3044
brokers:
3145
configOverrides:
3246
broker.properties:

tests/templates/kuttl/smoke/test_heap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22
# Usage: test_heap.sh
33

4-
# 1Gi * 0.8 -> 819
5-
EXPECTED_HEAP="-Xmx819m -Xms819m"
4+
# 2Gi * 0.8 -> 1638
5+
EXPECTED_HEAP="-Xmx1638m -Xms1638m"
66

77
# Check if ZK_SERVER_HEAP is set to the correct calculated value
88
if [[ $KAFKA_HEAP_OPTS == "$EXPECTED_HEAP" ]]

0 commit comments

Comments
 (0)