Skip to content

Commit 166e5a1

Browse files
hhpatel14kaovilai
andauthored
master: Add data mover to e2e cherrypick of #863 (#955)
* master: Add data mover to e2e cherrypick of #863 Co-authored-by: Tiger Kaovilai <[email protected]> * workaround to fix existing PVC of the same name found.. Signed-off-by: Tiger Kaovilai <[email protected]> * 1.2 update * add restorePhase async plugin waiting phases Signed-off-by: Tiger Kaovilai <[email protected]> * Remove duplicate application installs, add CSIDataMover failure deletion handling, volsync channel stable-0.7 Signed-off-by: Tiger Kaovilai <[email protected]> * Create app, and therefore namespace, before creating PVC into namespace Signed-off-by: Tiger Kaovilai <[email protected]> * FEntry typo Signed-off-by: Tiger Kaovilai <[email protected]> * enable volsync MoverSecurityContext Signed-off-by: Tiger Kaovilai <[email protected]> * Update mysql/mariadb pod securityContext to match Dockerfile USER for volsync to pick up. Signed-off-by: Tiger Kaovilai <[email protected]> * add vsmv1alpha1 to client scheme for failure cleanup Signed-off-by: Tiger Kaovilai <[email protected]> --------- Signed-off-by: Tiger Kaovilai <[email protected]> Co-authored-by: Tiger Kaovilai <[email protected]> Co-authored-by: Tiger Kaovilai <[email protected]>
1 parent d24fc50 commit 166e5a1

16 files changed

+475
-110
lines changed

