Skip to content

Commit 7c34bce

Browse files
Merge pull request #226 from cybozu-go/use-wait-for-check-cluster
check cluster condition before run the tests
2 parents a30e478 + be55e48 commit 7c34bce

1 file changed

Lines changed: 3 additions & 22 deletions

File tree

test/e2e/Makefile

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -179,46 +179,27 @@ create-loop-dev:
179179
$(MINIKUBE) ssh -- $(SUDO) $(LOSETUP) $(LOOP_DEV2) $(LOOP_FILE2) || :
180180
$(MINIKUBE) ssh -- lsblk
181181

182-
.PHONY: wait-deploy-ready
183-
wait-deploy-ready: NS=
184-
wait-deploy-ready: DEPLOY=
185-
wait-deploy-ready:
186-
is_ok="false"; \
187-
for ((i=0;i<$(TIMEOUT_SECS);i+=$(POLLING_INTERVAL))); do \
188-
available_replicas=$$($(KUBECTL) -n $(CEPH_CLUSTER1_NAMESPACE) get deploy $(DEPLOY) -o json | jq -r ".status.availableReplicas"); \
189-
if [ "$$available_replicas" = 1 ]; then \
190-
is_ok="true"; \
191-
break; \
192-
fi; \
193-
echo "waiting for deploy $(DEPLOY) to be available" > /dev/stderr; \
194-
sleep $(POLLING_INTERVAL); \
195-
done; \
196-
if [ "$$is_ok" = "false" ]; then \
197-
echo "failed to start deploy $(DEPLOY)" > /dev/stderr; \
198-
exit 1; \
199-
fi
200-
201182
.PHONY: install-rook-ceph-operator
202183
install-rook-ceph-operator:
203184
$(HELM) upgrade --install --version $(ROOK_CHART_VERSION) --repo https://charts.rook.io/release \
204185
--create-namespace --namespace $(CEPH_CLUSTER1_NAMESPACE) -f testdata/values.yaml --wait \
205186
rook-ceph rook-ceph
206-
$(MAKE) wait-deploy-ready NS=$(CEPH_CLUSTER1_NAMESPACE) DEPLOY=rook-ceph-operator
187+
$(KUBECTL) wait --timeout=60s --for=condition=available -n $(CEPH_CLUSTER1_NAMESPACE) deployment/rook-ceph-operator
207188

208189
.PHONY: install-rook-ceph-cluster1
209190
install-rook-ceph-cluster1:
210191
$(HELM) upgrade --install --version $(ROOK_CHART_VERSION) --repo https://charts.rook.io/release \
211192
--namespace $(CEPH_CLUSTER1_NAMESPACE) -f testdata/values-cluster.yaml \
212193
--wait rook-ceph-cluster rook-ceph-cluster
213-
$(MAKE) wait-deploy-ready NS=$(CEPH_CLUSTER1_NAMESPACE) DEPLOY=rook-ceph-osd-0
194+
$(KUBECTL) wait --timeout=300s --for=condition=Ready -n $(CEPH_CLUSTER1_NAMESPACE) cephclusters/rook-ceph
214195

215196
.PHONY: install-rook-ceph-cluster2
216197
install-rook-ceph-cluster2:
217198
$(HELM) upgrade --install --version $(ROOK_CHART_VERSION) --repo https://charts.rook.io/release \
218199
--create-namespace --namespace $(CEPH_CLUSTER2_NAMESPACE) -f testdata/values-cluster.yaml \
219200
--set cephClusterSpec.dataDirHostPath=/var/lib/rook2 \
220201
--wait rook-ceph-cluster2 rook-ceph-cluster
221-
$(MAKE) wait-deploy-ready NS=$(CEPH_CLUSTER2_NAMESPACE) DEPLOY=rook-ceph-osd-0
202+
$(KUBECTL) wait --timeout=300s --for=condition=Ready -n $(CEPH_CLUSTER2_NAMESPACE) cephclusters/rook-ceph2
222203

223204
.PHONY: install-ceph-object-store
224205
install-ceph-object-store:

0 commit comments

Comments
 (0)