You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
k wait --timeout=5m --for=condition=ready "${node}"
36
56
done
@@ -81,4 +101,53 @@ k() {
81
101
done
82
102
}
83
103
84
-
# TODO: add a test for multi-node
104
+
# bats test_tags=nodes:3
105
+
@test 'Multi-node' {
106
+
# Based on https://github.com/rootless-containers/usernetes/blob/gen2-v20250828.0/hack/test-smoke.sh
107
+
k apply -f - <<EOF
108
+
apiVersion: v1
109
+
kind: Service
110
+
metadata:
111
+
name: dnstest
112
+
labels:
113
+
run: dnstest
114
+
spec:
115
+
type: ClusterIP
116
+
clusterIP: None
117
+
ports:
118
+
- name: http
119
+
protocol: TCP
120
+
port: 80
121
+
targetPort: 80
122
+
selector:
123
+
run: dnstest
124
+
---
125
+
apiVersion: apps/v1
126
+
kind: StatefulSet
127
+
metadata:
128
+
name: dnstest
129
+
spec:
130
+
serviceName: dnstest
131
+
selector:
132
+
matchLabels:
133
+
run: dnstest
134
+
replicas: 3
135
+
template:
136
+
metadata:
137
+
labels:
138
+
run: dnstest
139
+
spec:
140
+
containers:
141
+
- name: dnstest
142
+
image: ${TEST_CONTAINER_IMAGES[nginx]}
143
+
ports:
144
+
- containerPort: 80
145
+
EOF
146
+
k rollout status --timeout=5m statefulset/dnstest || {
147
+
k describe pods -l run=dnstest
148
+
false
149
+
}
150
+
k run --rm --image=${TEST_CONTAINER_IMAGES[nginx]} --restart=Never dnstest-shell -- sh -exc 'for f in $(seq 0 2); do wget -O- http://dnstest-${f}.dnstest.default.svc.cluster.local; done'
0 commit comments