Makefile

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,16 @@ sed -r "s/[&]* [!] $(CLUSTER_TYPE)|[!] $(CLUSTER_TYPE) [&]*//")) || $(CLUSTER_TY
426426
#TEST_FILTER := $(shell echo '! aws && ! gcp && ! azure' | sed -r "s/[&]* [!] $(CLUSTER_TYPE)|[!] $(CLUSTER_TYPE) [&]*//")
427427
SETTINGS_TMP=/tmp/test-settings
428428

429+
.PHONY: test-e2e-setup
429430
test-e2e-setup:
430431
mkdir -p $(SETTINGS_TMP)
431432
TARGET_CI_CRED_FILE="$(CI_CRED_FILE)" AZURE_RESOURCE_FILE="$(AZURE_RESOURCE_FILE)" CI_JSON_CRED_FILE="$(AZURE_CI_JSON_CRED_FILE)" \
432433
OADP_JSON_CRED_FILE="$(AZURE_OADP_JSON_CRED_FILE)" OADP_CRED_FILE="$(OADP_CRED_FILE)" OPENSHIFT_CI="$(OPENSHIFT_CI)" \
433434
PROVIDER="$(VELERO_PLUGIN)" BUCKET="$(OADP_BUCKET)" BSL_REGION="$(BSL_REGION)" SECRET="$(CREDS_SECRET_REF)" TMP_DIR=$(SETTINGS_TMP) \
434435
VSL_REGION="$(VSL_REGION)" BSL_AWS_PROFILE="$(BSL_AWS_PROFILE)" /bin/bash "tests/e2e/scripts/$(CLUSTER_TYPE)_settings.sh"
435436

436-
test-e2e: test-e2e-setup ## execute the oadp integration tests
437+
.PHONY: test-e2e-ginkgo
438+
test-e2e-ginkgo: test-e2e-setup
437439
ginkgo run -mod=mod tests/e2e/ -- -credentials=$(OADP_CRED_FILE) \
438440
-velero_namespace=$(OADP_TEST_NAMESPACE) \
439441
-settings=$(SETTINGS_TMP)/oadpcreds \
@@ -444,7 +446,34 @@ test-e2e: test-e2e-setup ## execute the oadp integration tests
444446
-provider=$(CLUSTER_TYPE) \
445447
-creds_secret_ref=$(CREDS_SECRET_REF) \
446448
-artifact_dir=$(ARTIFACT_DIR) \
447-
-oc_cli=$(OC_CLI)
449+
-oc_cli=$(OC_CLI) \
450+
--ginkgo.timeout=2h
448451

449-
test-e2e-cleanup:
452+
.PHONY: test-e2e
453+
test-e2e: volsync-install test-e2e-ginkgo
454+
455+
.PHONY: test-e2e-cleanup
456+
test-e2e-cleanup: volsync-uninstall
450457
rm -rf $(SETTINGS_TMP)
458+
459+
.PHONY: volsync-install
460+
volsync-install:
461+
$(eval VS_CURRENT_CSV:=$(shell oc get subscription volsync-product -n openshift-operators -ojsonpath='{.status.currentCSV}'))
462+
# OperatorGroup not required, volsync is global operator which has operatorgroup already.
463+
# Create subscription for operator if not installed.
464+
@if [ "$(VS_CURRENT_CSV)" == "" ]; then \
465+
$(OC_CLI) replace --force -f tests/e2e/volsync/volsync-sub.yaml; \
466+
else \
467+
echo $(VS_CURRENT_CSV) already installed; \
468+
fi
469+
470+
.PHONY: volsync-uninstall
471+
volsync-uninstall:
472+
$(eval VS_CURRENT_CSV:=$(shell oc get subscription volsync-product -n openshift-operators -ojsonpath='{.status.currentCSV}'))
473+
@if [ "$(VS_CURRENT_CSV)" != "" ]; then \
474+
echo "Uninstalling $(VS_CURRENT_CSV)"; \
475+
$(OC_CLI) delete subscription volsync-product -n openshift-operators && \
476+
$(OC_CLI) delete csv $(VS_CURRENT_CSV) -n openshift-operators; \
477+
else \
478+
echo No subscription found, skipping uninstall; \
479+
fi

build/ci-Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ COPY ./ .
88
RUN go get -d -u github.com/onsi/ginkgo/ginkgo && \
99
go get -d -u github.com/onsi/ginkgo/v2/ginkgo && \
1010
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@latest
11-
# pin v1.22 as latest requires go 1.18
12-
RUN go get -d -u github.com/onsi/[email protected]
11+
RUN go get github.com/onsi/[email protected]
1312
RUN chmod -R 777 ./
1413
RUN chmod -R 777 /go/
1514
RUN go mod download

go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ require (
2424
sigs.k8s.io/controller-runtime v0.12.2
2525
)
2626

27-
require github.com/google/go-cmp v0.5.9
27+
require (
28+
github.com/backube/volsync v0.4.0
29+
github.com/google/go-cmp v0.5.9
30+
github.com/konveyor/volume-snapshot-mover v0.0.0-20220725191622-4b360b792c3e
31+
)
2832

2933
require (
3034
cloud.google.com/go v0.100.2 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:l
142142
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
143143
github.com/aws/aws-sdk-go v1.43.31 h1:yJZIr8nMV1hXjAvvOLUFqZRJcHV7udPQBfhJqawDzI0=
144144
github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
145+
github.com/backube/volsync v0.4.0 h1:hyZgzCrDm0O40CeyU7cCZ3nzTvPZvN1lAyuHyUHRNNw=
146+
github.com/backube/volsync v0.4.0/go.mod h1:F5RD2AxYwORN2TdgylgDL2gOE4ra6vESWA30LTPHO+Q=
145147
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
146148
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
147149
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
@@ -557,6 +559,8 @@ github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE
557559
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
558560
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
559561
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
562+
github.com/konveyor/volume-snapshot-mover v0.0.0-20220725191622-4b360b792c3e h1:DGsRtnWzUM30smT5qBoglDGZAw4/A1GUm8cpvjrBwc4=
563+
github.com/konveyor/volume-snapshot-mover v0.0.0-20220725191622-4b360b792c3e/go.mod h1:ykj3RTgJyA5tsL2n4fRlk1LS2ln7wluHsryE+lMussY=
560564
github.com/kopia/kopia v0.10.7 h1:6s0ZIZW3Ge2ozzefddASy7CIUadp/5tF9yCDKQfAKKI=
561565
github.com/kopia/kopia v0.10.7/go.mod h1:0d9THPD+jwomPcXvPbCdmLyX6phQVP7AqcCcDEajfNA=
562566
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=

0 commit comments

Comments
 (0)