Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cupnes committed Mar 13, 2024
1 parent baae96c commit bc9e7e6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
17 changes: 17 additions & 0 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ GINKGO_FLAGS :=
MINIKUBE := $(BINDIR)/minikube
KUBECTL := $(BINDIR)/kubectl-$(KUBERNETES_VERSION)
MINIKUBE_HOME = $(BINDIR)
NS := rook-ceph
NODE_NAME := minikube-worker
SUDO := sudo
DD := dd
Expand All @@ -20,6 +21,8 @@ LOOP_DEV := $(shell loop_dev=$$($(LOSETUP) | grep $(LOOP_FILE) | cut -d ' ' -f 1
echo $$loop_dev; \
fi)
CNI_PLUGIN_INSTALL_DIR := /opt/cni/bin
POLLING_INTERVAL := 1
TIMEOUT := 180

export MINIKUBE_HOME

Expand Down Expand Up @@ -122,6 +125,20 @@ launch-rook-ceph: create-loop-dev
sed -e "s%LOOP_DEV%$(LOOP_DEV)%" -e "s%NODE_NAME%$(NODE_NAME)%" testdata/cluster-template.yaml > testdata/cluster.yaml
$(KUBECTL) apply -f testdata/cluster.yaml
$(KUBECTL) apply -f testdata/toolbox.yaml
is_ok="false"; \
for i in $(shell seq $(TIMEOUT)); do \
available_replicas=$$($(KUBECTL) -n $(NS) get deploy rook-ceph-operator -o json | jq -r ".status.availableReplicas"); \
if [ $$available_replicas -eq 1 ]; then \
is_ok="true"; \
break; \
fi; \
echo "rook operator is not available yet" > /dev/stderr; \
sleep $(POLLING_INTERVAL); \
done; \
if [ "$$is_ok" = "false" ]; then \
echo "failed to start rook operator" > /dev/stderr; \
exit 1; \
fi

.PHONY: delete-rook-ceph
delete-rook-ceph:
Expand Down
20 changes: 0 additions & 20 deletions e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,6 @@ func TestMtest(t *testing.T) {
}

var _ = BeforeSuite(func() {
By("[BeforeSuite] Waiting for rook to get ready")
Eventually(func() error {
stdout, stderr, err := kubectl("-n", namespace, "get", "deploy", "rook-ceph-operator", "-o", "json")
if err != nil {
return fmt.Errorf("kubectl get deploy failed. stderr: %s, err: %w", string(stderr), err)
}

var deploy appsv1.Deployment
err = yaml.Unmarshal(stdout, &deploy)
if err != nil {
return err
}

if deploy.Status.AvailableReplicas != 1 {
return fmt.Errorf("rook operator is not available yet")
}

return nil
}).Should(Succeed())

By("[BeforeSuite] Waiting for ceph cluster to get ready")
Eventually(func() error {
stdout, stderr, err := kubectl("-n", namespace, "get", "deploy", "rook-ceph-osd-0", "-o", "json")
Expand Down

0 comments on commit bc9e7e6

Please sign in to comment.