@@ -426,14 +426,16 @@ sed -r "s/[&]* [!] $(CLUSTER_TYPE)|[!] $(CLUSTER_TYPE) [&]*//")) || $(CLUSTER_TY
426
426
# TEST_FILTER := $(shell echo '! aws && ! gcp && ! azure' | sed -r "s/[&]* [!] $(CLUSTER_TYPE)|[!] $(CLUSTER_TYPE) [&]*//")
427
427
SETTINGS_TMP =/tmp/test-settings
428
428
429
+ .PHONY : test-e2e-setup
429
430
test-e2e-setup :
430
431
mkdir -p $(SETTINGS_TMP )
431
432
TARGET_CI_CRED_FILE=" $( CI_CRED_FILE) " AZURE_RESOURCE_FILE=" $( AZURE_RESOURCE_FILE) " CI_JSON_CRED_FILE=" $( AZURE_CI_JSON_CRED_FILE) " \
432
433
OADP_JSON_CRED_FILE=" $( AZURE_OADP_JSON_CRED_FILE) " OADP_CRED_FILE=" $( OADP_CRED_FILE) " OPENSHIFT_CI=" $( OPENSHIFT_CI) " \
433
434
PROVIDER=" $( VELERO_PLUGIN) " BUCKET=" $( OADP_BUCKET) " BSL_REGION=" $( BSL_REGION) " SECRET=" $( CREDS_SECRET_REF) " TMP_DIR=$(SETTINGS_TMP ) \
434
435
VSL_REGION=" $( VSL_REGION) " BSL_AWS_PROFILE=" $( BSL_AWS_PROFILE) " /bin/bash " tests/e2e/scripts/$( CLUSTER_TYPE) _settings.sh"
435
436
436
- test-e2e : test-e2e-setup # # execute the oadp integration tests
437
+ .PHONY : test-e2e-ginkgo
438
+ test-e2e-ginkgo : test-e2e-setup
437
439
ginkgo run -mod=mod tests/e2e/ -- -credentials=$(OADP_CRED_FILE ) \
438
440
-velero_namespace=$(OADP_TEST_NAMESPACE ) \
439
441
-settings=$(SETTINGS_TMP ) /oadpcreds \
@@ -444,7 +446,34 @@ test-e2e: test-e2e-setup ## execute the oadp integration tests
444
446
-provider=$(CLUSTER_TYPE ) \
445
447
-creds_secret_ref=$(CREDS_SECRET_REF ) \
446
448
-artifact_dir=$(ARTIFACT_DIR ) \
447
- -oc_cli=$(OC_CLI )
449
+ -oc_cli=$(OC_CLI ) \
450
+ --ginkgo.timeout=2h
448
451
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
450
457
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
0 commit comments