File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -197,10 +197,13 @@ sshcmd "status" "kubectl get -o wide nodes ; echo ; kubectl --namespace=kube-sys
197
197
198
198
sshcmd "apply app.yaml" "kubectl apply -f /root/app.yaml"
199
199
200
+ await_sshcmd_output "await alpine pod ready" \
201
+ {kubectl get pods --selector=name=alpine -o jsonpath='{.items[*].status.phase}' ; echo} \
202
+ "Running"
200
203
await_sshcmd_output "await nginx pod ready" \
201
204
{kubectl get pods --selector=name=nginx -o jsonpath='{.items[*].status.phase}' ; echo} \
202
205
"Running"
203
- puts "SUCCESS application pod ready"
206
+ puts "SUCCESS application pods ready"
204
207
205
208
sshcmd "status" "kubectl get -o wide nodes ; echo ; kubectl --namespace=kube-system get -o wide pods ; echo ; kubectl --namespace=default get -o wide pods"
206
209
@@ -213,6 +216,25 @@ if [string match "Welcome to nginx!" $curl] {
213
216
}
214
217
puts "SUCCESS nginx responded well"
215
218
219
+ send_sshcmd {kubectl exec $(kubectl get pods -l name==alpine -o=jsonpath='{.items[*].metadata.name}') -- wget -q -O - http://nginx/}
220
+ expect -i $ssh_sid -timeout 10 \
221
+ "Welcome to nginx!" {
222
+ puts "SUCCESS intra-pod networking ok"
223
+ } $ssh_prompt {
224
+ puts "FAIL intra-pod networking (returned to prompt)"
225
+ kill ssh_sid lk_sid
226
+ exit 1
227
+ } timeout {
228
+ puts "FAIL intra-pod networking (timeout)"
229
+ kill ssh_sid lk_sid
230
+ exit 1
231
+ } eof {
232
+ puts "FAIL intra-pod networking (eof)"
233
+ kill ssh_sid lk_sid
234
+ exit 1
235
+ }
236
+ await_ssh_prompt "intra-pod networking"
237
+
216
238
kill ssh_sid
217
239
218
240
puts "RUN poweroff -f"
Original file line number Diff line number Diff line change @@ -47,3 +47,24 @@ files:
47
47
nodePort: 30002
48
48
selector:
49
49
name: nginx
50
+ ---
51
+ apiVersion: extensions/v1beta1
52
+ kind: Deployment
53
+ metadata:
54
+ name: alpine
55
+ labels:
56
+ name: alpine
57
+ namespace: default
58
+ spec:
59
+ replicas: 1
60
+ template:
61
+ metadata:
62
+ labels:
63
+ name: alpine
64
+ spec:
65
+ containers:
66
+ - name: alpine
67
+ image: alpine:3.7
68
+ command: ["/bin/sh", "-c", "while : ; do sleep 1h ; done"]
69
+ nodeSelector:
70
+ beta.kubernetes.io/os: linux
You can’t perform that action at this time.
0 commit comments