Skip to content

Commit 48bd7c3

Browse files
committed
Now we're on par with the old tests, but automated
1 parent 454bea4 commit 48bd7c3

File tree

7 files changed

+89
-149
lines changed

7 files changed

+89
-149
lines changed

test/11topic-create-test1.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

test/12topic-create-test2.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

test/21consumer-test1.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/31producer-test1.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/99testclient.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/basic-produce-consume.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
kind: ConfigMap
3+
metadata:
4+
name: basic-produce-consume
5+
namespace: test-kafka
6+
apiVersion: v1
7+
data:
8+
9+
setup.sh: |-
10+
touch /tmp/testlog
11+
12+
./bin/kafka-topics.sh --zookeeper $ZOOKEEPER \
13+
--create --if-not-exists --topic test-basic-with-kafkacat \
14+
--partitions 1 --replication-factor 1
15+
16+
# Despite the deprecation warning --zookeeper nothing is consumed when using --bootstrap-server
17+
./bin/kafka-console-consumer.sh --zookeeper $ZOOKEEPER --topic test-basic-produce-consume > /tmp/testconsumed &
18+
19+
tail -f /tmp/testlog
20+
21+
continue.sh: |-
22+
exit 0
23+
24+
run.sh: |-
25+
exec >> /tmp/testlog
26+
exec 2>&1
27+
28+
unique=$(date -Ins)
29+
30+
echo "Test $unique" | ./bin/kafka-console-producer.sh --broker-list $BOOTSTRAP --topic test-basic-produce-consume
31+
echo ""
32+
tail -n 1 /tmp/testconsumed | grep $unique
33+
34+
# How to make this test fail:
35+
#apt-get update && apt-get install -y --no-install-recommends procps
36+
#pkill java
37+
38+
exit 0
39+
40+
---
41+
apiVersion: apps/v1beta1
42+
kind: Deployment
43+
metadata:
44+
name: basic-produce-consume
45+
namespace: test-kafka
46+
spec:
47+
replicas: 1
48+
template:
49+
metadata:
50+
labels:
51+
test-target: kafka
52+
test-type: readiness
53+
spec:
54+
containers:
55+
- name: testcase
56+
image: solsson/kafka:0.11.0.0@sha256:b27560de08d30ebf96d12e74f80afcaca503ad4ca3103e63b1fd43a2e4c976ce
57+
env:
58+
- name: BOOTSTRAP
59+
value: kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker.kafka.svc.cluster.local:9092,kafka-2.broker.kafka.svc.cluster.local:9092
60+
- name: ZOOKEEPER
61+
value: zookeeper.kafka.svc.cluster.local:2181
62+
# Test set up
63+
command:
64+
- /bin/bash
65+
- -e
66+
- /test/setup.sh
67+
# Test run, again and again
68+
readinessProbe:
69+
exec:
70+
command:
71+
- /bin/bash
72+
- -e
73+
- /test/run.sh
74+
# JVM start is slow, can we keep producer started and restore the default preriod 10s?
75+
periodSeconds: 30
76+
# Test quit on nonzero exit
77+
livenessProbe:
78+
exec:
79+
command:
80+
- /bin/bash
81+
- -e
82+
- /test/continue.sh
83+
volumeMounts:
84+
- name: config
85+
mountPath: /test
86+
volumes:
87+
- name: config
88+
configMap:
89+
name: basic-produce-consume

test/test.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)