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

Update Authorization E2E Scenarios #641

Merged
merged 31 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
46936f7
fix lint
JacobGros Jul 11, 2024
63d3b72
fix lint
JacobGros Jul 11, 2024
038daf5
prevent short circuit
JacobGros Jul 12, 2024
da2bfec
Fix sanity e2e tests
falfaroc Jul 12, 2024
84c1e97
Revert auth storage templates
falfaroc Jul 12, 2024
1d11871
Revert auth storage templates
falfaroc Jul 12, 2024
b69e0b7
Add e2e test (#629)
JacobGros Jul 12, 2024
a3f8b77
Migrate application mobility upgrade to scenarios file
falfaroc Jul 15, 2024
d20cf40
Cages to correct broken authorization e2e for operator
alikdell Jul 15, 2024
55bd383
add script changes
alikdell Jul 15, 2024
634df7c
auth e2e changes for v1 and v2
shaynafinocchiaro Jul 16, 2024
ee3dcb7
use conditional instead of new steps
shaynafinocchiaro Jul 16, 2024
050ea61
v1 changes
shaynafinocchiaro Jul 16, 2024
202b9b8
minor changes
shaynafinocchiaro Jul 16, 2024
27e25e0
add uprade path
shaynafinocchiaro Jul 16, 2024
c373c8c
remove unnecessary steps
shaynafinocchiaro Jul 16, 2024
a57d639
remove steps
shaynafinocchiaro Jul 16, 2024
eea4a72
add support for multiple drivers in a single scenario
shaynafinocchiaro Jul 17, 2024
34ba18f
Changing logs
harshitap26 Jul 17, 2024
0301aa3
add more changes for V2 and multiple drivers
shaynafinocchiaro Jul 17, 2024
0210a35
add new step for deleting CRs and combine resources into one file
shaynafinocchiaro Jul 17, 2024
ab10826
remove duplicate step
shaynafinocchiaro Jul 17, 2024
028da4e
support both drivers on creation and delete for CRs
shaynafinocchiaro Jul 17, 2024
46d1e40
fix tenant name for token
shaynafinocchiaro Jul 18, 2024
d9685f2
update scenarios
shaynafinocchiaro Jul 18, 2024
4f91fe7
Adding Powerscale port
harshitap26 Jul 18, 2024
edb67d8
only support powerflex for V2
shaynafinocchiaro Jul 18, 2024
74972ed
update readme
shaynafinocchiaro Jul 18, 2024
18613f3
move scenario
shaynafinocchiaro Jul 18, 2024
2b7a168
update note
shaynafinocchiaro Jul 18, 2024
04cf8d1
Merge branch 'main' into auth-e2e
shaynafinocchiaro Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading