Skip to content

Commit

Permalink
Update Authorization E2E Scenarios (#641)
Browse files Browse the repository at this point in the history
* fix lint

* fix lint

* prevent short circuit

* Fix sanity e2e tests

* Revert auth storage templates

* Revert auth storage templates

* Add e2e test (#629)

* add e2e test for defect fix

* fix upgrade

* fix upgrade

* add downgrade test

* fix title

* Migrate application mobility upgrade to scenarios file

* Cages to correct broken authorization e2e for operator

* add script changes

* auth e2e changes for v1 and v2

* use conditional instead of new steps

* v1 changes

* minor changes

* add uprade path

* remove unnecessary steps

* remove steps

* add support for multiple drivers in a single scenario

* Changing logs

* add more changes for V2 and multiple drivers

* add new step for deleting CRs and combine resources into one file

* remove duplicate step

* support both drivers on creation and delete for CRs

* fix tenant name for token

* update scenarios

* Adding Powerscale port

* only support powerflex for V2

* update readme

* move scenario

* update note

---------

Co-authored-by: JacobGros <jacobgrosner4@gmail.com>
Co-authored-by: Fernando Alfaro Campos <Fernando.Alfaro_campos@Dell.com>
Co-authored-by: Alik Saring <alik.saring@dell.com>
Co-authored-by: Harshita Pandey <Harshita_Pandey@dell.com>
  • Loading branch information
5 people authored Jul 18, 2024
1 parent 34bff2f commit 1f2e9d4
Show file tree
Hide file tree
Showing 18 changed files with 590 additions and 311 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ run: generate gen-semver fmt vet static-manifests ## Run a controller from your
podman-build: gen-semver build-base-image ## Build podman image with the manager.
podman build . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

podman-push: podman-build ## Builds, tags and pushes docker image with the manager.
podman tag ${DEFAULT_IMG} ${IMG}
podman push ${IMG}

docker-build: gen-semver build-base-image ## Build docker image with the manager.
docker build . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

Expand Down
64 changes: 32 additions & 32 deletions deploy/crds/storage.dell.com.crds.all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: apexconnectivityclients.storage.dell.com
spec:
group: storage.dell.com
Expand Down Expand Up @@ -73,9 +73,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -85,6 +82,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -405,9 +405,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -417,6 +414,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -726,9 +726,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -738,6 +735,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -1063,7 +1063,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: containerstoragemodules.storage.dell.com
spec:
group: storage.dell.com
Expand Down Expand Up @@ -1137,9 +1137,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -1149,6 +1146,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -1458,9 +1458,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -1470,6 +1467,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -1798,9 +1798,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -1810,6 +1807,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -2117,9 +2117,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -2129,6 +2126,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -2441,9 +2441,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -2453,6 +2450,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -2786,9 +2786,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -2798,6 +2795,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down Expand Up @@ -3116,9 +3116,6 @@ spec:
authorizationControllerReplicas:
description: AuthorizationControllerReplicas is the number of replicas for the authorization controller deployment
type: integer
controllerReconcileInterval:
description: ControllerReconcileInterval is the interval which the reconcile of each controller is run.
type: string
certificate:
description: Certificate is a certificate used for a certificate/private-key pair
type: string
Expand All @@ -3128,6 +3125,9 @@ spec:
commander:
description: Commander is the image tag for the Container
type: string
controllerReconcileInterval:
description: The interval which the reconcile of each controller is run
type: string
credentials:
description: ComponentCred is to store the velero credential contents
items:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
minUpgradePath: v1.8.0
40 changes: 29 additions & 11 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ This directory contains the testing infrastructure and E2E test implementation f

## Table of Contents

* [Unit Tests](#unit-tests)
* [E2E Tests](#e2e-tests)
* [Prerequisites](#prerequisites)
* [Application Mobility Prerequisites](#application-mobility-prerequisites)
* [Run](#run)
* [Scenarios File](#scenarios-file)
* [Developing E2E Tests](#developing-e2e-tests)
* [Directory Layout](#directory-layout)
- [Testing for the CSM Operator](#testing-for-the-csm-operator)
- [Table of Contents](#table-of-contents)
- [Unit Tests](#unit-tests)
- [E2E Tests](#e2e-tests)
- [Prerequisites](#prerequisites)
- [Array Information](#array-information)
- [Application Mobility Prerequisites](#application-mobility-prerequisites)
- [Authorization Proxy Server Prerequisites](#authorization-proxy-server-prerequisites)
- [Run](#run)
- [Scenarios File](#scenarios-file)
- [Developing E2E Tests](#developing-e2e-tests)
- [Directory Layout](#directory-layout)

## Unit Tests

Expand Down Expand Up @@ -61,14 +65,26 @@ If running the Application Mobility e2e tests, (the sanity suite includes a few
- have the latest Application Mobility controller and plugin images
The application-mobility repo has information on all of these pre-requisites up, including a script to install minio.

### Authorization Proxy Server Prerequisites

If running the Authorization proxy server e2e tests, further setup must be done:

- have a vault server running configured with the authorization namespace. This is documented in the CSM documentation.
- update V2 CRs with vault address.

Notes:
- Authorization V1 scenarios support PowerFlex and PowerScale
- Authorization V2 scenarios only support PowerFlex
- Upgrade from Authorization V1 to V2 is not supported. Only V1 to other V1 versions is allowed.

## Run

The tests are run by the `run-e2e-test.sh` script in the `tests/e2e` directory.

- Ensure you meet all [prerequisites](https://github.com/dell/csm-operator/blob/main/tests/README.md#prerequisites).
- Change to the `tests/e2e` directory.
- Set your array information in the `array-info.sh` file.
- If you do not have `cert-csi`, `karavictl`, and (for app-mobility) `dellctl` accessible through your `PATH` variable, pass the path to each executable to the script, like so, `run-e2e-test.sh --cert-csi=/path/to/cert-csi --karavictl=/path/to/karavictl`, and they will be added to `/usr/local/bin`
- If you do not have `cert-csi`, `karavictl`, and (for app-mobility and authorization proxy server) `dellctl` accessible through your `PATH` variable, pass the path to each executable to the script, like so, `run-e2e-test.sh --cert-csi=/path/to/cert-csi --karavictl=/path/to/karavictl`, and they will be added to `/usr/local/bin`
- Decide on the test suites you want to run, based on the changes made. Available test suites can be seen by running `run-e2e-test.sh -h` If multiple suites are specified, the union (not intersection) of those suites will be run.
- Run the e2e tests by executing the `run-e2e-test.sh` script with desired options. Three examples are provided:

Expand Down Expand Up @@ -135,6 +151,8 @@ Each test has:

Most steps to cover common use cases already have their respective backend implementations. Sometimes we run into a situation where we may need to add a new step. For the sake of illustration, please follow the constraints and steps below to add a new test scenario called `"Install PowerHello Driver(With a module called World)"` to excerpt of yaml file shown above.

Note: Please be mindful when updating upgrade scenarios for Authorization Proxy Server. We do not support upgrade from V1 to V2 versions.

- Add the new test scenario to the existing values file

```yaml
Expand All @@ -153,7 +171,7 @@ Most steps to cover common use cases already have their respective backend imple
# name of custom test to run
name: Cert CSI
# Provide command-line argument to run. Ginkgo will run the command and return output
# The command should be accessible from e2e test repo.
# The command should be accessible from e2e test repo.
# Example:
# ./hello_world.sh
# cert-csi test vio --sc <storage class> --chainNumber 2 --chainLength 2
Expand Down Expand Up @@ -198,7 +216,7 @@ Most steps to cover common use cases already have their respective backend imple
}
/*
Takes four more arguments for each group as defined here "Validate it is [raining], [snowing], [sunny], and [pay-day]".
Takes four more arguments for each group as defined here "Validate it is [raining], [snowing], [sunny], and [pay-day]".
Thus function wll be automatically called with:
checkWeather(Resource{}, "raining", "snowing", "sunny", "pay-day")
Please see "Validate [powerhello] driver is installed" step and the function signature that implemented it
Expand Down
Loading

0 comments on commit 1f2e9d4

Please sign in to comment.