@@ -425,14 +425,16 @@ sed -r "s/[&]* [!] $(CLUSTER_TYPE)|[!] $(CLUSTER_TYPE) [&]*//")) || $(CLUSTER_TY
425
425
# TEST_FILTER := $(shell echo '! aws && ! gcp && ! azure' | sed -r "s/[&]* [!] $(CLUSTER_TYPE)|[!] $(CLUSTER_TYPE) [&]*//")
426
426
SETTINGS_TMP =/tmp/test-settings
427
427
428
+ .PHONY : test-e2e-setup
428
429
test-e2e-setup :
429
430
mkdir -p $(SETTINGS_TMP )
430
431
TARGET_CI_CRED_FILE=" $( CI_CRED_FILE) " AZURE_RESOURCE_FILE=" $( AZURE_RESOURCE_FILE) " CI_JSON_CRED_FILE=" $( AZURE_CI_JSON_CRED_FILE) " \
431
432
OADP_JSON_CRED_FILE=" $( AZURE_OADP_JSON_CRED_FILE) " OADP_CRED_FILE=" $( OADP_CRED_FILE) " OPENSHIFT_CI=" $( OPENSHIFT_CI) " \
432
433
PROVIDER=" $( VELERO_PLUGIN) " BUCKET=" $( OADP_BUCKET) " BSL_REGION=" $( BSL_REGION) " SECRET=" $( CREDS_SECRET_REF) " TMP_DIR=$(SETTINGS_TMP ) \
433
434
VSL_REGION=" $( VSL_REGION) " BSL_AWS_PROFILE=" $( BSL_AWS_PROFILE) " /bin/bash " tests/e2e/scripts/$( CLUSTER_TYPE) _settings.sh"
434
435
435
- test-e2e : test-e2e-setup # # execute the oadp integration tests
436
+ .PHONY : test-e2e-ginkgo
437
+ test-e2e-ginkgo : test-e2e-setup
436
438
ginkgo run -mod=mod tests/e2e/ -- -credentials=$(OADP_CRED_FILE ) \
437
439
-velero_namespace=$(OADP_TEST_NAMESPACE ) \
438
440
-settings=$(SETTINGS_TMP ) /oadpcreds \
@@ -443,7 +445,34 @@ test-e2e: test-e2e-setup ## execute the oadp integration tests
443
445
-provider=$(CLUSTER_TYPE ) \
444
446
-creds_secret_ref=$(CREDS_SECRET_REF ) \
445
447
-artifact_dir=$(ARTIFACT_DIR ) \
446
- -oc_cli=$(OC_CLI )
448
+ -oc_cli=$(OC_CLI ) \
449
+ --ginkgo.timeout=2h
447
450
448
- test-e2e-cleanup :
451
+ .PHONY : test-e2e
452
+ test-e2e : volsync-install test-e2e-ginkgo
453
+
454
+ .PHONY : test-e2e-cleanup
455
+ test-e2e-cleanup : volsync-uninstall
449
456
rm -rf $(SETTINGS_TMP )
457
+
458
+ .PHONY : volsync-install
459
+ volsync-install :
460
+ $(eval VS_CURRENT_CSV:=$(shell oc get subscription volsync-product -n openshift-operators -ojsonpath='{.status.currentCSV}') )
461
+ # OperatorGroup not required, volsync is global operator which has operatorgroup already.
462
+ # Create subscription for operator if not installed.
463
+ @if [ " $( VS_CURRENT_CSV) " == " " ]; then \
464
+ $(OC_CLI ) replace --force -f tests/e2e/volsync/volsync-sub.yaml; \
465
+ else \
466
+ echo $(VS_CURRENT_CSV ) already installed; \
467
+ fi
468
+
469
+ .PHONY : volsync-uninstall
470
+ volsync-uninstall :
471
+ $(eval VS_CURRENT_CSV:=$(shell oc get subscription volsync-product -n openshift-operators -ojsonpath='{.status.currentCSV}') )
472
+ @if [ " $( VS_CURRENT_CSV) " != " " ]; then \
473
+ echo " Uninstalling $( VS_CURRENT_CSV) " ; \
474
+ $(OC_CLI ) delete subscription volsync-product -n openshift-operators && \
475
+ $(OC_CLI ) delete csv $(VS_CURRENT_CSV ) -n openshift-operators; \
476
+ else \
477
+ echo No subscription found, skipping uninstall; \
478
+ fi
0 commit comments