File tree Expand file tree Collapse file tree 1 file changed +72
-10
lines changed Expand file tree Collapse file tree 1 file changed +72
-10
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ kind : ConfigMap
3
+ metadata :
4
+ name : events-topic
5
+ namespace : test-kafka
6
+ apiVersion : v1
7
+ data :
8
+
9
+ setup.sh : |-
10
+ touch /tmp/testlog
11
+
12
+ tail -f /tmp/testlog
13
+
14
+ test.sh : |-
15
+ exec >> /tmp/testlog
16
+ exec 2>&1
17
+
18
+ PREVIOUS=$(sha1sum /tmp/event || echo "")
19
+ kafkacat -b $BOOTSTRAP -t $TOPIC -C -o -1 -c 1 | tee /tmp/event
20
+ CURRENT=$(sha1sum /tmp/event)
21
+ [ "$PREVIOUS" == "$CURRENT" ] && echo "{\"test-status\”: \"No new event in $TOPIC\"}" && exit 1
22
+
23
+ exit 0
24
+
25
+ quit-on-nonzero-exit.sh : |-
26
+ exec >> /tmp/testlog
27
+ exec 2>&1
28
+
29
+ exit 0
30
+
31
+ ---
1
32
apiVersion : apps/v1beta2
2
33
kind : Deployment
3
34
metadata :
4
35
name : events-topic
5
36
namespace : test-kafka
6
37
spec :
7
38
replicas : 1
39
+ strategy :
40
+ type : Recreate
8
41
selector :
9
42
matchLabels :
10
43
test-target : events-topic
44
+ test-type : readiness
11
45
template :
12
46
metadata :
13
47
labels :
14
48
test-target : events-topic
15
- # Would be a valid testcase if it verifies that >0 messages per some time unit have been produced
16
- # test-type: readiness
49
+ test-type : readiness
50
+ # for example:
51
+ # readonly - can be used in production
52
+ # isolated - read/write but in a manner that does not affect other services
53
+ # load - unsuitable for production because it uses significant resources
54
+ # chaos - unsuitable for production because it injects failure modes
55
+ # test-use:
17
56
spec :
18
57
containers :
19
- - name : kafkacat
20
- image : solsson/kafkacat@sha256:36d1f191cc33a8365074280279205e6b4f52cd8cc8fb1b896bb4c943c9dee8f8
58
+ - name : testcase
59
+ image : solsson/kafkacat@sha256:ebebf47061300b14a4b4c2e1e4303ab29f65e4b95d34af1b14bb8f7ec6da7cef
60
+ env :
61
+ - name : BOOTSTRAP
62
+ 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
63
+ - name : TOPIC
64
+ value : ops-kube-events-all-json-001
21
65
command :
22
- - kafkacat
23
- - -b
24
- - kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker.kafka.svc.cluster.local:9092,kafka-2.broker.kafka.svc.cluster.local:9092
25
- - -t
26
- - ops-kube-events-all-json-001
27
- - -C
66
+ - /bin/bash
67
+ - -e
68
+ - /test/setup.sh
69
+ readinessProbe :
70
+ exec :
71
+ command :
72
+ - /bin/bash
73
+ - -e
74
+ - /test/test.sh
75
+ initialDelaySeconds : 10
76
+ periodSeconds : 10
77
+ livenessProbe :
78
+ exec :
79
+ command :
80
+ - /bin/bash
81
+ - -e
82
+ - /test/quit-on-nonzero-exit.sh
83
+ volumeMounts :
84
+ - name : config
85
+ mountPath : /test
86
+ volumes :
87
+ - name : config
88
+ configMap :
89
+ name : events-topic
You can’t perform that action at this time.
0 commit comments