Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OADP-694 oadp-1.1: Add data mover to e2e #863

Merged
merged 10 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 32 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,16 @@ sed -r "s/[&]* [!] $(CLUSTER_TYPE)|[!] $(CLUSTER_TYPE) [&]*//")) || $(CLUSTER_TY
#TEST_FILTER := $(shell echo '! aws && ! gcp && ! azure' | sed -r "s/[&]* [!] $(CLUSTER_TYPE)|[!] $(CLUSTER_TYPE) [&]*//")
SETTINGS_TMP=/tmp/test-settings

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

test-e2e: test-e2e-setup
.PHONY: test-e2e-ginkgo
test-e2e-ginkgo: test-e2e-setup
ginkgo run -mod=mod tests/e2e/ -- -credentials=$(OADP_CRED_FILE) \
-velero_namespace=$(OADP_TEST_NAMESPACE) \
-settings=$(SETTINGS_TMP)/oadpcreds \
Expand All @@ -435,7 +437,34 @@ test-e2e: test-e2e-setup
-provider=$(CLUSTER_TYPE) \
-creds_secret_ref=$(CREDS_SECRET_REF) \
-artifact_dir=$(ARTIFACT_DIR) \
-oc_cli=$(OC_CLI)
-oc_cli=$(OC_CLI) \
--ginkgo.timeout=2h

test-e2e-cleanup:
.PHONY: test-e2e
test-e2e: volsync-install test-e2e-ginkgo

.PHONY: test-e2e-cleanup
test-e2e-cleanup: volsync-uninstall
rm -rf $(SETTINGS_TMP)

.PHONY: volsync-install
volsync-install:
$(eval VS_CURRENT_CSV:=$(shell oc get subscription volsync-product -n openshift-operators -ojsonpath='{.status.currentCSV}'))
# OperatorGroup not required, volsync is global operator which has operatorgroup already.
# Create subscription for operator if not installed.
@if [ "$(VS_CURRENT_CSV)" == "" ]; then \
$(OC_CLI) replace --force -f tests/e2e/volsync/volsync-sub.yaml; \
else \
echo $(VS_CURRENT_CSV) already installed; \
fi

.PHONY: volsync-uninstall
volsync-uninstall:
$(eval VS_CURRENT_CSV:=$(shell oc get subscription volsync-product -n openshift-operators -ojsonpath='{.status.currentCSV}'))
@if [ "$(VS_CURRENT_CSV)" != "" ]; then \
echo "Uninstalling $(VS_CURRENT_CSV)"; \
$(OC_CLI) delete subscription volsync-product -n openshift-operators && \
$(OC_CLI) delete csv $(VS_CURRENT_CSV) -n openshift-operators; \
else \
echo No subscription found, skipping uninstall; \
fi
2 changes: 1 addition & 1 deletion build/ci-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ COPY ./ .
RUN go get -d -u github.com/onsi/ginkgo/ginkgo && \
go get -d -u github.com/onsi/ginkgo/v2/ginkgo && \
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@latest
RUN go get github.com/onsi/gomega/...
RUN go get github.com/onsi/gomega@v1.22.1
RUN chmod -R 777 ./
RUN go mod download
28 changes: 16 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/google/uuid v1.2.0
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.1.1
github.com/onsi/gomega v1.17.0
github.com/onsi/ginkgo/v2 v2.4.0
github.com/onsi/gomega v1.22.1
github.com/openshift/api v0.0.0-20210805075156-d8fab4513288
github.com/operator-framework/api v0.10.7
github.com/operator-framework/operator-lib v0.9.0
Expand All @@ -24,10 +24,14 @@ require (
sigs.k8s.io/controller-runtime v0.11.0
)

require github.com/google/go-cmp v0.5.9
require (
github.com/backube/volsync v0.4.0
github.com/google/go-cmp v0.5.9
github.com/konveyor/volume-snapshot-mover v0.0.0-20220725191622-4b360b792c3e
)

require (
cloud.google.com/go v0.93.3 // indirect
cloud.google.com/go v0.99.0 // indirect
github.com/Azure/azure-sdk-for-go v61.4.0+incompatible // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.21 // indirect
Expand Down Expand Up @@ -86,21 +90,21 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2 // indirect
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0 // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/cli-runtime v0.22.2 // indirect
k8s.io/component-base v0.23.0 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
Expand Down