├── .github ├── CODEOWNERS ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── common-workflows.yaml │ ├── go-version.yaml │ ├── image-version-update.yaml │ ├── release.yaml │ ├── update-libraries-to-commits.yaml │ └── update-libraries.yaml ├── .gitignore ├── .travis.yml ├── Dockerfile ├── Gopkg.toml ├── LICENSE ├── Makefile ├── OWNERS ├── README.md ├── core ├── .gitignore ├── core.go ├── core_test.go ├── semver.tpl └── semver │ ├── semver.go │ └── semver_test.go ├── csc.sanity ├── csi-vxflexos.sh ├── dell-csi-helm-installer ├── .gitignore ├── README.md ├── common.sh ├── csi-install.sh ├── csi-offline-bundle.md ├── csi-offline-bundle.sh ├── csi-uninstall.sh ├── install-csi-vxflexos.sh ├── verify-csi-vxflexos.sh └── verify.sh ├── docker.mk ├── env.sh ├── go.mod ├── go.sum ├── k8sutils ├── k8sutils.go └── k8sutils_test.go ├── licenses └── LICENSE ├── main.go ├── main_test.go ├── overrides.mk ├── plugin.go ├── provider ├── provider.go └── provider_test.go ├── samples ├── secret.yaml ├── secret │ └── karavi-authorization-config.json ├── storageclass │ ├── powerflex-replication.yaml │ ├── storageclass-az.yaml │ ├── storageclass-nfs.yaml │ ├── storageclass-xfs.yaml │ └── storageclass.yaml └── volumesnapshotclass │ └── snapclass-v1.yaml ├── scripts ├── build_ubi_micro.sh ├── check.sh └── get_vxflexos_info.sh ├── service ├── controller.go ├── controller_test.go ├── controller_test.gox ├── csi_extension_server.go ├── envvars.go ├── ephemeral.go ├── features │ ├── array-config │ │ ├── config │ │ ├── config.2 │ │ ├── duplicate_system_ID │ │ ├── empty │ │ ├── invalid_endpoint │ │ ├── invalid_multi_az │ │ ├── invalid_password │ │ ├── invalid_system_name │ │ ├── invalid_username │ │ ├── multi_az │ │ ├── multi_az_custom_labels │ │ ├── replication-config │ │ ├── simple-config.yaml │ │ ├── two_default_array │ │ ├── unable_to_parse │ │ └── zero_length │ ├── authorization_failure.json │ ├── bad_system.json │ ├── controller_publish_unpublish.feature │ ├── create_snapshot.json │ ├── create_snapshot2.json │ ├── csi_extension.feature │ ├── delete_volume.feature │ ├── driver-config │ │ ├── logConfig.yaml │ │ ├── logConfig2.yaml │ │ └── logConfigWrong.yaml │ ├── ephemeral.feature │ ├── filesystem.json.template │ ├── get_file_interface.json │ ├── get_file_system_response.json │ ├── get_nas_server_id.json │ ├── get_nas_servers.json │ ├── get_peer_mdms.json │ ├── get_primary_system_instance.json │ ├── get_sdc_instances.json │ ├── get_sdc_instances.json.template │ ├── get_storage_pool_instances.json │ ├── get_storage_pool_statistics.json │ ├── get_system_instances.json │ ├── get_system_limits.json │ ├── get_system_statistics.json │ ├── get_volume_statistics.json │ ├── list_volumes.feature │ ├── nfsexport.json.template │ ├── node_publish_unpublish.feature │ ├── replication.feature │ ├── replication_consistency_group.template │ ├── replication_pair.template │ ├── service.feature │ ├── treequota.json.template │ └── volume.json.template ├── identity.go ├── identity_test.gox ├── mount.go ├── node.go ├── preinit.go ├── preinit_test.go ├── replication.go ├── service.go ├── service_test.go ├── service_unit_test.go ├── step_defs_test.go └── step_handlers_test.go └── test ├── Makefile ├── certification ├── README.md ├── ocp-manifest.yaml ├── run.sh └── upstream-manifest.yaml ├── e2e-fsgroup ├── Makefile ├── README.md ├── e2e-values.yaml ├── fs.go ├── fs_ephemeral.go ├── fs_scaleup_scaledown.go ├── go.mod ├── go.sum ├── run.sh ├── suite_test.go ├── testing-manifests │ ├── pod │ │ └── ephemeral.yaml │ └── statefulset │ │ └── statefulset.yaml └── utils.go ├── e2e ├── README.md ├── e2e.go ├── e2e_test.go ├── features │ └── e2e.feature └── templates │ └── zone-wait │ ├── clone.yaml │ ├── snapshot.yaml │ └── sts.yaml ├── helm ├── 10vols │ ├── Chart.yaml │ └── templates │ │ ├── pvc.yaml │ │ └── test.yaml ├── 1vol-nfs │ ├── Chart.yaml │ └── templates │ │ ├── pvc0.yaml │ │ └── test.yaml ├── 1vols+restore-nfs │ ├── Chart.yaml │ └── templates │ │ ├── createFromSnap.yaml │ │ └── test.yaml ├── 2vols+clone │ ├── Chart.yaml │ └── templates │ │ ├── createFromVolume.yaml │ │ ├── pvc0.yaml │ │ ├── pvc1.yaml │ │ └── test.yaml ├── 2vols+restore │ ├── Chart.yaml │ └── templates │ │ ├── createFromSnap.yaml │ │ ├── pvc0.yaml │ │ ├── pvc1.yaml │ │ └── test.yaml ├── 2vols-multi-array │ ├── Chart.yaml │ └── templates │ │ ├── pvc0.yaml │ │ ├── pvc1.yaml │ │ └── test.yaml ├── 2vols │ ├── Chart.yaml │ └── templates │ │ ├── pvc0.yaml │ │ ├── pvc1.yaml │ │ └── test.yaml ├── 3vols-nfs │ ├── Chart.yaml │ └── templates │ │ ├── pvc.yaml │ │ └── test.yaml ├── 5vols-nfs │ ├── Chart.yaml │ └── templates │ │ ├── pvc.yaml │ │ └── test.yaml ├── 7vols │ ├── Chart.yaml │ └── templates │ │ ├── pvc.yaml │ │ └── test.yaml ├── README.md ├── block │ ├── block-rwx │ │ ├── Chart.yaml │ │ ├── templates │ │ │ └── test.yaml │ │ └── values.yaml │ ├── block1 │ │ ├── Chart.yaml │ │ ├── templates │ │ │ └── test.yaml │ │ └── values.yaml │ └── block2 │ │ ├── Chart.yaml │ │ ├── templates │ │ └── test.yaml │ │ └── values.yaml ├── blocksnap │ ├── 1snap │ │ ├── Chart.yaml │ │ └── templates │ │ │ └── snap1.yaml │ ├── 1vol │ │ ├── Chart.yaml │ │ └── templates │ │ │ └── test.yaml │ ├── 1volfromsnap │ │ ├── Chart.yaml │ │ └── templates │ │ │ └── test.yaml │ ├── README.md │ └── run.sh ├── common.bash ├── deletepvcs.sh ├── ephemeral │ ├── sample.yaml │ └── testEphemeral.sh ├── get.volume.ids ├── helm.lint.sh ├── logit.sh ├── mount │ ├── Chart.yaml │ └── templates │ │ ├── containers.yaml │ │ └── test.yaml ├── scale │ ├── 10replicas │ │ ├── Chart.yaml │ │ ├── templates │ │ │ └── test.yaml │ │ └── values.yaml │ ├── 2replicas │ │ ├── Chart.yaml │ │ └── templates │ │ │ └── test.yaml │ ├── 50replicas │ │ ├── Chart.yaml │ │ ├── templates │ │ │ └── test.yaml │ │ └── values.yaml │ ├── longevity.sh │ ├── rescaletest.sh │ ├── results │ │ ├── v1.0.0-15pods │ │ ├── v1.0.0-15pods-times │ │ ├── v1.0.1-15pods │ │ ├── v1.0.1-15pods-times │ │ ├── v1.0.1-30pods │ │ ├── v1.0.1-30pods-times │ │ ├── v1.0.1-3pods │ │ ├── v1.0.1-99pods │ │ └── v1.0.1-99pods.times │ ├── scaletest.sh │ └── serviceAccount.yaml ├── snap1.yaml ├── snap2.yaml ├── snaprestoretest-nfs.sh ├── snaprestoretest.sh ├── snaptest.sh ├── starttest.sh ├── stoptest.sh ├── verify_leader_election.sh ├── volumeclonetest.sh ├── volumesnapshotclass.yaml └── xfspre │ ├── Chart.yaml │ └── templates │ ├── pv.yaml │ ├── pvc4.yaml │ └── test.yaml ├── integration ├── features │ ├── array-config │ │ └── multi-az │ └── integration.feature ├── integration_test.go ├── pool.yml ├── run.sh ├── step_defs_test.go ├── validate_http_unauthorized.sh └── wrong_config.json └── sanity ├── README.md ├── debug_help.sh ├── run.sh ├── secrets.yaml ├── start_driver.sh └── volParams.yaml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # CODEOWNERS 2 | # 3 | # Documentation for this file can be found at: 4 | # https://help.github.com/en/articles/about-code-owners 5 | 6 | # These are the default owners for the code and will 7 | # be requested for review when someone opens a pull request. 8 | # Order is alphabetical for easier maintenance. 9 | # 10 | # Abhilash Muralidhara (abhi16394) 11 | # Adarsh Kumar Yadav (adarsh-dell) 12 | # Akshay Saini (AkshaySainiDell) 13 | # Bahubali Jain (bpjain2004) 14 | # Don Khan (donatwork) 15 | # Trevor Dawe (tdawe) 16 | 17 | # for all files 18 | * @abhi16394 @adarsh-dell @AkshaySainiDell @bpjain2004 @donatwork @tdawe 19 | 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # To get started with Dependabot version updates, you'll need to specify which 3 | # package ecosystems to update and where the package manifests are located. 4 | # Please see the documentation for all configuration options: 5 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 6 | 7 | version: 2 8 | updates: 9 | # Schedule for go module updates 10 | - package-ecosystem: "gomod" 11 | directory: "/" 12 | schedule: 13 | interval: "weekly" 14 | day: "sunday" 15 | time: "18:00" 16 | allow: 17 | # Allow direct updates for packages 18 | - dependency-type: direct 19 | ignore: 20 | - dependency-name: "*" 21 | update-types: 22 | - version-update:semver-patch 23 | # a group of dependencies will be updated together in one pull request 24 | groups: 25 | golang: 26 | # group all semantic versioning levels together in one pull request 27 | update-types: 28 | - major 29 | - minor 30 | patterns: 31 | - "*" 32 | 33 | # github actions 34 | - package-ecosystem: "github-actions" 35 | directory: "/" 36 | schedule: 37 | # Check for updates to GitHub Actions every week 38 | interval: "weekly" 39 | day: "saturday" 40 | groups: 41 | github-actions: 42 | patterns: 43 | - "*" 44 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | A few sentences describing the overall goals of the pull request's commits. 3 | 4 | # GitHub Issues 5 | List the GitHub issues impacted by this PR: 6 | 7 | | GitHub Issue # | 8 | | -------------- | 9 | | | 10 | 11 | # Checklist: 12 | 13 | - [ ] I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues 14 | - [ ] I have verified that new and existing unit tests pass locally with my changes 15 | - [ ] I have not allowed coverage numbers to degenerate 16 | - [ ] I have maintained at least 90% code coverage 17 | - [ ] I have commented my code, particularly in hard-to-understand areas 18 | - [ ] I have made corresponding changes to the documentation 19 | - [ ] I have added tests that prove my fix is effective or that my feature works 20 | - [ ] Backward compatibility is not broken 21 | 22 | # How Has This Been Tested? 23 | Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration 24 | 25 | - [ ] Test A 26 | - [ ] Test B 27 | -------------------------------------------------------------------------------- /.github/workflows/common-workflows.yaml: -------------------------------------------------------------------------------- 1 | name: Common Workflows 2 | on: # yamllint disable-line rule:truthy 3 | push: 4 | branches: [main] 5 | pull_request: 6 | branches: ["**"] 7 | 8 | jobs: 9 | 10 | # golang static analysis checks 11 | go-static-analysis: 12 | uses: dell/common-github-actions/.github/workflows/go-static-analysis.yaml@main 13 | name: Golang Validation 14 | 15 | # checks unit tests, package coverage, and gosec 16 | common: 17 | name: Run gosec, unit tests, and check package coverage 18 | uses: dell/common-github-actions/.github/workflows/go-common.yml@main 19 | -------------------------------------------------------------------------------- /.github/workflows/go-version.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Reusable workflow to perform go version update on Golang based projects 10 | name: Go Version Update 11 | 12 | on: # yamllint disable-line rule:truthy 13 | workflow_dispatch: 14 | repository_dispatch: 15 | types: [go-update-workflow] 16 | 17 | jobs: 18 | # go version update 19 | go-version-update: 20 | uses: dell/common-github-actions/.github/workflows/go-version-workflow.yaml@main 21 | name: Go Version Update 22 | secrets: inherit 23 | -------------------------------------------------------------------------------- /.github/workflows/image-version-update.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Reusable workflow to perform image version update on Golang based projects 10 | name: Image Version Update 11 | 12 | on: # yamllint disable-line rule:truthy 13 | workflow_dispatch: 14 | inputs: 15 | version: 16 | description: "Version to release (major, minor, patch) Ex: minor" 17 | required: true 18 | repository_dispatch: 19 | types: [image-update-workflow] 20 | 21 | jobs: 22 | # image version update 23 | image-version-update: 24 | uses: dell/common-github-actions/.github/workflows/image-version-workflow.yaml@main 25 | with: 26 | version: "${{ github.event.inputs.version || 'minor' }}" 27 | secrets: inherit 28 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release CSI-Powerflex 2 | # Invocable as a reusable workflow 3 | # Can be manually triggered 4 | on: # yamllint disable-line rule:truthy 5 | workflow_call: 6 | workflow_dispatch: 7 | inputs: 8 | option: 9 | description: 'Select version to release' 10 | required: true 11 | type: choice 12 | default: 'minor' 13 | options: 14 | - major 15 | - minor 16 | - patch 17 | - n-1/n-2 patch (Provide input in the below box) 18 | version: 19 | description: "Patch version to release. example: 2.1.x (Use this only if n-1/n-2 patch is selected)" 20 | required: false 21 | type: string 22 | repository_dispatch: 23 | types: [auto-release-workflow] 24 | jobs: 25 | process-inputs: 26 | name: Process Inputs 27 | runs-on: ubuntu-latest 28 | outputs: 29 | processedVersion: ${{ steps.set-version.outputs.versionEnv }} 30 | steps: 31 | - name: Process input 32 | id: set-version 33 | shell: bash 34 | run: | 35 | echo "Triggered by: ${{ github.event_name }}" 36 | if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then 37 | echo "versionEnv=minor" >> $GITHUB_OUTPUT 38 | exit 0 39 | fi 40 | if [[ "${{ github.event.inputs.version }}" != "" && "${{ github.event.inputs.option }}" == "n-1/n-2 patch (Provide input in the below box)" ]]; then 41 | # if both version and option are provided, then version takes precedence i.e. patch release for n-1/n-2 42 | echo "versionEnv=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT 43 | exit 0 44 | fi 45 | if [[ "${{ github.event.inputs.option }}" != "n-1/n-2 patch (Provide input in the below box)" ]]; then 46 | # if only option is provided, then option takes precedence i.e. minor, major or patch release 47 | echo "versionEnv=${{ github.event.inputs.option }}" >> $GITHUB_OUTPUT 48 | exit 0 49 | fi 50 | # if neither option nor version is provided, then minor release is taken by default (Auto-release) 51 | echo "versionEnv=minor" >> $GITHUB_OUTPUT 52 | csm-release: 53 | needs: [process-inputs] 54 | uses: dell/common-github-actions/.github/workflows/csm-release-driver-module.yaml@main 55 | name: Release CSM Drivers and Modules 56 | with: 57 | version: ${{ needs.process-inputs.outputs.processedVersion }} 58 | images: 'csi-vxflexos' 59 | secrets: inherit 60 | -------------------------------------------------------------------------------- /.github/workflows/update-libraries-to-commits.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Reusable workflow to perform updates of Dell client libraries to latest commits 10 | name: Dell Libraries Commit Update 11 | on: # yamllint disable-line rule:truthy 12 | workflow_dispatch: 13 | repository_dispatch: 14 | types: [latest-commits-libraries] 15 | 16 | jobs: 17 | package-update: 18 | uses: dell/common-github-actions/.github/workflows/update-libraries-to-commits.yml@main 19 | name: Dell Libraries Update 20 | secrets: inherit 21 | -------------------------------------------------------------------------------- /.github/workflows/update-libraries.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Reusable workflow to perform updates of Dell client libraries 10 | name: Dell Libraries Release Update 11 | on: # yamllint disable-line rule:truthy 12 | workflow_dispatch: 13 | repository_dispatch: 14 | types: [latest-released-libraries] 15 | 16 | jobs: 17 | package-update: 18 | uses: dell/common-github-actions/.github/workflows/update-libraries.yml@main 19 | name: Dell Libraries Update 20 | secrets: inherit 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | /csi-vxflexos 3 | helm/.ps.out 4 | service/c.out 5 | service/test/ 6 | test/integration/c.linux.out 7 | test/integration/stderr 8 | semver.mk 9 | goscaleio/ 10 | gofsutil/ 11 | .idea 12 | .vscode 13 | *.log 14 | go-code-tester 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | go_import_path: github.com/thecodeteam/csi-scaleio 5 | go: 1.9.2 6 | 7 | env: 8 | global: 9 | - X_CSI_SCALEIO_NO_PROBE_ON_START=true 10 | 11 | install: true 12 | script: 13 | - go install . 14 | - go test -v ./service 15 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright © 2019-2025 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License 12 | 13 | # some arguments that must be supplied 14 | ARG GOPROXY 15 | ARG GOIMAGE 16 | ARG BASEIMAGE 17 | ARG DIGEST 18 | 19 | # Stage to build the driver 20 | FROM $GOIMAGE as builder 21 | ARG GOPROXY 22 | RUN mkdir -p /go/src 23 | COPY ./ /go/src/ 24 | WORKDIR /go/src/ 25 | RUN CGO_ENABLED=0 \ 26 | make build 27 | 28 | # Stage to build the driver image 29 | FROM $BASEIMAGE AS final 30 | ENTRYPOINT ["/csi-vxflexos.sh"] 31 | # copy in the driver 32 | COPY --from=builder /go/src/csi-vxflexos / 33 | COPY "csi-vxflexos.sh" / 34 | RUN chmod +x /csi-vxflexos.sh 35 | LABEL vendor="Dell Technologies" \ 36 | maintainer="Dell Technologies" \ 37 | name="csi-powerflex" \ 38 | summary="CSI Driver for Dell EMC PowerFlex" \ 39 | description="CSI Driver for provisioning persistent storage from Dell EMC PowerFlex" \ 40 | release="1.14.0" \ 41 | version="2.14.0" \ 42 | license="Apache-2.0" 43 | COPY ./licenses /licenses 44 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 2 | # for detailed Gopkg.toml documentation. 3 | # 4 | # Refer to https://github.com/toml-lang/toml for detailed TOML docs. 5 | 6 | [prune] 7 | non-go = true 8 | go-tests = true 9 | unused-packages = true 10 | 11 | [[constraint]] 12 | name = "github.com/rexray/gocsi" 13 | version = "0.4.0" 14 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # default target 2 | all: help 3 | 4 | # include an overrides file, which sets up default values and allows user overrides 5 | include overrides.mk 6 | 7 | # Help target, prints usefule information 8 | help: 9 | @echo 10 | @echo "The following targets are commonly used:" 11 | @echo 12 | @echo "action-help - Displays instructions on how to run a single github workflow locally" 13 | @echo "actions - Run all workflows locally, requires https://github.com/nektos/act" 14 | @echo "build - Builds the code locally" 15 | @echo "check - Runs the suite of code checking tools: lint, format, etc" 16 | @echo "clean - Cleans the local build" 17 | @echo "docker - Builds the code within a golang container and then creates the driver image" 18 | @echo "integration-test - Runs the integration tests. Requires access to an array" 19 | @echo "push - Pushes the built container to a target registry" 20 | @echo "unit-test - Runs the unit tests" 21 | @echo 22 | @make -s overrides-help 23 | 24 | # Clean the build 25 | clean: 26 | rm -f core/core_generated.go 27 | rm -f semver.mk 28 | go clean 29 | 30 | # Dependencies 31 | dependencies: 32 | go generate 33 | go run core/semver/semver.go -f mk >semver.mk 34 | 35 | # Build the driver locally 36 | build: dependencies 37 | CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build 38 | 39 | # Generates the docker container (but does not push) 40 | docker: dependencies 41 | make -f docker.mk docker 42 | 43 | # Generates the docker container with no cache (but does not push) 44 | docker-no-cache: dependencies 45 | make -f docker.mk docker-no-cache 46 | 47 | # Pushes container to the repository 48 | push: docker 49 | make -f docker.mk push 50 | 51 | # Windows or Linux; requires no hardware 52 | unit-test: go-code-tester 53 | GITHUB_OUTPUT=/dev/null \ 54 | ./go-code-tester 90 "." "" "true" "" "" "./test" 55 | 56 | # Linux only; populate env.sh with the hardware parameters 57 | integration-test: 58 | ( cd test/integration; sh run.sh TestIntegration ) 59 | 60 | check: 61 | @scripts/check.sh ./provider/ ./service/ 62 | 63 | .PHONY: actions action-help 64 | actions: ## Run all GitHub Action checks that run on a pull request creation 65 | @echo "Running all GitHub Action checks for pull request events..." 66 | @act -l | grep -v ^Stage | grep pull_request | grep -v image_security_scan | awk '{print $$2}' | while read WF; do \ 67 | echo "Running workflow: $${WF}"; \ 68 | act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job "$${WF}"; \ 69 | done 70 | 71 | go-code-tester: 72 | curl -o go-code-tester -L https://raw.githubusercontent.com/dell/common-github-actions/main/go-code-tester/entrypoint.sh \ 73 | && chmod +x go-code-tester 74 | 75 | action-help: ## Echo instructions to run one specific workflow locally 76 | @echo "GitHub Workflows can be run locally with the following command:" 77 | @echo "act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job " 78 | @echo "" 79 | @echo "Where '' is a Job ID returned by the command:" 80 | @echo "act -l" 81 | @echo "" 82 | @echo "NOTE: if act is not installed, it can be downloaded from https://github.com/nektos/act" 83 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - abhi16394 3 | - mjsdell 4 | - JacobGros 5 | - nb950 6 | - jooseppi-luna 7 | - yifeijin 8 | - rbo54 9 | - mbasha-dell 10 | - kumarkgosa 11 | reviewers: 12 | - abhi16394 13 | - mjsdell 14 | - JacobGros 15 | - nb950 16 | - jooseppi-luna 17 | - yifeijin 18 | - rbo54 19 | - mbasha-dell 20 | - kumarkgosa -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CSI Driver for Dell PowerFlex 2 | 3 | [![Go Report Card](https://goreportcard.com/badge/github.com/dell/csi-vxflexos?style=flat-square)](https://goreportcard.com/report/github.com/dell/csi-vxflexos) 4 | [![License](https://img.shields.io/github/license/dell/csi-vxflexos?style=flat-square&color=blue&label=License)](https://github.com/dell/csi-vxflexos/blob/master/LICENSE) 5 | [![Docker](https://img.shields.io/docker/pulls/dellemc/csi-vxflexos.svg?logo=docker&style=flat-square&label=Pulls)](https://hub.docker.com/r/dellemc/csi-vxflexos) 6 | [![Last Release](https://img.shields.io/github/v/release/dell/csi-vxflexos?label=Latest&style=flat-square&logo=go)](https://github.com/dell/csi-vxflexos/releases) 7 | 8 | **Repository for CSI Driver for Dell PowerFlex** 9 | 10 | ## Description 11 | CSI Driver for PowerFlex is part of the [CSM (Container Storage Modules)](https://github.com/dell/csm) open-source suite of Kubernetes storage enablers for Dell products. CSI Driver for PowerFlex is a Container Storage Interface (CSI) driver that provides support for provisioning persistent storage using Dell PowerFlex storage array. 12 | 13 | This project may be compiled as a stand-alone binary using Golang that, when run, provides a valid CSI endpoint. It also can be used as a precompiled container image. 14 | 15 | ## Table of Contents 16 | 17 | * [Code of Conduct](https://github.com/dell/csm/blob/main/docs/CODE_OF_CONDUCT.md) 18 | * [Maintainer Guide](https://github.com/dell/csm/blob/main/docs/MAINTAINER_GUIDE.md) 19 | * [Committer Guide](https://github.com/dell/csm/blob/main/docs/COMMITTER_GUIDE.md) 20 | * [Contributing Guide](https://github.com/dell/csm/blob/main/docs/CONTRIBUTING.md) 21 | * [List of Adopters](https://github.com/dell/csm/blob/main/docs/ADOPTERS.md) 22 | * [Support](#support) 23 | * [Security](https://github.com/dell/csm/blob/main/docs/SECURITY.md) 24 | * [Building](#building) 25 | * [Runtime Dependecies](#runtime-dependencies) 26 | * [Documentation](#documentation) 27 | 28 | ## Support 29 | For any issues, questions or feedback, please contact [Dell support](https://www.dell.com/support/incidents-online/en-us/contactus/product/container-storage-modules). 30 | 31 | ## Building 32 | This project is a Go module (see golang.org Module information for explanation). 33 | The dependencies for this project are in the go.mod file. 34 | 35 | To build the source, execute `make clean build`. 36 | 37 | To run unit tests, execute `make unit-test`. 38 | 39 | To build an image, execute `make docker`. 40 | 41 | You can run an integration test on a Linux system by populating the file `env.sh` 42 | with values for your PowerFlex system and then run "make integration-test". 43 | 44 | ## Runtime Dependencies 45 | The Node portion of the driver can only be run on nodes which have network connectivity to a “`PowerFlex Cluster`” via PowerFlex SDC Client (which is used by the driver). This means that the `scini` kernel module must be loaded. 46 | 47 | Also, if the `X_CSI_VXFLEXOS_SDCGUID` environment variable is not set, the driver will attempt to query the SDC GUID automatically. If this fails, the driver will not run. 48 | 49 | ## Documentation 50 | For more detailed information on the driver, please refer to [Container Storage Modules documentation](https://dell.github.io/csm-docs/). 51 | -------------------------------------------------------------------------------- /core/.gitignore: -------------------------------------------------------------------------------- 1 | core_generated.go 2 | -------------------------------------------------------------------------------- /core/core.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2019-2025 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | //go:generate go run semver/semver.go -f semver.tpl -o core_generated.go 14 | 15 | package core 16 | 17 | import "time" 18 | 19 | var ( 20 | // SemVer is the semantic version. 21 | SemVer = "unknown" 22 | 23 | // CommitSha7 is the short version of the commit hash from which 24 | // this program was built. 25 | CommitSha7 string 26 | 27 | // CommitSha32 is the long version of the commit hash from which 28 | // this program was built. 29 | CommitSha32 string 30 | 31 | // CommitTime is the commit timestamp of the commit from which 32 | // this program was built. 33 | CommitTime time.Time 34 | ) 35 | 36 | func setValues(semver string, commit7 string, commit32 string, commitTime time.Time) { 37 | SemVer = semver 38 | CommitSha7 = commit7 39 | CommitSha32 = commit32 40 | CommitTime = commitTime 41 | } 42 | -------------------------------------------------------------------------------- /core/core_test.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2025 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | 14 | package core 15 | 16 | import ( 17 | "testing" 18 | "time" 19 | 20 | "github.com/stretchr/testify/assert" 21 | ) 22 | 23 | func TestSetValues(t *testing.T) { 24 | timestamp := time.Now() 25 | setValues("0.0.0.0", "0123456", "abcdefghijklmnopqrstuvwxyz01234567891", timestamp) 26 | assert.Equal(t, "0.0.0.0", SemVer) 27 | assert.Equal(t, "0123456", CommitSha7) 28 | assert.Equal(t, "abcdefghijklmnopqrstuvwxyz01234567891", CommitSha32) 29 | assert.Equal(t, timestamp, CommitTime) 30 | } 31 | -------------------------------------------------------------------------------- /core/semver.tpl: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import "time" 4 | 5 | func init() { 6 | SemVer = "{{.SemVer}}" 7 | CommitSha7 = "{{.Sha7}}" 8 | CommitSha32 = "{{.Sha32}}" 9 | CommitTime = time.Unix({{.Epoch}}, 0) 10 | } 11 | -------------------------------------------------------------------------------- /csc.sanity: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | source env.sh 3 | 4 | echo; echo "getting plugin-info" 5 | csc -e unix_sock identity plugin-info 6 | sleep 5 7 | 8 | echo; echo "probling the plugin (health check)" 9 | csc -e unix_sock identity probe 10 | sleep 5 11 | 12 | echo; echo "creating a volume" 13 | csc -e unix_sock controller create-volume tomcsc1 --cap 1,mount,xfs --params storagepool=$STORAGE_POOL | tee output 14 | volumeId=$(cat output | awk '{ print $1; exit; }' | tr -d '"' ) 15 | echo volume id: $volumeId 16 | sleep 5 17 | 18 | echo; echo "listing volumes" 19 | csc -e unix_sock controller list-volumes 20 | sleep 5 21 | 22 | echo; echo "publish volume" 23 | csc -e unix_sock controller publish $volumeId --cap 1,mount,xfs --node-id $SDC_GUID 24 | sleep 5 25 | 26 | echo; echo "listing volumes on local node" 27 | echo ls /dev/disk/by-id 28 | ls /dev/disk/by-id 29 | sleep 5 30 | 31 | echo; echo "unpublish volume" 32 | csc -e unix_sock controller unpublish $volumeId --node-id $SDC_GUID 33 | sleep 5 34 | 35 | echo; echo "deleting volume" 36 | csc -e unix_sock controller delete-volume $volumeId 37 | sleep 5 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /csi-vxflexos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | if [ -z "$CSI_ENDPOINT" ] 15 | then 16 | echo "Warning: CSI_ENDPOINT is not set" 17 | else 18 | socket_file=$CSI_ENDPOINT 19 | if [[ $CSI_ENDPOINT == "unix://"* ]] 20 | then 21 | socket_file=$(echo $CSI_ENDPOINT | sed 's/^.\{7\}//') 22 | fi 23 | [ -e $socket_file ] && rm $socket_file 24 | fi 25 | exec "/csi-vxflexos" "$@" 26 | -------------------------------------------------------------------------------- /dell-csi-helm-installer/.gitignore: -------------------------------------------------------------------------------- 1 | images.manifest 2 | images.tar 3 | -------------------------------------------------------------------------------- /dell-csi-helm-installer/install-csi-vxflexos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | #Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 4 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # make MDM secret key with values from each array 16 | # fail if MDM format is not valid 17 | function install_mdm_secret() { 18 | log smart_step "Get SDC config and make MDM string for multi array support" 19 | SECRET=${1} 20 | VAL=$(kubectl get secret ${SECRET} -n ${NS} -o go-template='{{ .data.config }}') 21 | if [ "${VAL}" == "" ]; then 22 | log error "secret ${SECRET} in namespace ${NS} not found" 23 | else 24 | JSON=$(kubectl get secret ${SECRET} -n ${NS} -o go-template='{{ .data.config }}' | base64 --decode) 25 | DATA=$(echo "${JSON}" | grep -v '^#' | grep mdm | awk -F "\"" '{ print $(NF-1)}') 26 | MDM=$(echo ${DATA} | sed "s/ /\&/g") 27 | if [ "${MDM}" != "" ]; then 28 | ENC=$(echo ${MDM} | base64 | tr -d "\n") 29 | KRC=$(kubectl patch secret ${SECRET} -n ${NS} -p "{\"data\": { \"MDM\": \"${ENC}\"}}") 30 | VAL=$(kubectl get secret ${SECRET} -n ${NS} -o go-template='{{ .data.MDM }}' | base64 --decode) 31 | log smart_step "SDC MDM value created : ${VAL}" 32 | else 33 | log error "Secret is not configured properly, check documentation to create secret" 34 | exit 2 35 | fi 36 | fi 37 | 38 | for i in $(echo ${MDM} | tr "&" "\n"); do 39 | # check mdm for each array 40 | for p in $(echo $i | tr "," "\n"); do 41 | check_ip $p 42 | done 43 | done 44 | } 45 | 46 | # helper function to check IP validation 47 | function check_ip() { 48 | IP=${1} 49 | REGEX="\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" 50 | ADDR=$(echo $IP | grep -oE ${REGEX}) 51 | RC=$? 52 | if [[ "$RC" -eq "0" ]]; then 53 | log smart_step "IP ADDR $ADDR format is ok" 54 | else 55 | log error "SDC MDM validation failed. IP address $ip format is not ok" 56 | fi 57 | } 58 | 59 | install_mdm_secret "${RELEASE}-config" 60 | -------------------------------------------------------------------------------- /dell-csi-helm-installer/verify-csi-vxflexos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | #Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 4 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # verify-csi-vxflexos method 16 | function verify-csi-vxflexos() { 17 | verify_k8s_versions "1.31" "1.33" 18 | verify_openshift_versions "4.18" "4.19" 19 | verify_namespace "${NS}" 20 | verify_helm_values_version "${DRIVER_VERSION}" 21 | verify_required_secrets "${RELEASE}-config" 22 | verify_sdc_installation 23 | verify_alpha_snap_resources 24 | verify_snap_requirements 25 | verify_helm_3 26 | verify_authorization_proxy_server 27 | } 28 | 29 | # Check if the SDC is installed and the kernel module loaded 30 | function verify_sdc_installation() { 31 | if [ ${NODE_VERIFY} -eq 0 ]; then 32 | return 33 | fi 34 | log step "Verifying the SDC installation" 35 | 36 | local SDC_MINION_NODES=$(run_command kubectl get nodes -o wide | grep -v -e master -e INTERNAL -e infra | awk ' { print $6; }') 37 | 38 | error=0 39 | missing=() 40 | for node in $SDC_MINION_NODES; do 41 | # check is the scini kernel module is loaded 42 | run_command ssh ${NODEUSER}@$node "/sbin/lsmod | grep scini" >/dev/null 2>&1 43 | rv=$? 44 | if [ $rv -ne 0 ]; then 45 | missing+=($node) 46 | error=1 47 | found_warning "SDC was not found on node: $node" 48 | fi 49 | done 50 | check_error error 51 | } 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docker.mk: -------------------------------------------------------------------------------- 1 | # docker makefile, included from Makefile, will build/push images with docker or podman 2 | # 3 | 4 | # Includes the following generated file to get semantic version information 5 | include semver.mk 6 | 7 | ifdef NOTES 8 | RELNOTE="-$(NOTES)" 9 | else 10 | RELNOTE= 11 | endif 12 | 13 | ifeq ($(IMAGETAG),) 14 | IMAGETAG="v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" 15 | endif 16 | 17 | 18 | docker: download-csm-common 19 | $(eval include csm-common.mk) 20 | @echo "Base Images is set to: $(BASEIMAGE)" 21 | @echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" 22 | $(BUILDER) build --pull $(NOCACHE) -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" --target $(BUILDSTAGE) --build-arg GOPROXY --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) . 23 | 24 | docker-no-cache: download-csm-common 25 | @echo "Building with --no-cache ..." 26 | @make docker NOCACHE=--no-cache 27 | 28 | push: 29 | @echo "Pushing: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" 30 | $(BUILDER) push "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" 31 | 32 | 33 | download-csm-common: 34 | curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk 35 | -------------------------------------------------------------------------------- /env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | 15 | export X_CSI_VXFLEXOS_THICKPROVISION=false 16 | export X_CSI_VXFLEXOS_ENABLESNAPSHOTCGDELETE="true" 17 | export X_CSI_VXFLEXOS_ENABLELISTVOLUMESNAPSHOTS="true" 18 | export X_CSI_QUOTA_ENABLED="true" 19 | 20 | # Variables for using tests 21 | export CSI_ENDPOINT=`pwd`/unix_sock 22 | export STORAGE_POOL="" 23 | export NFS_STORAGE_POOL="" 24 | export SDC_GUID=$(/bin/emc/scaleio/drv_cfg --query_guid) 25 | # Alternate GUID is for another system for testing expose volume to multiple hosts 26 | export ALT_GUID= 27 | export X_CSI_POWERFLEX_KUBE_NODE_NAME="node1" 28 | 29 | # Interface variables 30 | export NODE_INTERFACES="nodeName:interfaceName" 31 | 32 | # Node Label variables 33 | export ZONE_LABEL_KEY="" 34 | 35 | #Debug variables for goscaleio library 36 | export GOSCALEIO_SHOWHTTP="true" 37 | 38 | #If you put the system ID in your config.json, put the 39 | #system's name here, and vice versa. If your instance does not have a name, 40 | #leave this variable blank. 41 | export ALT_SYSTEM_ID="" 42 | 43 | if /sbin/lsmod | grep -q scini; then 44 | echo "scini module is present, Proceeding to add MDM..." 45 | MDM=`grep mdm ../../config.json | awk -F":" '{print $2}'` 46 | for i in $MDM 47 | do 48 | IP=$i 49 | IP=$(echo "$i" | sed "s/\"//g") 50 | echo "Adding MDM wth IP: $IP" 51 | /opt/emc/scaleio/sdc/bin/drv_cfg --add_mdm --ip $IP 52 | done 53 | fi 54 | -------------------------------------------------------------------------------- /k8sutils/k8sutils.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2020-2025 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | 14 | package k8sutils 15 | 16 | import ( 17 | "context" 18 | 19 | "github.com/kubernetes-csi/csi-lib-utils/leaderelection" 20 | "k8s.io/client-go/kubernetes" 21 | "k8s.io/client-go/rest" 22 | "k8s.io/client-go/tools/clientcmd" 23 | ) 24 | 25 | // Clientset - Interface to kubernetes 26 | var Clientset kubernetes.Interface 27 | 28 | type leaderElection interface { 29 | Run() error 30 | WithNamespace(namespace string) 31 | } 32 | 33 | // CreateKubeClientSet - Returns kubeclient set 34 | func CreateKubeClientSet(kubeConfig ...string) error { 35 | config, err := InClusterConfigFunc() 36 | if err != nil { 37 | if len(kubeConfig) == 0 { 38 | return err 39 | } 40 | config, err = clientcmd.BuildConfigFromFlags("", kubeConfig[0]) 41 | if err != nil { 42 | return err 43 | } 44 | } 45 | 46 | // creates the clientset 47 | Clientset, err = NewForConfigFunc(config) 48 | if err != nil { 49 | return err 50 | } 51 | return nil 52 | } 53 | 54 | // used for unit testing - 55 | // allows CreateKubeClientSet to be mocked 56 | var InClusterConfigFunc = func() (*rest.Config, error) { 57 | return rest.InClusterConfig() 58 | } 59 | 60 | var NewForConfigFunc = func(config *rest.Config) (kubernetes.Interface, error) { 61 | return kubernetes.NewForConfig(config) 62 | } 63 | 64 | // LeaderElection - Initializes Leader election 65 | var LeaderElectionFunc = func(clientset *kubernetes.Interface, lockName string, namespace string, runFunc func(ctx context.Context)) error { 66 | le := leaderelection.NewLeaderElection(*clientset, lockName, runFunc) 67 | le.WithNamespace(namespace) 68 | return le.Run() 69 | } 70 | -------------------------------------------------------------------------------- /overrides.mk: -------------------------------------------------------------------------------- 1 | # overrides file 2 | # this file, included from the Makefile, will overlay default values with environment variables 3 | # 4 | 5 | # DEFAULT values 6 | # ubi9/ubi-micro:9.2-13 7 | DEFAULT_GOIMAGE=$(shell sed -En 's/^go (.*)$$/\1/p' go.mod) 8 | DEFAULT_REGISTRY="sample_registry" 9 | DEFAULT_IMAGENAME="csi-vxflexos" 10 | DEFAULT_BUILDSTAGE="final" 11 | DEFAULT_IMAGETAG="" 12 | 13 | # set the GOIMAGE if needed 14 | ifeq ($(GOIMAGE),) 15 | export GOIMAGE="$(DEFAULT_GOIMAGE)" 16 | endif 17 | 18 | # set the REGISTRY if needed 19 | ifeq ($(REGISTRY),) 20 | export REGISTRY="$(DEFAULT_REGISTRY)" 21 | endif 22 | 23 | # set the IMAGENAME if needed 24 | ifeq ($(IMAGENAME),) 25 | export IMAGENAME="$(DEFAULT_IMAGENAME)" 26 | endif 27 | 28 | #set the IMAGETAG if needed 29 | ifneq ($(DEFAULT_IMAGETAG), "") 30 | export IMAGETAG="$(DEFAULT_IMAGETAG)" 31 | endif 32 | 33 | # set the BUILDSTAGE if needed 34 | ifeq ($(BUILDSTAGE),) 35 | export BUILDSTAGE="$(DEFAULT_BUILDSTAGE)" 36 | endif 37 | 38 | # figure out if podman or docker should be used (use podman if found) 39 | ifneq (, $(shell which podman 2>/dev/null)) 40 | export BUILDER=podman 41 | else 42 | export BUILDER=docker 43 | endif 44 | 45 | # target to print some help regarding these overrides and how to use them 46 | overrides-help: 47 | @echo 48 | @echo "The following environment variables can be set to control the build" 49 | @echo 50 | @echo "GOIMAGE - The version of Go to build with, default is: $(DEFAULT_GOIMAGE)" 51 | @echo " Current setting is: $(GOIMAGE)" 52 | @echo "REGISTRY - The registry to push images to, default is: $(DEFAULT_REGISTRY)" 53 | @echo " Current setting is: $(REGISTRY)" 54 | @echo "IMAGENAME - The image name to be built, defaut is: $(DEFAULT_IMAGENAME)" 55 | @echo " Current setting is: $(IMAGENAME)" 56 | @echo "IMAGETAG - The image tag to be built, default is an empty string which will determine the tag by examining annotated tags in the repo." 57 | @echo " Current setting is: $(IMAGETAG)" 58 | @echo "BUILDSTAGE - The Dockerfile build stage to execute, default is: $(DEFAULT_BUILDSTAGE)" 59 | @echo " Stages can be found by looking at the Dockerfile" 60 | @echo " Current setting is: $(BUILDSTAGE)" 61 | @echo 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /plugin.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | //go:build linux && plugin 14 | // +build linux,plugin 15 | 16 | //go:generate go generate ./core 17 | 18 | package main 19 | 20 | import "C" 21 | 22 | import ( 23 | "github.com/dell/csi-vxflexos/v2/provider" 24 | "github.com/dell/csi-vxflexos/v2/service" 25 | ) 26 | 27 | //////////////////////////////////////////////////////////////////////////////// 28 | // Go Plug-in // 29 | //////////////////////////////////////////////////////////////////////////////// 30 | 31 | // ServiceProviders is an exported symbol that provides a host program 32 | // with a map of the service provider names and constructors. 33 | var ServiceProviders = map[string]func() interface{}{ 34 | service.Name: func() interface{} { return provider.New() }, 35 | } 36 | -------------------------------------------------------------------------------- /provider/provider.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | 14 | package provider 15 | 16 | import ( 17 | "github.com/dell/csi-vxflexos/v2/service" 18 | "github.com/dell/gocsi" 19 | logrus "github.com/sirupsen/logrus" 20 | ) 21 | 22 | // Log init 23 | var Log = logrus.New() 24 | 25 | // New returns a new Mock Storage Plug-in Provider. 26 | func New() gocsi.StoragePluginProvider { 27 | svc := service.New() 28 | return &gocsi.StoragePlugin{ 29 | Controller: svc, 30 | Identity: svc, 31 | Node: svc, 32 | BeforeServe: svc.BeforeServe, 33 | RegisterAdditionalServers: svc.RegisterAdditionalServers, 34 | 35 | EnvVars: []string{ 36 | // Enable request validation 37 | gocsi.EnvVarSpecReqValidation + "=true", 38 | 39 | // Enable serial volume access 40 | gocsi.EnvVarSerialVolAccess + "=true", 41 | }, 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /provider/provider_test.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2025 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | package provider 15 | 16 | import ( 17 | "testing" 18 | 19 | "github.com/stretchr/testify/assert" 20 | ) 21 | 22 | func TestNew(t *testing.T) { 23 | // Call the New function 24 | result := New() 25 | 26 | // Verify that the result is as expected 27 | // For now, we just want to make sure a plugin was created, all the New() function does is 28 | // set up function pointers 29 | assert.NotNil(t, result) 30 | } 31 | -------------------------------------------------------------------------------- /samples/secret.yaml: -------------------------------------------------------------------------------- 1 | # Username for accessing PowerFlex system. 2 | # If authorization is enabled, username will be ignored. 3 | - username: "admin" 4 | # Password for accessing PowerFlex system. 5 | # If authorization is enabled, password will be ignored. 6 | password: "password" 7 | # System name/ID of PowerFlex system. 8 | systemID: "1a99aa999999aa9a" 9 | # Previous names used in secret of PowerFlex system. 10 | allSystemNames: "pflex-1,pflex-2" 11 | # REST API gateway HTTPS endpoint for PowerFlex system. 12 | # If authorization is enabled, endpoint should be the HTTPS localhost endpoint that 13 | # the authorization sidecar will listen on 14 | endpoint: "https://127.0.0.1" 15 | # Determines if the driver is going to validate certs while connecting to PowerFlex REST API interface. 16 | # Allowed values: true or false 17 | # Default value: true 18 | skipCertificateValidation: true 19 | # indicates if this array is the default array 20 | # needed for backwards compatibility 21 | # only one array is allowed to have this set to true 22 | # Default value: false 23 | isDefault: true 24 | # defines the MDM(s) that SDC should register with on start. 25 | # Allowed values: a list of IP addresses or hostnames separated by comma. 26 | # Default value: none 27 | mdm: "10.0.0.1,10.0.0.2" 28 | # NFS is only supported on PowerFlex storage system >=4.0.x 29 | # If not specified, value from SC will be used. 30 | # If specified in both, secret and storage class, then precedence is given to storage class value. 31 | # Allowed values: string 32 | # Optional: true 33 | # Default value: "" 34 | # This is an optional field from v2.10.0 onwards for PowerFlex storage system >=4.0.x 35 | nasName: "nas-server" 36 | 37 | # # zone: A cluster availability zone to which the PowerFlex system should be bound. 38 | # # The mapping is one-to-one - the PowerFlex system cannot belong to more than one zone. 39 | # # Ideally, the PowerFlex system and cluster nodes that define the availability zone would be 40 | # # geographically co-located. 41 | # # Optional: true 42 | # # Default value: none 43 | # zone: 44 | # # name: The name of the container orchestrator's availability zone to which the PowerFlex system 45 | # # should be mapped. 46 | # name: "zoneA" 47 | # # labelKey: The name of the label used for the availability zone to which the PowerFlex system 48 | # # should be mapped. 49 | # labelKey: "topology.kubernetes.io/zone" 50 | # # protectionDomains: A list of the protection domains and their associated pools, defined in 51 | # # the PowerFlex system. 52 | # # Currently, csi-powerflex only supports one protection domain per zone. 53 | # protectionDomains: 54 | # # pools: A list of pools that belong to a single protection defined in the PowerFlex system. 55 | # # Currently, csi-powerflex only supports one pool per protection domain. 56 | # - pools: 57 | # - 58 | # # name: The name of the protection domain in the PowerFlex system. 59 | # # Optional: true 60 | # # name is required if storage pool names are not unique across protection domains. 61 | # name: 62 | # To add more PowerFlex systems, uncomment the following lines and provide the required values 63 | # - username: "admin" 64 | # password: "password" 65 | # systemID: "2b11bb111111bb1b" 66 | # endpoint: "https://127.0.0.2" 67 | # skipCertificateValidation: true 68 | # mdm: "10.0.0.3,10.0.0.4" 69 | # zone: 70 | # name: "zoneB" 71 | # labelKey: "topology.kubernetes.io/zone" 72 | # protectionDomains: 73 | # - name: 74 | # pools: 75 | # - 76 | -------------------------------------------------------------------------------- /samples/secret/karavi-authorization-config.json: -------------------------------------------------------------------------------- 1 | [{"username":"","password":"","intendedEndpoint":"","endpoint":"https://localhost:9400","systemID":"","skipCertificateValidation":true,"isDefault":true}] 2 | -------------------------------------------------------------------------------- /samples/storageclass/storageclass-az.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: vxflexos-az 5 | provisioner: csi-vxflexos.dellemc.com 6 | # reclaimPolicy: PVs that are dynamically created by a StorageClass will have the reclaim policy specified here 7 | # Allowed values: 8 | # Reclaim: retain the PV after PVC deletion 9 | # Delete: delete the PV after PVC deletion 10 | # Optional: true 11 | # Default value: Delete 12 | reclaimPolicy: Delete 13 | # allowVolumeExpansion: allows the users to resize the volume by editing the corresponding PVC object 14 | # Allowed values: 15 | # true: allow users to resize the PVC 16 | # false: does not allow users to resize the PVC 17 | # Optional: true 18 | # Default value: false 19 | allowVolumeExpansion: true 20 | parameters: 21 | # Filesytem type for volumes created by storageclass 22 | # Default value: None if defaultFsType is not mentioned in values.yaml 23 | # Else defaultFsType value mentioned in values.yaml 24 | # will be used as default value 25 | csi.storage.k8s.io/fstype: xfs 26 | # Limit the volume network bandwidth 27 | # Value is a positive number in granularity of 1024 Kbps; 0 = unlimited 28 | # Allowed values: one string for bandwidth limit in Kbps 29 | # Optional: false 30 | # Uncomment the line below if you want to use bandwidthLimitInKbps 31 | # bandwidthLimitInKbps: # Insert bandwidth limit in Kbps 32 | # Limit the volume IOPS 33 | # The number of IOPS must be greater than 10; 0 = unlimited 34 | # Allowed values: one string for iops limit 35 | # Optional: false 36 | # Uncomment the line below if you want to use iopsLimit 37 | # iopsLimit: # Insert iops limit 38 | # volumeBindingMode determines how volume binding and dynamic provisioning should occur 39 | # Allowed values: 40 | # Immediate: volume binding and dynamic provisioning occurs once PVC is created 41 | # WaitForFirstConsumer: delay the binding and provisioning of PV until a pod using the PVC is created. 42 | # Optional: false 43 | # Default value: WaitForFirstConsumer (required for topology section below) 44 | volumeBindingMode: WaitForFirstConsumer 45 | # allowedTopologies helps scheduling pods on worker nodes which match all of below expressions. 46 | # by providing the zone key, the scheduler can make sure that pods are scheduled on the same zone. 47 | # Note: The node must have the same label value with the key and a single associated zone. 48 | allowedTopologies: 49 | - matchLabelExpressions: 50 | - key: topology.kubernetes.io/zone 51 | values: 52 | - zoneA 53 | - zoneB 54 | -------------------------------------------------------------------------------- /samples/storageclass/storageclass-xfs.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: vxflexos-xfs 5 | provisioner: csi-vxflexos.dellemc.com 6 | # reclaimPolicy: PVs that are dynamically created by a StorageClass will have the reclaim policy specified here 7 | # Allowed values: 8 | # Reclaim: retain the PV after PVC deletion 9 | # Delete: delete the PV after PVC deletion 10 | # Optional: true 11 | # Default value: Delete 12 | reclaimPolicy: Delete 13 | # allowVolumeExpansion: allows the users to resize the volume by editing the corresponding PVC object 14 | # Allowed values: 15 | # true: allow users to resize the PVC 16 | # false: does not allow users to resize the PVC 17 | # Optional: true 18 | # Default value: false 19 | allowVolumeExpansion: true 20 | parameters: 21 | # Storage pool to use on system 22 | # Optional: false 23 | storagepool: 24 | # Protection domain that storage pool above belongs to 25 | # Needed if array has two storagepools that share the same name, but belong to different protection domains 26 | # Optional: true 27 | # Uncomment the line below if you want to use protectiondomain 28 | # protectiondomain: # Insert Protection domain name 29 | # System you would like this storage class to use 30 | # Allowed values: one string for system ID 31 | # Optional: false 32 | systemID: 33 | # format options to pass to mkfs 34 | # Allowed values: A string dictating the fs options you want passed 35 | # Optional: true 36 | # Uncomment the line below if you want to use mkfsFormatOption 37 | # mkfsFormatOption: "" # Insert file system format option 38 | # Filesytem type for volumes created by storageclass 39 | # Default value: None if defaultFsType is not mentioned in values.yaml 40 | # Else defaultFsType value mentioned in values.yaml 41 | # will be used as default value 42 | csi.storage.k8s.io/fstype: xfs 43 | # Limit the volume network bandwidth 44 | # Value is a positive number in granularity of 1024 Kbps; 0 = unlimited 45 | # Allowed values: one string for bandwidth limit in Kbps 46 | # Optional: false 47 | # Uncomment the line below if you want to use bandwidthLimitInKbps 48 | # bandwidthLimitInKbps: # Insert bandwidth limit in Kbps 49 | # Limit the volume IOPS 50 | # The number of IOPS must be greater than 10; 0 = unlimited 51 | # Allowed values: one string for iops limit 52 | # Optional: false 53 | # Uncomment the line below if you want to use iopsLimit 54 | # iopsLimit: # Insert iops limit 55 | # volumeBindingMode determines how volume binding and dynamic provisioning should occur 56 | # Allowed values: 57 | # Immediate: volume binding and dynamic provisioning occurs once PVC is created 58 | # WaitForFirstConsumer: delay the binding and provisioning of PV until a pod using the PVC is created. 59 | # Optional: false 60 | # Default value: WaitForFirstConsumer (required for topology section below) 61 | volumeBindingMode: WaitForFirstConsumer 62 | # allowedTopologies helps scheduling pods on worker nodes which match all of below expressions. 63 | allowedTopologies: 64 | - matchLabelExpressions: 65 | - key: csi-vxflexos.dellemc.com/ 66 | values: 67 | - csi-vxflexos.dellemc.com 68 | -------------------------------------------------------------------------------- /samples/storageclass/storageclass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | # name for the storage class 5 | name: vxflexos 6 | annotations: 7 | storageclass.kubernetes.io/is-default-class: "true" 8 | provisioner: csi-vxflexos.dellemc.com 9 | # reclaimPolicy: PVs that are dynamically created by a StorageClass will have the reclaim policy specified here 10 | # Allowed values: 11 | # Reclaim: retain the PV after PVC deletion 12 | # Delete: delete the PV after PVC deletion 13 | # Optional: true 14 | # Default value: Delete 15 | reclaimPolicy: Delete 16 | # allowVolumeExpansion: allows the users to resize the volume by editing the corresponding PVC object 17 | # Allowed values: 18 | # true: allow users to resize the PVC 19 | # false: does not allow users to resize the PVC 20 | # Optional: true 21 | # Default value: false 22 | allowVolumeExpansion: true 23 | parameters: 24 | # Storage pool to use on system 25 | # Optional: false 26 | storagepool: 27 | # Protection domain that storage pool above belongs to 28 | # Needed if array has two storagepools that share the same name, but belong to different protection domains 29 | # Optional: true 30 | # Uncomment the line below if you want to use protectiondomain 31 | # protectiondomain: # Insert Protection domain name 32 | # System you would like this storage class to use 33 | # Allowed values: one string for system ID 34 | # Optional: false 35 | systemID: 36 | # format options to pass to mkfs 37 | # Allowed values: A string dictating the fs options you want passed 38 | # Optional: true 39 | # Uncomment the line below if you want to use mkfsFormatOption 40 | # mkfsFormatOption: "" # Insert file system format option 41 | # Filesytem type for volumes created by storageclass 42 | # Default value: None if defaultFsType is not mentioned in values.yaml 43 | # Else defaultFsType value mentioned in values.yaml 44 | # will be used as default value 45 | csi.storage.k8s.io/fstype: ext4 46 | # Limit the volume network bandwidth 47 | # Value is a positive number in granularity of 1024 Kbps; 0 = unlimited 48 | # Allowed values: one string for bandwidth limit in Kbps 49 | # Optional: false 50 | # Uncomment the line below if you want to use bandwidthLimitInKbps 51 | # bandwidthLimitInKbps: # Insert bandwidth limit in Kbps 52 | # Limit the volume IOPS 53 | # The number of IOPS must be greater than 10; 0 = unlimited 54 | # Allowed values: one string for iops limit 55 | # Optional: false 56 | # Uncomment the line below if you want to use iopsLimit 57 | # iopsLimit: # Insert iops limit 58 | # volumeBindingMode determines how volume binding and dynamic provisioning should occur 59 | # Allowed values: 60 | # Immediate: volume binding and dynamic provisioning occurs once PVC is created 61 | # WaitForFirstConsumer: delay the binding and provisioning of PV until a pod using the PVC is created. 62 | # Optional: false 63 | # Default value: WaitForFirstConsumer (required for topology section below) 64 | volumeBindingMode: WaitForFirstConsumer 65 | # allowedTopologies helps scheduling pods on worker nodes which match all of below expressions. 66 | allowedTopologies: 67 | - matchLabelExpressions: 68 | - key: csi-vxflexos.dellemc.com/ 69 | values: 70 | - csi-vxflexos.dellemc.com 71 | -------------------------------------------------------------------------------- /samples/volumesnapshotclass/snapclass-v1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshotClass 3 | metadata: 4 | name: vxflexos-snapclass 5 | driver: csi-vxflexos.dellemc.com 6 | # Configure what happens to a VolumeSnapshotContent when the VolumeSnapshot object 7 | # it is bound to is to be deleted 8 | # Allowed values: 9 | # Delete: the underlying storage snapshot will be deleted along with the VolumeSnapshotContent object. 10 | # Retain: both the underlying snapshot and VolumeSnapshotContent remain. 11 | deletionPolicy: Delete 12 | -------------------------------------------------------------------------------- /scripts/build_ubi_micro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright © 2023 Dell Inc. or its subsidiaries. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License 14 | 15 | microcontainer=$(buildah from $1) 16 | micromount=$(buildah mount $microcontainer) 17 | dnf install --installroot $micromount --releasever=9 --nodocs --setopt install_weak_deps=false --setopt=reposdir=/etc/yum.repos.d/ e4fsprogs xfsprogs libaio kmod numactl util-linux nfs-utils -y 18 | dnf clean all --installroot $micromount 19 | buildah umount $microcontainer 20 | buildah commit $microcontainer csipowerflex-ubimicro 21 | -------------------------------------------------------------------------------- /scripts/check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | DIRS=$@ 16 | 17 | if [ -f "../vendor" ]; then 18 | # Tell the applicable Go tools to use the vendor directory, if it exists. 19 | MOD_FLAGS="-mod=vendor" 20 | fi 21 | 22 | FMT_TMPFILE=/tmp/check_fmt 23 | FMT_COUNT_TMPFILE=${FMT_TMPFILE}.count 24 | 25 | fmt_count() { 26 | if [ ! -f $FMT_COUNT_TMPFILE ]; then 27 | echo "0" 28 | fi 29 | 30 | head -1 $FMT_COUNT_TMPFILE 31 | } 32 | 33 | fmt() { 34 | gofmt -d ${DIRS} | tee $FMT_TMPFILE 35 | cat $FMT_TMPFILE | wc -l > $FMT_COUNT_TMPFILE 36 | if [ ! `cat $FMT_COUNT_TMPFILE` -eq "0" ]; then 37 | echo Found `cat $FMT_COUNT_TMPFILE` formatting issue\(s\). 38 | return 1 39 | fi 40 | } 41 | 42 | echo === Checking format... 43 | fmt 44 | FMT_RETURN_CODE=$? 45 | echo === Finished 46 | 47 | echo === Vetting... 48 | go vet ${MOD_FLAGS} ${DIRS} 49 | VET_RETURN_CODE=$? 50 | echo === Finished 51 | 52 | echo === Linting... 53 | (command -v golint >/dev/null 2>&1 \ 54 | || go install golang.org/x/lint/golint@latest) \ 55 | && golint --set_exit_status ${DIRS} 56 | LINT_RETURN_CODE=$? 57 | echo === Finished 58 | 59 | # Report output. 60 | fail_checks=0 61 | [ "${FMT_RETURN_CODE}" != "0" ] && echo "Formatting checks failed!" && fail_checks=1 62 | [ "${VET_RETURN_CODE}" != "0" ] && echo "Vetting checks failed!" && fail_checks=1 63 | [ "${LINT_RETURN_CODE}" != "0" ] && echo "Linting checks failed!" && fail_checks=1 64 | 65 | exit ${fail_checks} 66 | 67 | -------------------------------------------------------------------------------- /scripts/get_vxflexos_info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | echo "System ID MDPM IPs" 16 | DRV_CFG=/opt/emc/scaleio/sdc/bin/drv_cfg 17 | $DRV_CFG --query_mdms | awk ' /MDM-ID/{ sub("^.*-", "", $10); sub("^.*-", "", $11); sub("^.*-", "", $12); sub(".*-", "", $13); print $2, 'x', $10, $11, $12, $13 }' 18 | 19 | -------------------------------------------------------------------------------- /service/controller_test.gox: -------------------------------------------------------------------------------- 1 | // Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | 14 | package service_test 15 | 16 | import ( 17 | "context" 18 | "testing" 19 | 20 | csi "github.com/container-storage-interface/spec/lib/go/csi/v0" 21 | "github.com/stretchr/testify/assert" 22 | ) 23 | 24 | func TestControllerGetCaps(t *testing.T) { 25 | 26 | ctx := context.Background() 27 | 28 | gclient, stop := startServer(ctx, t) 29 | defer stop() 30 | 31 | client := csi.NewControllerClient(gclient) 32 | 33 | rpcs := map[csi.ControllerServiceCapability_RPC_Type]struct{}{ 34 | csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME: struct{}{}, 35 | csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME: struct{}{}, 36 | csi.ControllerServiceCapability_RPC_LIST_VOLUMES: struct{}{}, 37 | csi.ControllerServiceCapability_RPC_GET_CAPACITY: struct{}{}, 38 | } 39 | 40 | resp, err := client.ControllerGetCapabilities(ctx, 41 | &csi.ControllerGetCapabilitiesRequest{}) 42 | 43 | assert.NoError(t, err) 44 | caps := resp.GetCapabilities() 45 | assert.NotEmpty(t, caps) 46 | assert.Len(t, caps, len(rpcs)) 47 | 48 | for _, cap := range caps { 49 | assert.Contains(t, rpcs, cap.GetRpc().GetType()) 50 | delete(rpcs, cap.GetRpc().GetType()) 51 | } 52 | assert.Empty(t, rpcs) 53 | } 54 | 55 | /* 56 | func TestControllerProbe(t *testing.T) { 57 | ctx := context.Background() 58 | 59 | os.Setenv("X_CSI_VXFLEXOS_ENDPOINT", "https://localhost:443") 60 | 61 | gclient, stop := startServer(ctx, t) 62 | defer stop() 63 | 64 | client := csi.NewControllerClient(gclient) 65 | } 66 | */ 67 | 68 | func startServer(ctx context.Context, t *testing.T) (*grpc.ClientConn, func()) { 69 | 70 | // Create a new SP instance and serve it with a piped connection. 71 | sp := provider.New() 72 | lis, err := memconn.Listen("csi-test") 73 | assert.NoError(t, err) 74 | go func() { 75 | if err := sp.Serve(ctx, lis); err != nil { 76 | assert.EqualError(t, err, "http: Server closed") 77 | } 78 | }() 79 | 80 | clientOpts := []grpc.DialOption{ 81 | grpc.WithInsecure(), 82 | grpc.WithDialer(func(string, time.Duration) (net.Conn, error) { 83 | return memconn.Dial("csi-test") 84 | }), 85 | } 86 | 87 | // Create a client for the piped connection. 88 | client, err := grpc.DialContext(ctx, "", clientOpts...) 89 | assert.NoError(t, err) 90 | 91 | return client, func() { 92 | client.Close() 93 | sp.GracefulStop(ctx) 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /service/features/array-config/config: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "14dbbf5617523654", 9 | "nasName": "dummy-nas-server" 10 | }, 11 | { 12 | "endpoint": "http://127.0.0.2", 13 | "username": "username", 14 | "password": "password", 15 | "skipCertificateValidation": true, 16 | "isDefault": false, 17 | "systemID": "15dbbf5617523655", 18 | "AllSystemNames" : "15dbbf5617523655-previous-name", 19 | "nasName": "dummy-nas-server" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /service/features/array-config/config.2: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "14dbbf5617523654" 9 | "nasName": "dummy-nas-server" 10 | }, 11 | { 12 | "endpoint": "http://127.0.0.2", 13 | "username": "username", 14 | "password": "password", 15 | "insecure": true, 16 | "isDefault": false, 17 | "systemID": "15dbbf5617523655" 18 | "nasName": "dummy-nas-server" 19 | }, 20 | { 21 | "username": "username", 22 | "password": "password", 23 | "systemID": "1235e15806d1ec0f", 24 | "endpoint": "https://1.2.3.4", 25 | "insecure": true, 26 | "isDefault": false 27 | "nasName": "dummy-nas-server" 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /service/features/array-config/duplicate_system_ID: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "username": "username", 4 | "password": "password", 5 | "systemID": "DUPLICATE", 6 | "endpoint": "https://107.0.0.1", 7 | "insecure": true, 8 | "isDefault": true, 9 | "mdm": "10.0.0.1" 10 | }, 11 | { 12 | "username": "username", 13 | "password": "password", 14 | "systemID": "DUPLICATE", 15 | "endpoint": "https://107.0.0.1", 16 | "insecure": true, 17 | "mdm": "10.0.0.1" 18 | } 19 | ] -------------------------------------------------------------------------------- /service/features/array-config/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/csi-powerflex/40428946091e37d08bebedfb2faac4cd01f6248f/service/features/array-config/empty -------------------------------------------------------------------------------- /service/features/array-config/invalid_endpoint: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "123" 9 | } 10 | ] -------------------------------------------------------------------------------- /service/features/array-config/invalid_multi_az: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "14dbbf5617523654", 9 | "zone": { 10 | "name": "notExistent", 11 | "protectionDomains": [ 12 | { 13 | "name": "bad", 14 | "pools": [ 15 | "badPool" 16 | ] 17 | } 18 | ] 19 | } 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /service/features/array-config/invalid_password: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "username", 5 | "password": "", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "123" 9 | } 10 | ] -------------------------------------------------------------------------------- /service/features/array-config/invalid_system_name: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "" 9 | } 10 | ] -------------------------------------------------------------------------------- /service/features/array-config/invalid_username: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "123" 9 | } 10 | ] -------------------------------------------------------------------------------- /service/features/array-config/multi_az: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "14dbbf5617523654", 9 | "zone": { 10 | "name": "zoneA", 11 | "labelKey": "zone.csi-vxflexos.dellemc.com", 12 | "protectionDomains": [ 13 | { 14 | "name": "mocksystem", 15 | "pools": [ 16 | "viki_pool_HDD_20181031" 17 | ] 18 | } 19 | ] 20 | } 21 | }, 22 | { 23 | "endpoint": "http://127.0.0.2", 24 | "username": "username", 25 | "password": "password", 26 | "skipCertificateValidation": true, 27 | "isDefault": false, 28 | "systemID": "15dbbf5617523655", 29 | "zone": { 30 | "name": "zoneB", 31 | "labelKey": "zone.csi-vxflexos.dellemc.com", 32 | "protectionDomains": [ 33 | { 34 | "name": "mocksystem", 35 | "pools": [ 36 | "viki_pool_HDD_20181031" 37 | ] 38 | } 39 | ] 40 | } 41 | } 42 | ] 43 | -------------------------------------------------------------------------------- /service/features/array-config/multi_az_custom_labels: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "14dbbf5617523654", 9 | "zone": { 10 | "name": "zone1", 11 | "labelKey": "topology.k8s.io/zone", 12 | "protectionDomains": [ 13 | { 14 | "name": "pd", 15 | "pools": [ 16 | "pool1" 17 | ] 18 | } 19 | ] 20 | } 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /service/features/array-config/replication-config: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "http://127.0.0.1", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "14dbbf5617523654" 9 | }, 10 | { 11 | "endpoint": "http://127.0.0.1", 12 | "username": "username", 13 | "password": "password", 14 | "skipCertificateValidation": true, 15 | "isDefault": false, 16 | "systemID": "15dbbf5617523655" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /service/features/array-config/simple-config.yaml: -------------------------------------------------------------------------------- 1 | - username: "user" 2 | password: "pass" 3 | systemID: "systemid" 4 | endpoint: "https://192.168.1.12" 5 | skipCertificateValidation: true 6 | isDefault: true 7 | mdm: "192.168.1.10,192.168.1.11" 8 | -------------------------------------------------------------------------------- /service/features/array-config/two_default_array: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "username": "username", 4 | "password": "password", 5 | "systemID": "321", 6 | "endpoint": "https://107.0.0.1", 7 | "insecure": true, 8 | "isDefault": true, 9 | "mdm": "10.0.0.1" 10 | }, 11 | { 12 | "username": "username", 13 | "password": "password", 14 | "systemID": "123", 15 | "endpoint": "https://107.0.0.2", 16 | "insecure": true, 17 | "isDefault": true, 18 | "mdm": "10.0.0.1" 19 | } 20 | ] -------------------------------------------------------------------------------- /service/features/array-config/unable_to_parse: -------------------------------------------------------------------------------- 1 | unable to parse this file -------------------------------------------------------------------------------- /service/features/array-config/zero_length: -------------------------------------------------------------------------------- 1 | [ 2 | 3 | ] -------------------------------------------------------------------------------- /service/features/authorization_failure.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Unauthorized", 3 | "httpStatusCode": 401, 4 | "errorCode": 0 5 | } 6 | 7 | -------------------------------------------------------------------------------- /service/features/bad_system.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "perfProfile": "Default", 4 | "installId": "1c078b073d75512c", 5 | "name": "xxxxx", 6 | "id": "0000000" 7 | } 8 | ] 9 | 10 | -------------------------------------------------------------------------------- /service/features/create_snapshot.json: -------------------------------------------------------------------------------- 1 | { 2 | "snapshotGroupId": "f30216fb00000001", 3 | "volumeIdList": [ 4 | "72cee42500000003" 5 | ] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /service/features/create_snapshot2.json: -------------------------------------------------------------------------------- 1 | this file is to force the driver to fail at creating a snapshot. 2 | It helps boost unit test coverage 3 | -------------------------------------------------------------------------------- /service/features/driver-config/logConfig.yaml: -------------------------------------------------------------------------------- 1 | CSI_LOG_LEVEL: "INFO" 2 | CSI_LOG_FORMAT: "TEXT" 3 | -------------------------------------------------------------------------------- /service/features/driver-config/logConfig2.yaml: -------------------------------------------------------------------------------- 1 | CSI_LOG_LEVEL: "TRACE" 2 | CSI_LOG_FORMAT: "JSON" 3 | -------------------------------------------------------------------------------- /service/features/driver-config/logConfigWrong.yaml: -------------------------------------------------------------------------------- 1 | CSI_LOG_LEVEL: "NOT_VALID" 2 | CSI_LOG_FORMAT: "" 3 | -------------------------------------------------------------------------------- /service/features/filesystem.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "id": "__ID__", 3 | "name": "__NAME__", 4 | "description": "FS modified", 5 | "storage_pool_id": "e65f9c2700000000", 6 | "nas_server_id": "63ec8e0d-4551-29a7-e79c-b202f2b914f3", 7 | "parent_id": "__PARENT_ID__", 8 | "type": "PRIMARY", 9 | "size_total": __SIZE_IN_Total__, 10 | "size_used": 1620312064, 11 | "protection_policy_id": null, 12 | "access_policy": "NATIVE", 13 | "locking_policy": "ADVISORY", 14 | "folder_rename_policy": "ALL_FORBIDDEN", 15 | "is_smb_sync_writes_enabled": false, 16 | "is_smb_op_locks_enabled": true, 17 | "is_smb_no_notify_enabled": false, 18 | "is_smb_notify_on_access_enabled": false, 19 | "is_smb_notify_on_write_enabled": false, 20 | "smb_notify_on_change_dir_depth": 512, 21 | "is_async_MTime_enabled": false, 22 | "is_quota_enabled": __IS_QUOTA_ENABLED__, 23 | "grace_period": 86400, 24 | "default_hard_limit": 6442450944, 25 | "default_soft_limit": 3221225472, 26 | "creation_timestamp": null, 27 | "expiration_timestamp": null, 28 | "last_refresh_timestamp": null, 29 | "last_writable_timestamp": null, 30 | "is_modified": null, 31 | "access_type": null, 32 | "creator_type": null, 33 | "type_l10n": null, 34 | "access_policy_l10n": null, 35 | "locking_policy_l10n": null, 36 | "folder_rename_policy_l10n": null, 37 | "access_type_l10n": null, 38 | "creator_type_l10n": null 39 | } -------------------------------------------------------------------------------- /service/features/get_file_interface.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "63ec8e22-c679-f44e-1fd2-b202f2b914f3", 3 | "nas_server_id": "63ec8e0d-4551-29a7-e79c-b202f2b914f3", 4 | "ip_address": "1.2.3.4", 5 | "prefix_length": 21, 6 | "gateway": "1.2.3.4", 7 | "vlan_id": 0, 8 | "name": "dummy_6d0b7cdc848d_3", 9 | "role": "dummy", 10 | "is_disabled": false, 11 | "role_l10n": null 12 | } -------------------------------------------------------------------------------- /service/features/get_file_system_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "64a6fffa-dd25-7a70-7db6-5643ff849351", 3 | "name": "dummy-file-system", 4 | "description": "FS modified", 5 | "storage_pool_id": "e65f9c2700000000", 6 | "nas_server_id": "63ec8e0d-4551-29a7-e79c-b202f2b914f3", 7 | "parent_id": null, 8 | "type": "PRIMARY", 9 | "size_total": 8589934592, 10 | "size_used": 1620312064, 11 | "protection_policy_id": null, 12 | "access_policy": "NATIVE", 13 | "locking_policy": "ADVISORY", 14 | "folder_rename_policy": "ALL_FORBIDDEN", 15 | "is_smb_sync_writes_enabled": false, 16 | "is_smb_op_locks_enabled": true, 17 | "is_smb_no_notify_enabled": false, 18 | "is_smb_notify_on_access_enabled": false, 19 | "is_smb_notify_on_write_enabled": false, 20 | "smb_notify_on_change_dir_depth": 512, 21 | "is_async_MTime_enabled": false, 22 | "is_quota_enabled": true, 23 | "grace_period": 86400, 24 | "default_hard_limit": 6442450944, 25 | "default_soft_limit": 3221225472, 26 | "creation_timestamp": null, 27 | "expiration_timestamp": null, 28 | "last_refresh_timestamp": null, 29 | "last_writable_timestamp": null, 30 | "is_modified": null, 31 | "access_type": null, 32 | "creator_type": null, 33 | "type_l10n": null, 34 | "access_policy_l10n": null, 35 | "locking_policy_l10n": null, 36 | "folder_rename_policy_l10n": null, 37 | "access_type_l10n": null, 38 | "creator_type_l10n": null 39 | } -------------------------------------------------------------------------------- /service/features/get_nas_server_id.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "id": "63ec8e0d-4551-29a7-e79c-b202f2b914f3", 4 | "name": "dummy-nas-server", 5 | "protection_domain_id": "b8b3919900000000", 6 | "storage_pool_id": "e65f9c2700000000", 7 | "description": "", 8 | "operational_status": "Started", 9 | "primary_node_id": "63ec82a8-e065-1fdf-05e0-c4c77e59be30", 10 | "backup_node_id": "63ec82df-d022-5bfa-7877-e8030994cee3", 11 | "default_unix_user": null, 12 | "default_windows_user": null, 13 | "nfs_servers": null, 14 | "current_unix_directory_service": "None", 15 | "is_username_translation_enabled": false, 16 | "is_auto_user_mapping_enabled": false, 17 | "production_IPv4_interface_id": null, 18 | "production_IPv6_interface_id": null, 19 | "backup_IPv4_interface_id": null, 20 | "backup_IPv6_interface_id": null, 21 | "current_preferred_IPv4_interface_id": "63ec8e22-c679-f44e-1fd2-b202f2b914f3", 22 | "current_preferred_IPv6_interface_id": null, 23 | "operational_status_l10n": null, 24 | "current_unix_directory_service_l10n": null 25 | } 26 | -------------------------------------------------------------------------------- /service/features/get_nas_servers.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "63ec8e0d-4551-29a7-e79c-b202f2b914f3", 4 | "name": "dummy-nas-server", 5 | "protection_domain_id": "b8b3919900000000", 6 | "storage_pool_id": "e65f9c2700000000", 7 | "description": "", 8 | "operational_status": "Started", 9 | "primary_node_id": "63ec82a8-e065-1fdf-05e0-c4c77e59be30", 10 | "backup_node_id": "63ec82df-d022-5bfa-7877-e8030994cee3", 11 | "default_unix_user": null, 12 | "default_windows_user": null, 13 | "nfs_servers": null, 14 | "current_unix_directory_service": "None", 15 | "is_username_translation_enabled": false, 16 | "is_auto_user_mapping_enabled": false, 17 | "production_IPv4_interface_id": null, 18 | "production_IPv6_interface_id": null, 19 | "backup_IPv4_interface_id": null, 20 | "backup_IPv6_interface_id": null, 21 | "current_preferred_IPv4_interface_id": "63ec8e22-c679-f44e-1fd2-b202f2b914f3", 22 | "current_preferred_IPv6_interface_id": null, 23 | "operational_status_l10n": null, 24 | "current_unix_directory_service_l10n": null 25 | } 26 | ] 27 | 28 | -------------------------------------------------------------------------------- /service/features/get_peer_mdms.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "d02aebc400000000", 4 | "name": "10.247.38.62", 5 | "port": 7611, 6 | "peerSystemId": "15dbbf5617523655", 7 | "systemId": "14dbbf5617523654", 8 | "softwareVersionInfo": "R3_6.400.0", 9 | "membershipState": "Joined", 10 | "perfProfile": "HighPerformance", 11 | "networkType": "External", 12 | "couplingRC": "SUCCESS" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /service/features/get_sdc_instances.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "versionInfo": null, 3 | "perfProfile": "Default", 4 | "sdcApproved": true, 5 | "osType": "Linux", 6 | "mdmConnectionState": "Connected", 7 | "memoryAllocationFailure": null, 8 | "socketAllocationFailure": null, 9 | "softwareVersionInfo": null, 10 | "sdcGuid": "9E56672F-2F4B-4A42-BFF4-88B6846FBFDA", 11 | "installedSoftwareVersionInfo": "R2_6.0.0", 12 | "kernelVersion": "3.10.0", 13 | "kernelBuildNumber": null, 14 | "sdcIps": ["127.1.1.11"], 15 | "sdcApprovedIps": null, 16 | "systemId": "14dbbf5617523654", 17 | "name": "__NAME__", 18 | "id": "__ID__", 19 | "links": [ 20 | { 21 | "rel": "self", 22 | "href": "/api/instances/Sdc::d0f055a700000000" 23 | }, 24 | { 25 | "rel": "/api/Sdc/relationship/Statistics", 26 | "href": "/api/instances/Sdc::d0f055a700000000/relationships/Statistics" 27 | }, 28 | { 29 | "rel": "/api/Sdc/relationship/Volume", 30 | "href": "/api/instances/Sdc::d0f055a700000000/relationships/Volume" 31 | }, 32 | { 33 | "rel": "/api/parent/relationship/systemId", 34 | "href": "/api/instances/System::14dbbf5617523654" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /service/features/get_volume_statistics.json: -------------------------------------------------------------------------------- 1 | { 2 | "userDataReadBwc": { 3 | "numSeconds": 1, 4 | "totalWeightInKb": 1, 5 | "numOccured": 1 6 | }, 7 | "userDataWriteBwc": { 8 | "numSeconds": 2, 9 | "totalWeightInKb": 2, 10 | "numOccured": 2 11 | }, 12 | "mappedSdcIds": ["9E56672F-2F4B-4A42-BFF4-88B6846FBFDA"], 13 | "numOfMappedSdcs": 1 14 | } 15 | -------------------------------------------------------------------------------- /service/features/nfsexport.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "id": "__ID__", 3 | "file_system_id": "__FS_ID__", 4 | "name": "__NAME__", 5 | "path": "__PATH__", 6 | "description": null, 7 | "default_access": "ROOT", 8 | "min_security": "SYS", 9 | "nfs_owner_username": "root", 10 | "no_access_hosts": [], 11 | "read_only_hosts": ["__READ_HOSTS__"], 12 | "read_only_root_hosts": ["__READ_ROOT_HOSTS__"], 13 | "read_write_hosts": ["__WRITE_HOSTS__"], 14 | "read_write_root_hosts": ["__WRITE_ROOT_HOSTS__"], 15 | "anonymous_UID": -2, 16 | "anonymous_GID": -2, 17 | "is_no_SUID": false, 18 | "default_access_l10n": null, 19 | "min_security_l10n": null 20 | } 21 | -------------------------------------------------------------------------------- /service/features/replication_consistency_group.template: -------------------------------------------------------------------------------- 1 | { 2 | "id": "__ID__", 3 | "name": "__NAME__", 4 | "rpoInSeconds": 60, 5 | "protectionDomainId": "__PROTECTION_DOMAIN__", 6 | "remoteProtectionDomainId": "__RM_PROTECTION_DOMAIN__", 7 | "peerMdmId": "d02aebc400000000", 8 | "remoteId": "246701fb00000001", 9 | "remoteMdmId": "15dbbf5617523655", 10 | "replicationDirection": "__REP_DIR__", 11 | "currConsistMode": "__MODE__", 12 | "freezeState": "Unfrozen", 13 | "pauseMode": "__P_MODE__", 14 | "lifetimeState": "Normal", 15 | "type": "User", 16 | "disasterRecoveryState": "None", 17 | "remoteDisasterRecoveryState": "None", 18 | "targetVolumeAccessMode": "NoAccess", 19 | "failoverType": "__FO_TYPE__", 20 | "failoverState": "__FO_STATE__", 21 | "activeLocal": true, 22 | "activeRemote": true, 23 | "abstractState": "__STATE__", 24 | "error": 65, 25 | "localActivityState": "Active", 26 | "remoteActivityState": "Active", 27 | "inactiveReason": 11, 28 | "links": [ 29 | { 30 | "rel": "self", 31 | "href": "/api/instances/ReplicationConsistencyGroup::__ID__" 32 | }, 33 | { 34 | "rel": "/api/ReplicationConsistencyGroup/relationship/Statistics", 35 | "href": "/api/instances/ReplicationConsistencyGroup::__ID__/relationships/Statistics" 36 | }, 37 | { 38 | "rel": "/api/ReplicationConsistencyGroup/relationship/ReplicationPair", 39 | "href": "/api/instances/ReplicationConsistencyGroup::__ID__/relationships/ReplicationPair" 40 | }, 41 | { 42 | "rel": "/api/parent/relationship/peerMdmId", 43 | "href": "/api/instances/PeerMdm::d02aebc400000000" 44 | }, 45 | { 46 | "rel": "/api/parent/relationship/protectionDomainId", 47 | "href": "/api/instances/ProtectionDomain::1dee83c600000000" 48 | } 49 | ] 50 | } 51 | 52 | -------------------------------------------------------------------------------- /service/features/replication_pair.template: -------------------------------------------------------------------------------- 1 | { 2 | "id": "__ID__", 3 | "name": "__NAME__", 4 | "remoteId": "9566f43400000002", 5 | "userRequestedPauseTransmitInitCopy": false, 6 | "remoteCapacityInMB": 49152, 7 | "localVolumeId": "__SOURCE_VOLUME__", 8 | "remoteVolumeId": "__DESTINATION_VOLUME__", 9 | "remoteVolumeName": "replication-target", 10 | "replicationConsistencyGroupId": "__RP_GROUP__", 11 | "copyType": "Identical", 12 | "lifetimeState": "Normal", 13 | "peerSystemName": "", 14 | "initialCopyState": "Done", 15 | "initialCopyPriority": 0 16 | } 17 | 18 | -------------------------------------------------------------------------------- /service/features/treequota.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "id": "__ID__", 3 | "file_system_id": "766f6c2d696e74746573742d6e6673", 4 | "path": "__PATH__", 5 | "description": "tree quota modified", 6 | "is_user_quotas_enforced": false, 7 | "state": "OK", 8 | "hard_limit": __HARD_LIMIT_SIZE__, 9 | "soft_limit": __SOFT_LIMIT_SIZE__, 10 | "remaining_grace_period": __GRACE_PERIOD__, 11 | "size_used": 0 12 | } -------------------------------------------------------------------------------- /service/features/volume.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "sizeInKb": __SIZE_IN_KB__, 3 | "vtreeId": "c36a59ef00000001", 4 | "storagePoolId": "e65f9c2700000000", 5 | "isObfuscated": false, 6 | "volumeType": "ThickProvisioned", 7 | "consistencyGroupID": "__CONSISTENCY_GROUP_ID__", 8 | "ancestorVolumeId": "__ANCESTOR_ID__", 9 | "useRmcache": true, 10 | "creationTime": 1542129719, 11 | "mappedSdcInfo": __MAPPED_SDC_INFO__, 12 | "mappingToAllSdcsEnabled": false, 13 | "isVvol": false, 14 | "name": "__NAME__", 15 | "id": "__ID__", 16 | "volumeReplicationState": "__VOLUME_REPLICATION_STATE__", 17 | "links": [ 18 | { 19 | "rel": "self", 20 | "href": "/api/instances/Volume::__ID__" 21 | }, 22 | { 23 | "rel": "/api/Volume/relationship/Statistics", 24 | "href": "/api/instances/Volume::__ID__/relationships/Statistics" 25 | }, 26 | { 27 | "rel": "/api/parent/relationship/vtreeId", 28 | "href": "/api/instances/VTree::c36a59ef00000001" 29 | }, 30 | { 31 | "rel": "/api/parent/relationship/storagePoolId", 32 | "href": "/api/instances/StoragePool::e65f9c2700000000" 33 | } 34 | ] 35 | } 36 | 37 | -------------------------------------------------------------------------------- /service/identity_test.gox: -------------------------------------------------------------------------------- 1 | // Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | 14 | package service_test 15 | 16 | import ( 17 | "context" 18 | "testing" 19 | 20 | csi "github.com/container-storage-interface/spec/lib/go/csi/v0" 21 | "github.com/stretchr/testify/assert" 22 | 23 | "emc.dell.com/vxflexos-csi/core" 24 | "emc.dell.com/vxflexos-csi/service" 25 | ) 26 | 27 | func TestPluginInfo(t *testing.T) { 28 | 29 | ctx := context.Background() 30 | 31 | gclient, stop := startServer(ctx, t) 32 | defer stop() 33 | 34 | client := csi.NewIdentityClient(gclient) 35 | 36 | info, err := client.GetPluginInfo(ctx, 37 | &csi.GetPluginInfoRequest{}) 38 | 39 | assert.NoError(t, err) 40 | assert.Equal(t, info.GetName(), service.Name) 41 | assert.Equal(t, info.GetVendorVersion(), core.SemVer) 42 | } 43 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | all: help 3 | 4 | help: 5 | @echo 6 | @echo "The following targets are commonly used:" 7 | @echo 8 | @echo "integration - Run integration tests" 9 | @echo "zone-integration - Run zone-integration tests" 10 | @echo "zone-e2e - Run zone-e2e tests" 11 | @echo 12 | 13 | .PHONY: integration 14 | integration: 15 | cd integration; ./run.sh TestIntegration 16 | 17 | .PHONY: zone-integration 18 | zone-integration: 19 | cd integration; ./run.sh TestZoneIntegration 20 | 21 | .PHONY: zone-e2e 22 | zone-e2e: 23 | go test -tags=integration -v -count=1 -timeout 1h -run '^TestZoneVolumes$$' ./e2e 24 | -------------------------------------------------------------------------------- /test/certification/README.md: -------------------------------------------------------------------------------- 1 | # OpenShift CSI certification tests 2 | 3 | This directory contains information for running the RedHat OpenShift certification tests. 4 | 5 | ## Requirements 6 | 7 | * An OpenShift cluster 8 | * The number of pods that can be scheduled per node must be configured to 350 or higher. OpenShift sets the limit to 250, but the LUN Stress test will attempt to schedule 260 pods on a single node. 9 | * The driver already installed with controller pods scheduled to master nodes. 10 | * A container runner, e.g. docker or podman. 11 | * A Kubeconfig from the target cluster named `kubeconfig.yaml`. 12 | * A [storage class](https://github.com/dell/csi-powerflex/tree/main/samples/storageclass) named `storageclass.yaml` 13 | * A [volume snapshot class](https://github.com/dell/csi-powerflex/tree/main/samples/volumesnapshotclass) named `snapclass.yaml` 14 | 15 | ## Running the tests 16 | 1. Ensure all YAML manifests are in the same directory. 17 | 2. Prepare the following files: 18 | - `kubeconfig.yaml` 19 | - `upstream-manifest.yaml` 20 | - `storageclass.yaml` 21 | - `snapclass.yaml` 22 | 3. Create and prepare `pull-secret.json` with credentials to access the Red Hat catalog. 23 | 4. Pull the tester container image that corresponds to your OpenShift cluster version: 24 | ```bash 25 | $ podman pull --authfile pull-secret.json $(oc adm release info --image-for=tests) 26 | ``` 27 | **Note**: There may be a newer [OCP End to End image](https://catalog.redhat.com/search?gs&q=OpenShift%20End-to-End%20Tests) available. 28 | 6. The `openshift-tests` binary in the container image can be found at `/usr/bin/openshift-tests`. 29 | - `/usr/bin/openshift-tests run openshift/csi --dry-run` will list the names of tests that will run. 30 | - `/usr/bin/openshift-tests run openshift/csi` will run all certification tests. 31 | - `/usr/bin/openshift-tests run openshift/csi --run=` will run a set of monitors and specific tests. 32 | - `/usr/bin/openshift-tests run openshift/csi run-test ` will run a single test, without any monitors. 33 | 7. Prepare `run.sh` for the test(s) you want to execute. 34 | 35 | Example for running the LUN Stress test: 36 | ```bash 37 | $ podman run -v $DATA:/data:z --rm -it $TESTIMAGE sh -c "KUBECONFIG=/data/kubeconfig.yaml TEST_CSI_DRIVER_FILES=/data/manifest.yaml TEST_OCP_CSI_DRIVER_FILES=/data/ocp-manifest.yaml /usr/bin/openshift-tests run-test 'External Storage [Driver: csi-vxflexos.dellemc.com] [Testpattern: Dynamic PV (filesystem volmode)] OpenShift CSI extended - SCSI LUN Overflow should use many PVs on a single node [Serial][Timeout:40m]' |& tee test.log 38 | ``` 39 | 8. Run inside of the openshift-tests container image: 40 | ```bash 41 | $ sh run.sh 42 | ``` 43 | 44 | #### Tips: 45 | - More usage on the `openshift-tests` container image can be found [here](https://github.com/openshift/origin/blob/main/test/extended/storage/csi/README.md#usage). 46 | - By default, `X_CSI_MAX_VOLUMES_PER_NODE` is set to 0. Set this value to 350 or higher in the driver daemonset to guarantee the number of volumes that can be published by the controller to the node. 47 | - If mounting errors occur, such as `mount(2) system call failed: Structure needs cleaning`, it may indicate too many files open on the worker node. Diagnose the issue by checking kernel logs or running the lsof command. Rebooting the worker nodes in the cluster will also decrease the number of open files. 48 | -------------------------------------------------------------------------------- /test/certification/ocp-manifest.yaml: -------------------------------------------------------------------------------- 1 | Driver: csi-vxflexos.dellemc.com 2 | LUNStressTest: 3 | PodsTotal: 260 4 | Timeout: "40m" 5 | -------------------------------------------------------------------------------- /test/certification/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | trap "echo Can't stop now!" INT 3 | 4 | TIMESTAMP=$(date +%Y%m%d%H%M%S) 5 | DATA=/home/LUNStress/$TIMESTAMP 6 | TESTIMAGE=$(oc adm release info --image-for=tests) 7 | 8 | mkdir $DATA || exit 1 9 | 10 | for i in manifest.yaml ocp-manifest.yaml kubeconfig.yaml storageclass.yaml snapclass.yaml; do 11 | cp $i $DATA/$i 12 | done 13 | 14 | podman run -v $DATA:/data:z --rm -it $TESTIMAGE sh -c "KUBECONFIG=/data/kubeconfig.yaml TEST_CSI_DRIVER_FILES=/data/manifest.yaml TEST_OCP_CSI_DRIVER_FILES=/data/ocp-manifest.yaml /usr/bin/openshift-tests run openshift/csi --dry-run" |& tee test.log 15 | 16 | tar -C $DATA -czf $TIMESTAMP/results-$TIMESTAMP.tar.gz results *yaml 17 | -------------------------------------------------------------------------------- /test/certification/upstream-manifest.yaml: -------------------------------------------------------------------------------- 1 | ShortName: powerflex 2 | StorageClass: 3 | # Load a StorageClass from the given file. This file must be in the same directory as this one 4 | FromFile: storageclass.yaml 5 | 6 | SnapshotClass: 7 | FromName: true 8 | FromFile: snapclass.yaml 9 | 10 | DriverInfo: 11 | # Internal name of the driver, this is used as a display name in the test case and test objects 12 | Name: csi-vxflexos.dellemc.com 13 | 14 | # The range of disk size supported by this driver 15 | SupportedSizeRange: 16 | Min: 8Gi 17 | Max: 16Ti 18 | 19 | # Map of strings for supported FS types 20 | SupportedFsType: 21 | ext4: {} 22 | xfs: {} 23 | 24 | # Map of strings for supported mount options 25 | SupportedMountOption: 26 | dirsync: {} 27 | 28 | # Optional list of topology keys that the driver supports 29 | TopologyKeys: ["csi-vxflexos.dellemc.com/[INSERT SYSTEM ID]"] 30 | # Optional number of allowed topologies that the driver requires. Only relevant if TopologyKeys is set 31 | NumAllowedTopologies: 1 32 | 33 | # Map of strings for required mount options 34 | # RequiredMountOption: 35 | 36 | # Optional list of access modes required for provisiong. Default is RWO 37 | RequiredAccessModes: 38 | - ReadWriteOnce 39 | 40 | # Map that represents the capabilities the driver supports 41 | Capabilities: 42 | # Data is persistest accross pod restarts 43 | persistence: true 44 | 45 | # Volume ownership via fsGroup 46 | fsGroup: true 47 | 48 | # Raw block mode 49 | block: true 50 | 51 | # Exec a file in the volume 52 | exec: true 53 | 54 | # Support for volume limits 55 | volumeLimits: false 56 | 57 | # Support for volume expansion in controllers 58 | controllerExpansion: true 59 | 60 | # Support for volume expansion in nodes 61 | nodeExpansion: true 62 | 63 | # Support volume that an run on single node only (like hostpath) 64 | singleNodeVolume: false 65 | 66 | # Support ReadWriteMany access modes 67 | RWX: false 68 | 69 | # Support topology 70 | topology: true 71 | 72 | # Support populate data from snapshot 73 | snapshotDataSource: true 74 | 75 | # Support populated data from PVC 76 | pvcDataSource: true 77 | 78 | StressTestOptions: 79 | NumPods: 10 80 | NumRestarts: 20 81 | NumSnapshots: 10 82 | -------------------------------------------------------------------------------- /test/e2e-fsgroup/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright © 2020-2025 Dell Inc. or its subsidiaries. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # 16 | # Makefile for FSGroup e2e Tests 17 | 18 | # Variables 19 | GINKGO_BIN_PATH = /root/go/bin/ginkgo 20 | GINKGO_INSTALL_CMD = go install github.com/onsi/ginkgo/v2/ginkgo 21 | GINKGO_DEST_PATH = /usr/bin/ginkgo 22 | 23 | # Default target to run all tasks 24 | .PHONY: all 25 | all: install-ginkgo run-tests 26 | 27 | # Target to install Ginkgo v2, verify the installation, and move the binary 28 | .PHONY: install-ginkgo 29 | install-ginkgo: 30 | @echo "Installing Ginkgo v2..." 31 | $(GINKGO_INSTALL_CMD) 32 | @echo "Verifying Ginkgo installation..." 33 | $(GINKGO_BIN_PATH) version 34 | @echo "Moving Ginkgo binary to /usr/bin..." 35 | sudo mv $(GINKGO_BIN_PATH) $(GINKGO_DEST_PATH) 36 | 37 | # Target to run FSGroup e2e tests 38 | .PHONY: run-tests 39 | run-tests: 40 | @echo "Running FSGroup e2e tests..." 41 | ./run.sh 42 | -------------------------------------------------------------------------------- /test/e2e-fsgroup/e2e-values.yaml: -------------------------------------------------------------------------------- 1 | kubeconfigEnvVar: "KUBECONFIG" 2 | busyBoxImageOnGcr: "gcr.io/google_containers/busybox:1.27" 3 | 4 | driverNamespace: "vxflexos" 5 | e2eCSIDriverName: "csi-vxflexos.dellemc.com" 6 | 7 | scParamStoragePoolKey: "storagepool" 8 | scParamStoragePoolValue: "sample" 9 | 10 | scParamFsTypeKey: "csi.storage.k8s.io/fstype" 11 | scParamFsTypeValue: "ext4" 12 | 13 | scParamStorageSystemKey: "systemID" 14 | scParamStorageSystemValue: "sample" 15 | 16 | diskSize: "8Gi" 17 | 18 | execCommand: "while true ; do sleep 2 ; done" 19 | -------------------------------------------------------------------------------- /test/e2e-fsgroup/run.sh: -------------------------------------------------------------------------------- 1 | # Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | # run all tests 14 | ginkgo -v --focus="csi-fsg" --junit-report=test-report.xml --timeout=30m 15 | 16 | # use focus to run only one test from fs_scaleup_scaledown.go 17 | #ginkgo -mod=mod --focus="csi-scale" ./... 18 | 19 | # use focus to run only certain tests 20 | #ginkgo -mod=mod --focus=FSGroup --timeout=25m ./... 21 | 22 | # run ephemeral only test 23 | #ginkgo -mod=mod --focus="csi-ephemeral" ./... 24 | -------------------------------------------------------------------------------- /test/e2e-fsgroup/suite_test.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | 14 | package e2e 15 | 16 | import ( 17 | "flag" 18 | "os" 19 | "path/filepath" 20 | "testing" 21 | 22 | . "github.com/onsi/ginkgo/v2" 23 | . "github.com/onsi/gomega" 24 | "k8s.io/kubernetes/test/e2e/framework" 25 | "k8s.io/kubernetes/test/e2e/framework/config" 26 | ) 27 | 28 | func init() { 29 | var yamlError error 30 | 31 | testParameters, yamlError = readYaml() 32 | if yamlError != nil { 33 | framework.Failf("Unable to read yaml e2e-values.yaml: %s", yamlError.Error()) 34 | } 35 | 36 | // k8s.io/kubernetes/tests/e2e/framework requires env KUBECONFIG to be set 37 | // it does not fall back to defaults 38 | if os.Getenv(testParameters["kubeconfigEnvVar"]) == "" { 39 | kubeconfig := filepath.Join(os.Getenv("HOME"), ".kube", "config") 40 | os.Setenv(testParameters["kubeconfigEnvVar"], kubeconfig) 41 | } 42 | 43 | framework.TestContext.Provider = "local" 44 | 45 | t := framework.TestContextType{} 46 | 47 | framework.AfterReadingAllFlags(&t) 48 | } 49 | 50 | func TestE2E(t *testing.T) { 51 | handleFlags() 52 | RegisterFailHandler(Fail) 53 | 54 | // dont dump huge logs of node / pods on error 55 | framework.TestContext.DumpLogsOnFailure = false 56 | 57 | // runs all ginkgo tests in go files 58 | RunSpecs(t, "CSI Driver End-to-End Tests") 59 | } 60 | 61 | func handleFlags() { 62 | config.CopyFlags(config.Flags, flag.CommandLine) 63 | framework.RegisterCommonFlags(flag.CommandLine) 64 | framework.RegisterClusterFlags(flag.CommandLine) 65 | flag.Parse() 66 | } 67 | -------------------------------------------------------------------------------- /test/e2e-fsgroup/testing-manifests/pod/ephemeral.yaml: -------------------------------------------------------------------------------- 1 | kind: Pod 2 | apiVersion: v1 3 | metadata: 4 | name: my-csi-app-inline-volumes 5 | spec: 6 | securityContext: 7 | runAsNonRoot: true 8 | runAsUser: 54321 9 | fsGroup: 54321 10 | containers: 11 | - name: my-frontend 12 | image: busybox 13 | command: ["sleep", "100000"] 14 | volumeMounts: 15 | - mountPath: "/data0" 16 | name: my-csi-volume 17 | - mountPath: "/data1" 18 | name: my-csi-volume-xfs 19 | securityContext: 20 | runAsUser: 54321 21 | allowPrivilegeEscalation: false 22 | volumes: 23 | - name: my-csi-volume 24 | csi: 25 | driver: csi-vxflexos.dellemc.com 26 | fsType: "ext4" 27 | volumeAttributes: 28 | volumeName: "my-csi-volume" 29 | size: "8Gi" 30 | storagepool: ephemeral 31 | systemID: ephemeral 32 | - name: my-csi-volume-xfs 33 | csi: 34 | driver: csi-vxflexos.dellemc.com 35 | fsType: "xfs" 36 | volumeAttributes: 37 | volumeName: "my-csi-volume-xfs" 38 | size: "10Gi" 39 | storagepool: ephemeral 40 | systemID: ephemeral 41 | -------------------------------------------------------------------------------- /test/e2e-fsgroup/testing-manifests/statefulset/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: fsgroup 5 | spec: 6 | replicas: 3 7 | selector: 8 | matchLabels: 9 | app: fsgroup 10 | template: 11 | metadata: 12 | labels: 13 | app: fsgroup 14 | spec: 15 | securityContext: 16 | runAsNonRoot: true 17 | runAsUser: 54321 18 | fsGroup: 54321 19 | containers: 20 | - name: busybox 21 | image: gcr.io/google_containers/busybox:1.27 22 | command: ["/bin/sh", "-c", "sleep 3600"] 23 | volumeMounts: 24 | - name: www 25 | mountPath: /data 26 | securityContext: 27 | runAsUser: 54321 28 | allowPrivilegeEscalation: false 29 | volumeClaimTemplates: 30 | - metadata: 31 | name: www 32 | annotations: 33 | volume.beta.kubernetes.io/storage-class: fsgroup-sc 34 | spec: 35 | accessModes: ["ReadWriteOnce"] 36 | resources: 37 | requests: 38 | storage: 8Gi 39 | -------------------------------------------------------------------------------- /test/e2e/README.md: -------------------------------------------------------------------------------- 1 | # End-to-End Tests Overview 2 | 3 | ## Prerequisite 4 | 5 | A couple of assumptions made in the e2e tests are that the driver runs with a valid secret. Other assumptions are: 6 | 7 | 1. The namespace `vxflexos-test` exists since all k8s objects will be created and checked for there. 8 | 2. For `multi-available-zone` tests, the storage class `vxflexos-az-wait` exists (see [storage class](../../samples/storageclass/storageclass-az.yaml) for example). 9 | 3. For `multi-available-zone` tests, the nodes should be configured correctly as the test will pull out the zoneLabelKey and compare across the nodes and storage class. 10 | 11 | ## Using the Makefile 12 | 13 | In the root `test` directory, there is a `Makefile` with different targets for the integration test and the e2e test. Currently, the only target is: 14 | 15 | - `make zone-e2e` -> Runs the end to end tests for `multi-available-zone`. 16 | 17 | ## Overview of Targets/Tests 18 | 19 | ### Multi-Available Zone 20 | 21 | The following tests are implemented and run during the `zone-e2e` test. 22 | 23 | 1. Creates a stateful set of 7 replicas and ensures that everything is up and ready with the zone configuration. 24 | 2. Cordons a node (marks it as unschedulable), creates 7 volumes/pods, and ensures that none gets scheduled on the cordoned node. 25 | 3. Creates a stateful set of 7 replicas, creates a snapshot and restore pod for each and ensure that they are all running. 26 | -------------------------------------------------------------------------------- /test/e2e/e2e_test.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2024-2025 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, 9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | // See the License for the specific language governing permissions and 11 | // limitations under the License. 12 | // 13 | 14 | //go:build integration 15 | // +build integration 16 | 17 | package e2e 18 | 19 | import ( 20 | "testing" 21 | 22 | "github.com/cucumber/godog" 23 | ) 24 | 25 | func TestZoneVolumes(t *testing.T) { 26 | godogOptions := godog.Options{ 27 | Format: "pretty,junit:zone-volumes-test-report.xml", 28 | Paths: []string{"features"}, 29 | Tags: "zone", 30 | TestingT: t, 31 | StopOnFailure: true, 32 | } 33 | 34 | status := godog.TestSuite{ 35 | Name: "zone-volumes", 36 | ScenarioInitializer: InitializeScenario, 37 | Options: &godogOptions, 38 | }.Run() 39 | 40 | if status != 0 { 41 | t.Fatalf("error: there were failed zone volumes tests. status: %d", status) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /test/e2e/features/e2e.feature: -------------------------------------------------------------------------------- 1 | Feature: VxFlex OS CSI interface 2 | As a consumer of the CSI interface 3 | I want to run a system test 4 | So that I know the service functions correctly. 5 | 6 | @zone 7 | Scenario: Create zone volume through k8s 8 | Given a VxFlexOS service 9 | And verify driver is configured and running correctly 10 | And verify zone information from secret in namespace 11 | Then create zone volume and pod in 12 | And check the statefulset for zones 13 | Then delete zone volume and pod in 14 | Examples: 15 | | secret | namespace | location | 16 | | "vxflexos-config" | "vxflexos" | "zone-wait" | 17 | 18 | @zone 19 | Scenario: Cordon node and create zone volume through k8s 20 | Given a VxFlexOS service 21 | And verify driver is configured and running correctly 22 | And verify zone information from secret in namespace 23 | Then cordon one node 24 | Then create zone volume and pod in 25 | And check the statefulset for zones 26 | And ensure pods aren't scheduled incorrectly and still running 27 | Then delete zone volume and pod in 28 | Examples: 29 | | secret | namespace | location | 30 | | "vxflexos-config" | "vxflexos" | "zone-wait" | 31 | 32 | @zone 33 | Scenario: Create zone voume and snapshots 34 | Given a VxFlexOS service 35 | And verify driver is configured and running correctly 36 | And verify zone information from secret in namespace 37 | Then create zone volume and pod in 38 | And check the statefulset for zones 39 | Then create snapshots for zone volumes and restore in 40 | And all zone restores are running 41 | Then delete snapshots for zone volumes and restore in 42 | Then delete zone volume and pod in 43 | Examples: 44 | | secret | namespace | location | 45 | | "vxflexos-config" | "vxflexos" | "zone-wait" | 46 | 47 | @zone 48 | Scenario: Create zone volume and clones 49 | Given a VxFlexOS service 50 | And verify driver is configured and running correctly 51 | And verify zone information from secret in namespace 52 | Then create zone volume and pod in 53 | And check the statefulset for zones 54 | Then create clones for zone volumes and restore in 55 | And all zone restores are running 56 | Then delete clones for zone volumes and restore in 57 | Then delete zone volume and pod in 58 | Examples: 59 | | secret | namespace | location | 60 | | "vxflexos-config" | "vxflexos" | "zone-wait" | -------------------------------------------------------------------------------- /test/e2e/templates/zone-wait/clone.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: PersistentVolumeClaim 4 | metadata: 5 | name: clone-maz-pvcITERATION 6 | namespace: vxflexos-test 7 | spec: 8 | storageClassName: vxflexos-az-wait 9 | dataSource: 10 | name: multi-az-pvc-vxflextest-az-ITERATION 11 | kind: PersistentVolumeClaim 12 | accessModes: 13 | - ReadWriteOnce 14 | resources: 15 | requests: 16 | storage: 8Gi 17 | --- 18 | apiVersion: v1 19 | kind: Pod 20 | metadata: 21 | name: clone-maz-restore-podITERATION 22 | namespace: vxflexos-test 23 | spec: 24 | containers: 25 | - name: busybox 26 | image: quay.io/quay/busybox:latest 27 | command: ["/bin/sleep", "3600"] 28 | volumeMounts: 29 | - mountPath: "/data0" 30 | name: multi-az-pvc 31 | resources: 32 | requests: 33 | cpu: "100m" 34 | memory: "128Mi" 35 | limits: 36 | cpu: "200m" 37 | memory: "256Mi" 38 | volumes: 39 | - name: multi-az-pvc 40 | persistentVolumeClaim: 41 | claimName: clone-maz-pvcITERATION 42 | -------------------------------------------------------------------------------- /test/e2e/templates/zone-wait/snapshot.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: snapshot.storage.k8s.io/v1 3 | kind: VolumeSnapshot 4 | metadata: 5 | name: snapshot-maz-ITERATION 6 | namespace: vxflexos-test 7 | spec: 8 | volumeSnapshotClassName: vxflexos-snapclass 9 | source: 10 | persistentVolumeClaimName: multi-az-pvc-vxflextest-az-ITERATION 11 | --- 12 | apiVersion: v1 13 | kind: PersistentVolumeClaim 14 | metadata: 15 | name: snapshot-maz-pvcITERATION 16 | namespace: vxflexos-test 17 | spec: 18 | dataSource: 19 | name: snapshot-maz-ITERATION 20 | kind: VolumeSnapshot 21 | apiGroup: snapshot.storage.k8s.io 22 | accessModes: 23 | - ReadWriteOnce 24 | resources: 25 | requests: 26 | storage: 8Gi 27 | --- 28 | apiVersion: v1 29 | kind: Pod 30 | metadata: 31 | name: snapshot-maz-restore-podITERATION 32 | namespace: vxflexos-test 33 | spec: 34 | containers: 35 | - name: busybox 36 | image: quay.io/quay/busybox:latest 37 | command: ["/bin/sleep", "3600"] 38 | volumeMounts: 39 | - mountPath: "/data0" 40 | name: multi-az-pvc 41 | resources: 42 | requests: 43 | cpu: "100m" 44 | memory: "128Mi" 45 | limits: 46 | cpu: "200m" 47 | memory: "256Mi" 48 | volumes: 49 | - name: multi-az-pvc 50 | persistentVolumeClaim: 51 | claimName: snapshot-maz-pvcITERATION 52 | -------------------------------------------------------------------------------- /test/e2e/templates/zone-wait/sts.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: vxflextest-az 6 | namespace: vxflexos-test 7 | --- 8 | kind: StatefulSet 9 | apiVersion: apps/v1 10 | metadata: 11 | name: vxflextest-az 12 | namespace: vxflexos-test 13 | spec: 14 | replicas: 7 15 | selector: 16 | matchLabels: 17 | app: vxflextest-az 18 | serviceName: test-az 19 | template: 20 | metadata: 21 | labels: 22 | app: vxflextest-az 23 | spec: 24 | serviceAccount: vxflextest-az 25 | containers: 26 | - name: test-ctr 27 | image: quay.io/quay/busybox:latest 28 | command: ["/bin/sleep", "3600"] 29 | volumeMounts: 30 | - mountPath: "/data0" 31 | name: multi-az-pvc 32 | volumeClaimTemplates: 33 | - metadata: 34 | name: multi-az-pvc 35 | spec: 36 | accessModes: ["ReadWriteOnce"] 37 | storageClassName: "vxflexos-az-wait" 38 | resources: 39 | requests: 40 | storage: 8Gi 41 | persistentVolumeClaimRetentionPolicy: 42 | whenDeleted: Delete 43 | whenScaled: Delete 44 | -------------------------------------------------------------------------------- /test/helm/10vols/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 10vols 2 | version: 1.0.0 3 | apiVersion: v1 4 | appVersion: 1.0.0 5 | 6 | description: | 7 | Tests VxFlexOS CSI deployments. 8 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 9 | keywords: 10 | - vxflexos-csi 11 | - storage 12 | engine: gotpl 13 | -------------------------------------------------------------------------------- /test/helm/10vols/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos 14 | --- 15 | kind: PersistentVolumeClaim 16 | apiVersion: v1 17 | metadata: 18 | name: pvol1 19 | namespace: helmtest-vxflexos 20 | spec: 21 | accessModes: 22 | - ReadWriteOnce 23 | volumeMode: Filesystem 24 | resources: 25 | requests: 26 | storage: 8Gi 27 | storageClassName: vxflexos 28 | --- 29 | kind: PersistentVolumeClaim 30 | apiVersion: v1 31 | metadata: 32 | name: pvol2 33 | namespace: helmtest-vxflexos 34 | spec: 35 | accessModes: 36 | - ReadWriteOnce 37 | volumeMode: Filesystem 38 | resources: 39 | requests: 40 | storage: 8Gi 41 | storageClassName: vxflexos 42 | --- 43 | kind: PersistentVolumeClaim 44 | apiVersion: v1 45 | metadata: 46 | name: pvol3 47 | namespace: helmtest-vxflexos 48 | spec: 49 | accessModes: 50 | - ReadWriteOnce 51 | volumeMode: Filesystem 52 | resources: 53 | requests: 54 | storage: 8Gi 55 | storageClassName: vxflexos 56 | --- 57 | kind: PersistentVolumeClaim 58 | apiVersion: v1 59 | metadata: 60 | name: pvol4 61 | namespace: helmtest-vxflexos 62 | spec: 63 | accessModes: 64 | - ReadWriteOnce 65 | volumeMode: Filesystem 66 | resources: 67 | requests: 68 | storage: 8Gi 69 | storageClassName: vxflexos 70 | --- 71 | kind: PersistentVolumeClaim 72 | apiVersion: v1 73 | metadata: 74 | name: pvol5 75 | namespace: helmtest-vxflexos 76 | spec: 77 | accessModes: 78 | - ReadWriteOnce 79 | volumeMode: Filesystem 80 | resources: 81 | requests: 82 | storage: 8Gi 83 | storageClassName: vxflexos-xfs 84 | --- 85 | kind: PersistentVolumeClaim 86 | apiVersion: v1 87 | metadata: 88 | name: pvol6 89 | namespace: helmtest-vxflexos 90 | spec: 91 | accessModes: 92 | - ReadWriteOnce 93 | volumeMode: Filesystem 94 | resources: 95 | requests: 96 | storage: 8Gi 97 | storageClassName: vxflexos-xfs 98 | --- 99 | kind: PersistentVolumeClaim 100 | apiVersion: v1 101 | metadata: 102 | name: pvol7 103 | namespace: helmtest-vxflexos 104 | spec: 105 | accessModes: 106 | - ReadWriteOnce 107 | volumeMode: Filesystem 108 | resources: 109 | requests: 110 | storage: 8Gi 111 | storageClassName: vxflexos-xfs 112 | --- 113 | kind: PersistentVolumeClaim 114 | apiVersion: v1 115 | metadata: 116 | name: pvol8 117 | namespace: helmtest-vxflexos 118 | spec: 119 | accessModes: 120 | - ReadWriteOnce 121 | volumeMode: Filesystem 122 | resources: 123 | requests: 124 | storage: 8Gi 125 | storageClassName: vxflexos-xfs 126 | --- 127 | kind: PersistentVolumeClaim 128 | apiVersion: v1 129 | metadata: 130 | name: pvol9 131 | namespace: helmtest-vxflexos 132 | spec: 133 | accessModes: 134 | - ReadWriteOnce 135 | volumeMode: Filesystem 136 | resources: 137 | requests: 138 | storage: 8Gi 139 | storageClassName: vxflexos-xfs 140 | --- 141 | -------------------------------------------------------------------------------- /test/helm/10vols/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 10vols 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | - mountPath: "/data1" 31 | name: pvol1 32 | - mountPath: "/data2" 33 | name: pvol2 34 | - mountPath: "/data3" 35 | name: pvol3 36 | - mountPath: "/data4" 37 | name: pvol4 38 | - mountPath: "/data5" 39 | name: pvol5 40 | - mountPath: "/data6" 41 | name: pvol6 42 | - mountPath: "/data7" 43 | name: pvol7 44 | - mountPath: "/data8" 45 | name: pvol8 46 | - mountPath: "/data9" 47 | name: pvol9 48 | volumes: 49 | - name: pvol0 50 | persistentVolumeClaim: 51 | claimName: pvol0 52 | - name: pvol1 53 | persistentVolumeClaim: 54 | claimName: pvol1 55 | - name: pvol2 56 | persistentVolumeClaim: 57 | claimName: pvol2 58 | - name: pvol3 59 | persistentVolumeClaim: 60 | claimName: pvol3 61 | - name: pvol4 62 | persistentVolumeClaim: 63 | claimName: pvol4 64 | - name: pvol5 65 | persistentVolumeClaim: 66 | claimName: pvol5 67 | - name: pvol6 68 | persistentVolumeClaim: 69 | claimName: pvol6 70 | - name: pvol7 71 | persistentVolumeClaim: 72 | claimName: pvol7 73 | - name: pvol8 74 | persistentVolumeClaim: 75 | claimName: pvol8 76 | - name: pvol9 77 | persistentVolumeClaim: 78 | claimName: pvol9 79 | -------------------------------------------------------------------------------- /test/helm/1vol-nfs/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 1vol-nfs 2 | version: 1.0.0 3 | apiVersion: v1 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 7 | keywords: 8 | - vxflexos-csi 9 | - storage 10 | engine: gotpl 11 | -------------------------------------------------------------------------------- /test/helm/1vol-nfs/templates/pvc0.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos-nfs 14 | -------------------------------------------------------------------------------- /test/helm/1vol-nfs/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 2vols 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | volumes: 31 | - name: pvol0 32 | persistentVolumeClaim: 33 | claimName: pvol0 34 | -------------------------------------------------------------------------------- /test/helm/1vols+restore-nfs/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 1vols+restore-nfs 2 | version: 1.0.0 3 | appVersion: v1 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - vxflexos-csi 8 | - storage 9 | engine: gotpl 10 | -------------------------------------------------------------------------------- /test/helm/1vols+restore-nfs/templates/createFromSnap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: restorepvc 5 | namespace: helmtest-vxflexos 6 | spec: 7 | storageClassName: vxflexos-nfs 8 | dataSource: 9 | name: pvol0-snap1 10 | kind: VolumeSnapshot 11 | apiGroup: snapshot.storage.k8s.io 12 | accessModes: 13 | - ReadWriteOnce 14 | resources: 15 | requests: 16 | storage: 8Gi 17 | -------------------------------------------------------------------------------- /test/helm/1vols+restore-nfs/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 2vols 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | volumes: 31 | - name: pvol0 32 | persistentVolumeClaim: 33 | claimName: restorepvc 34 | -------------------------------------------------------------------------------- /test/helm/2vols+clone/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 2vols+clone 2 | version: 1.0.0 3 | apiVersion: v1 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - vxflexos-csi 8 | - storage 9 | engine: gotpl 10 | -------------------------------------------------------------------------------- /test/helm/2vols+clone/templates/createFromVolume.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: clonedpvc 5 | namespace: helmtest-vxflexos 6 | spec: 7 | storageClassName: vxflexos 8 | dataSource: 9 | name: pvol0 10 | kind: PersistentVolumeClaim 11 | accessModes: 12 | - ReadWriteOnce 13 | resources: 14 | requests: 15 | storage: 8Gi 16 | -------------------------------------------------------------------------------- /test/helm/2vols+clone/templates/pvc0.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos 14 | -------------------------------------------------------------------------------- /test/helm/2vols+clone/templates/pvc1.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol1 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 12Gi 13 | storageClassName: vxflexos-xfs 14 | -------------------------------------------------------------------------------- /test/helm/2vols+clone/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 2vols 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | - mountPath: "/data1" 31 | name: pvol1 32 | - mountPath: "/data2" 33 | name: pvol2 34 | volumes: 35 | - name: pvol0 36 | persistentVolumeClaim: 37 | claimName: pvol0 38 | - name: pvol1 39 | persistentVolumeClaim: 40 | claimName: pvol1 41 | - name: pvol2 42 | persistentVolumeClaim: 43 | claimName: clonedpvc 44 | -------------------------------------------------------------------------------- /test/helm/2vols+restore/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 2vols+restore 2 | version: 1.0.0 3 | appVersion: v1 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - vxflexos-csi 8 | - storage 9 | engine: gotpl 10 | -------------------------------------------------------------------------------- /test/helm/2vols+restore/templates/createFromSnap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: restorepvc 5 | namespace: helmtest-vxflexos 6 | spec: 7 | storageClassName: vxflexos 8 | dataSource: 9 | name: pvol0-snap1 10 | kind: VolumeSnapshot 11 | apiGroup: snapshot.storage.k8s.io 12 | accessModes: 13 | - ReadWriteOnce 14 | resources: 15 | requests: 16 | storage: 8Gi 17 | -------------------------------------------------------------------------------- /test/helm/2vols+restore/templates/pvc0.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos 14 | -------------------------------------------------------------------------------- /test/helm/2vols+restore/templates/pvc1.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol1 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 12Gi 13 | storageClassName: vxflexos-xfs 14 | -------------------------------------------------------------------------------- /test/helm/2vols+restore/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 2vols 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | - mountPath: "/data1" 31 | name: pvol1 32 | - mountPath: "/data2" 33 | name: pvol2 34 | volumes: 35 | - name: pvol0 36 | persistentVolumeClaim: 37 | claimName: pvol0 38 | - name: pvol1 39 | persistentVolumeClaim: 40 | claimName: pvol1 41 | - name: pvol2 42 | persistentVolumeClaim: 43 | claimName: restorepvc 44 | -------------------------------------------------------------------------------- /test/helm/2vols-multi-array/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 2vols-multi-array 2 | version: 1.0.0 3 | apiVersion: v1 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 7 | keywords: 8 | - vxflexos-csi 9 | - storage 10 | engine: gotpl 11 | -------------------------------------------------------------------------------- /test/helm/2vols-multi-array/templates/pvc0.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos 14 | -------------------------------------------------------------------------------- /test/helm/2vols-multi-array/templates/pvc1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: vxflexos2 5 | annotations: 6 | storageclass.kubernetes.io/is-default-class: "false" 7 | provisioner: csi-vxflexos.dellemc.com 8 | reclaimPolicy: Delete 9 | allowVolumeExpansion: true 10 | parameters: 11 | storagepool: 12 | systemID: 13 | volumeBindingMode: WaitForFirstConsumer 14 | allowedTopologies: 15 | - matchLabelExpressions: 16 | - key: csi-vxflexos.dellemc.com/ 17 | values: 18 | - csi-vxflexos.dellemc.com 19 | --- 20 | kind: PersistentVolumeClaim 21 | apiVersion: v1 22 | metadata: 23 | name: pvol1 24 | namespace: helmtest-vxflexos 25 | spec: 26 | accessModes: 27 | - ReadWriteOnce 28 | volumeMode: Filesystem 29 | resources: 30 | requests: 31 | storage: 8Gi 32 | storageClassName: vxflexos2 33 | -------------------------------------------------------------------------------- /test/helm/2vols-multi-array/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 2vols-multi-array 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | - mountPath: "/data1" 31 | name: pvol1 32 | volumes: 33 | - name: pvol0 34 | persistentVolumeClaim: 35 | claimName: pvol0 36 | - name: pvol1 37 | persistentVolumeClaim: 38 | claimName: pvol1 39 | -------------------------------------------------------------------------------- /test/helm/2vols/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 2vols 2 | version: 1.0.0 3 | apiVersion: v1 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 7 | keywords: 8 | - vxflexos-csi 9 | - storage 10 | engine: gotpl 11 | -------------------------------------------------------------------------------- /test/helm/2vols/templates/pvc0.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos 14 | -------------------------------------------------------------------------------- /test/helm/2vols/templates/pvc1.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol1 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 12Gi 13 | storageClassName: vxflexos-xfs 14 | -------------------------------------------------------------------------------- /test/helm/2vols/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 2vols 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | - mountPath: "/data1" 31 | name: pvol1 32 | volumes: 33 | - name: pvol0 34 | persistentVolumeClaim: 35 | claimName: pvol0 36 | - name: pvol1 37 | persistentVolumeClaim: 38 | claimName: pvol1 39 | -------------------------------------------------------------------------------- /test/helm/3vols-nfs/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 3vols-nfs 2 | version: 1.0.0 3 | appVersion: 1.0.0 4 | apiVersion: v1 5 | description: | 6 | Tests VxFlex OS CSI deployments. 7 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 8 | keywords: 9 | - vxflexos-csi 10 | - storage 11 | engine: gotpl 12 | -------------------------------------------------------------------------------- /test/helm/3vols-nfs/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos-nfs 14 | --- 15 | kind: PersistentVolumeClaim 16 | apiVersion: v1 17 | metadata: 18 | name: pvol1 19 | namespace: helmtest-vxflexos 20 | spec: 21 | accessModes: 22 | - ReadWriteOnce 23 | volumeMode: Filesystem 24 | resources: 25 | requests: 26 | storage: 12Gi 27 | storageClassName: vxflexos-nfs 28 | --- 29 | kind: PersistentVolumeClaim 30 | apiVersion: v1 31 | metadata: 32 | name: pvol2 33 | namespace: helmtest-vxflexos 34 | spec: 35 | accessModes: 36 | - ReadWriteOnce 37 | volumeMode: Filesystem 38 | resources: 39 | requests: 40 | storage: 16Gi 41 | storageClassName: vxflexos-nfs 42 | -------------------------------------------------------------------------------- /test/helm/3vols-nfs/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 3vols-nfs 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | - mountPath: "/data1" 31 | name: pvol1 32 | - mountPath: "/data2" 33 | name: pvol2 34 | volumes: 35 | - name: pvol0 36 | persistentVolumeClaim: 37 | claimName: pvol0 38 | - name: pvol1 39 | persistentVolumeClaim: 40 | claimName: pvol1 41 | - name: pvol2 42 | persistentVolumeClaim: 43 | claimName: pvol2 44 | -------------------------------------------------------------------------------- /test/helm/5vols-nfs/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 5vols-nfs 2 | version: 1.0.0 3 | apiVersion: v1 4 | appVersion: 1.0.0 5 | 6 | description: | 7 | Tests VxFlexOS CSI deployments. 8 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 9 | keywords: 10 | - vxflexos-csi 11 | - storage 12 | engine: gotpl 13 | -------------------------------------------------------------------------------- /test/helm/5vols-nfs/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos-nfs 14 | --- 15 | kind: PersistentVolumeClaim 16 | apiVersion: v1 17 | metadata: 18 | name: pvol1 19 | namespace: helmtest-vxflexos 20 | spec: 21 | accessModes: 22 | - ReadWriteOnce 23 | volumeMode: Filesystem 24 | resources: 25 | requests: 26 | storage: 8Gi 27 | storageClassName: vxflexos-nfs 28 | --- 29 | kind: PersistentVolumeClaim 30 | apiVersion: v1 31 | metadata: 32 | name: pvol2 33 | namespace: helmtest-vxflexos 34 | spec: 35 | accessModes: 36 | - ReadWriteOnce 37 | volumeMode: Filesystem 38 | resources: 39 | requests: 40 | storage: 8Gi 41 | storageClassName: vxflexos-nfs 42 | --- 43 | kind: PersistentVolumeClaim 44 | apiVersion: v1 45 | metadata: 46 | name: pvol3 47 | namespace: helmtest-vxflexos 48 | spec: 49 | accessModes: 50 | - ReadWriteOnce 51 | volumeMode: Filesystem 52 | resources: 53 | requests: 54 | storage: 8Gi 55 | storageClassName: vxflexos-nfs 56 | --- 57 | kind: PersistentVolumeClaim 58 | apiVersion: v1 59 | metadata: 60 | name: pvol4 61 | namespace: helmtest-vxflexos 62 | spec: 63 | accessModes: 64 | - ReadWriteOnce 65 | volumeMode: Filesystem 66 | resources: 67 | requests: 68 | storage: 8Gi 69 | storageClassName: vxflexos-nfs 70 | --- 71 | -------------------------------------------------------------------------------- /test/helm/5vols-nfs/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 10vols 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | - mountPath: "/data1" 31 | name: pvol1 32 | - mountPath: "/data2" 33 | name: pvol2 34 | - mountPath: "/data3" 35 | name: pvol3 36 | - mountPath: "/data4" 37 | name: pvol4 38 | volumes: 39 | - name: pvol0 40 | persistentVolumeClaim: 41 | claimName: pvol0 42 | - name: pvol1 43 | persistentVolumeClaim: 44 | claimName: pvol1 45 | - name: pvol2 46 | persistentVolumeClaim: 47 | claimName: pvol2 48 | - name: pvol3 49 | persistentVolumeClaim: 50 | claimName: pvol3 51 | - name: pvol4 52 | persistentVolumeClaim: 53 | claimName: pvol4 54 | -------------------------------------------------------------------------------- /test/helm/7vols/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 7vols 2 | version: 1.0.0 3 | appVersion: 1.0.0 4 | apiVersion: v1 5 | description: | 6 | Tests VxFlex OS CSI deployments. 7 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 8 | keywords: 9 | - vxflexos-csi 10 | - storage 11 | engine: gotpl 12 | -------------------------------------------------------------------------------- /test/helm/7vols/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: vxflexos 14 | --- 15 | kind: PersistentVolumeClaim 16 | apiVersion: v1 17 | metadata: 18 | name: pvol1 19 | namespace: helmtest-vxflexos 20 | spec: 21 | accessModes: 22 | - ReadWriteOnce 23 | volumeMode: Filesystem 24 | resources: 25 | requests: 26 | storage: 8Gi 27 | storageClassName: vxflexos 28 | --- 29 | kind: PersistentVolumeClaim 30 | apiVersion: v1 31 | metadata: 32 | name: pvol2 33 | namespace: helmtest-vxflexos 34 | spec: 35 | accessModes: 36 | - ReadWriteOnce 37 | volumeMode: Filesystem 38 | resources: 39 | requests: 40 | storage: 8Gi 41 | storageClassName: vxflexos 42 | --- 43 | kind: PersistentVolumeClaim 44 | apiVersion: v1 45 | metadata: 46 | name: pvol3 47 | namespace: helmtest-vxflexos 48 | spec: 49 | accessModes: 50 | - ReadWriteOnce 51 | volumeMode: Filesystem 52 | resources: 53 | requests: 54 | storage: 8Gi 55 | storageClassName: vxflexos 56 | --- 57 | kind: PersistentVolumeClaim 58 | apiVersion: v1 59 | metadata: 60 | name: pvol4 61 | namespace: helmtest-vxflexos 62 | spec: 63 | accessModes: 64 | - ReadWriteOnce 65 | volumeMode: Filesystem 66 | resources: 67 | requests: 68 | storage: 8Gi 69 | storageClassName: vxflexos 70 | --- 71 | kind: PersistentVolumeClaim 72 | apiVersion: v1 73 | metadata: 74 | name: pvol5 75 | namespace: helmtest-vxflexos 76 | spec: 77 | accessModes: 78 | - ReadWriteOnce 79 | volumeMode: Filesystem 80 | resources: 81 | requests: 82 | storage: 8Gi 83 | storageClassName: vxflexos-xfs 84 | --- 85 | kind: PersistentVolumeClaim 86 | apiVersion: v1 87 | metadata: 88 | name: pvol6 89 | namespace: helmtest-vxflexos 90 | spec: 91 | accessModes: 92 | - ReadWriteOnce 93 | volumeMode: Filesystem 94 | resources: 95 | requests: 96 | storage: 8Gi 97 | storageClassName: vxflexos-xfs 98 | -------------------------------------------------------------------------------- /test/helm/7vols/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: 7vols 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data0" 29 | name: pvol0 30 | - mountPath: "/data1" 31 | name: pvol1 32 | - mountPath: "/data2" 33 | name: pvol2 34 | - mountPath: "/data3" 35 | name: pvol3 36 | - mountPath: "/data4" 37 | name: pvol4 38 | - mountPath: "/data5" 39 | name: pvol5 40 | - mountPath: "/data6" 41 | name: pvol6 42 | volumes: 43 | - name: pvol0 44 | persistentVolumeClaim: 45 | claimName: pvol0 46 | - name: pvol1 47 | persistentVolumeClaim: 48 | claimName: pvol1 49 | - name: pvol2 50 | persistentVolumeClaim: 51 | claimName: pvol2 52 | - name: pvol3 53 | persistentVolumeClaim: 54 | claimName: pvol3 55 | - name: pvol4 56 | persistentVolumeClaim: 57 | claimName: pvol4 58 | - name: pvol5 59 | persistentVolumeClaim: 60 | claimName: pvol5 61 | - name: pvol6 62 | persistentVolumeClaim: 63 | claimName: pvol6 64 | -------------------------------------------------------------------------------- /test/helm/README.md: -------------------------------------------------------------------------------- 1 | # Helm tests 2 | This folder contains Helm charts and shell scripts which can be used to test various features of the CSI PowerFlex driver. 3 | 4 | The Helm charts typically deploy a StatefulSet with a number of PVCs created using the provided storage class names. 5 | For e.g. - the test `2vols` will deploy a StatefulSet which runs a single CentOS container and uses `2` PVCs. 6 | 7 | Additionally, some tests create cloned volumes using a source `Volume` or a `VolumeSnapshot` 8 | 9 | ## Helm charts 10 | 11 | | Name | Description | 12 | |---------|-------| 13 | |2vols | Creates 2 filesystem mounts | 14 | |7vols | Creates 7 filesystem mounts | 15 | |10vols | Creates 10 filesystem mounts | 16 | |xfspre | Create an XFS formated PV and attaches to a pod | 17 | |2replicas | Creates 2 filesystem mounts like 2vols but with Replicas = 2 | 18 | |2vols+restore | Upgraded version of 2vols that also mounts a volume created from snap | 19 | |2vols-multi-array | Creates 2 volumes, each on a different array. You must fill in 2vols-multi-array/templates/pvc1.yaml first | 20 | | 2vols + clone | Creates 2 initial volumes and a third volume that is a clone of one of the initial volumes. | 21 | 22 | 23 | ## Scripts 24 | | Name | Description | 25 | |----------------|-------| 26 | | starttest.sh | Script to instantiate one of the Helm charts above. Requires an argument of a helm chart name 27 | | stoptest.sh | Stops currently running Helm chart. Requires an argument of a helm chart name 28 | | snapcgtest.sh | Used after starting a Helm chart; tests snapping the persistent volumes into a consistency group 29 | | snaprestoretest.sh | Used without previously starting a Helm chart; instantiates 2vols; then upgrades it to 2vols+restore (with volume from snapshot) 30 | | snaptest.sh | Used after starting 2vols; snaps pvol0 twice 31 | | volumeclonetest.sh | Used after starting 2vols; snaps pvol0 twice 32 | 33 | 34 | ## Usage 35 | 36 | The starttest.sh script is used to deploy Helm charts that test the deployment of a simple pod 37 | with various storage configurations. The stoptest.sh script will delete the Helm chart and cleanup after the test. 38 | 39 | Procedure 40 | 1. Navigate to the test/helm directory, which contains the starttest.sh and various Helm charts. 41 | 42 | 2. Run the starttest.sh script with an argument of the specific Helm chart to deploy and test: `bash starttest.sh ` 43 | 44 | Example: 45 | 46 | ``` 47 | bash starttest.sh 2vols 48 | ``` 49 | 50 | 3. After the test has completed, run the stoptest.sh script to delete the Helm chart and cleanup the volumes: `bash stoptest.sh ` 51 | 52 | Example: 53 | 54 | ``` 55 | bash stoptest.sh 2vols 56 | ``` 57 | 58 | To run the tests, follow the procedure given below: 59 | 1. Navigate to the test/helm directory 60 | 2. Run the desired script with the following command: `bash ` 61 | 62 | Example: 63 | 64 | ``` 65 | bash snaptest.sh 66 | ``` 67 | -------------------------------------------------------------------------------- /test/helm/block/block-rwx/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: block-rwx 2 | version: 0.0.1 3 | appVersion: 2.6.0 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - vxflexos-csi 8 | - storage 9 | engine: gotpl 10 | -------------------------------------------------------------------------------- /test/helm/block/block-rwx/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: { { .Values.namespace } } 6 | --- 7 | kind: PersistentVolumeClaim 8 | apiVersion: v1 9 | metadata: 10 | name: pvol0 11 | namespace: { { .Values.namespace } } 12 | spec: 13 | accessModes: 14 | - ReadWriteMany 15 | volumeMode: Block 16 | resources: 17 | requests: 18 | storage: 8Gi 19 | storageClassName: { { .Values.storageclass } } 20 | --- 21 | kind: Deployment 22 | apiVersion: apps/v1 23 | metadata: 24 | name: vxflextest 25 | namespace: { { .Values.namespace } } 26 | spec: 27 | replicas: 2 28 | selector: 29 | matchLabels: 30 | app: vxflextest 31 | template: 32 | metadata: 33 | labels: 34 | app: vxflextest 35 | spec: 36 | serviceAccount: vxflextest 37 | containers: 38 | - name: test 39 | image: quay.io/centos/centos:latest 40 | command: ["/bin/sleep", "3600"] 41 | volumeDevices: 42 | - devicePath: "/dev/data0" 43 | name: pvol0 44 | volumes: 45 | - name: pvol0 46 | persistentVolumeClaim: 47 | claimName: pvol0 48 | -------------------------------------------------------------------------------- /test/helm/block/block-rwx/values.yaml: -------------------------------------------------------------------------------- 1 | storageclass: vxflexos 2 | -------------------------------------------------------------------------------- /test/helm/block/block1/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: block1 2 | version: 0.0.1 3 | appVersion: 2.6.0 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - vxflexos-csi 8 | - storage 9 | - block 10 | engine: gotpl 11 | -------------------------------------------------------------------------------- /test/helm/block/block1/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: { { .Values.name } } 5 | namespace: { { .Values.namespace } } 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: { { .Values.name } } 11 | namespace: { { .Values.namespace } } 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: { { .Values.name } } 16 | serviceName: test2vols 17 | template: 18 | metadata: 19 | labels: 20 | app: { { .Values.name } } 21 | spec: 22 | serviceAccount: { { .Values.name } } 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeDevices: 28 | - devicePath: "/dev/data0" 29 | name: pvol0 30 | volumeClaimTemplates: 31 | - metadata: 32 | name: pvol0 33 | spec: 34 | accessModes: 35 | - ReadWriteOnce 36 | volumeMode: Block 37 | storageClassName: vxflexos 38 | resources: 39 | requests: 40 | storage: 8Gi 41 | -------------------------------------------------------------------------------- /test/helm/block/block1/values.yaml: -------------------------------------------------------------------------------- 1 | storageclass: vxflexos 2 | name: vxflextest 3 | -------------------------------------------------------------------------------- /test/helm/block/block2/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: block2 2 | version: 0.0.1 3 | appVersion: 2.6.0 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - vxflexos-csi 8 | - storage 9 | engine: gotpl 10 | -------------------------------------------------------------------------------- /test/helm/block/block2/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: { { .Values.name } } 5 | namespace: { { .Values.namespace } } 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: { { .Values.name } } 11 | namespace: { { .Values.namespace } } 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: { { .Values.name } } 16 | serviceName: test2vols 17 | template: 18 | metadata: 19 | labels: 20 | app: { { .Values.name } } 21 | spec: 22 | serviceAccount: { { .Values.name } } 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeDevices: 28 | - devicePath: "/dev/data0" 29 | name: pvol0 30 | - devicePath: "/dev/data1" 31 | name: pvol1 32 | volumeClaimTemplates: 33 | - metadata: 34 | name: pvol0 35 | spec: 36 | accessModes: 37 | - ReadWriteOnce 38 | volumeMode: Block 39 | storageClassName: { { .Values.storageclass } } 40 | resources: 41 | requests: 42 | storage: 8Gi 43 | - metadata: 44 | name: pvol1 45 | spec: 46 | accessModes: 47 | - ReadWriteOnce 48 | volumeMode: Block 49 | storageClassName: { { .Values.storageclass } } 50 | resources: 51 | requests: 52 | storage: 12Gi 53 | -------------------------------------------------------------------------------- /test/helm/block/block2/values.yaml: -------------------------------------------------------------------------------- 1 | name: vxflextest 2 | storageclass: vxflexos 3 | -------------------------------------------------------------------------------- /test/helm/blocksnap/1snap/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 1snap 2 | version: 1.0.0 3 | apiVersion: v1 4 | appVersion: 1.0.0 5 | description: | 6 | Tests VxFlexOS CSI deployments. 7 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 8 | keywords: 9 | - vxflexos-csi 10 | - storage 11 | engine: gotpl 12 | -------------------------------------------------------------------------------- /test/helm/blocksnap/1snap/templates/snap1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshot 3 | metadata: 4 | name: pvol0-snap1 5 | namespace: { { .Values.namespace } } 6 | spec: 7 | source: 8 | persistentVolumeClaimName: pvol0 9 | volumeSnapshotClassName: { { .Values.snapclass } } 10 | -------------------------------------------------------------------------------- /test/helm/blocksnap/1vol/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 1vol 2 | version: 1.0.0 3 | apiVersion: v1 4 | appVersion: 1.0.0 5 | description: | 6 | Tests VxFlexOS CSI deployments. 7 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 8 | keywords: 9 | - vxflexos-csi 10 | - storage 11 | engine: gotpl 12 | -------------------------------------------------------------------------------- /test/helm/blocksnap/1vol/templates/test.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0 5 | namespace: { { .Values.namespace } } 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | resources: 11 | requests: 12 | storage: 8Gi 13 | storageClassName: { { .Values.storageclass } } 14 | --- 15 | apiVersion: v1 16 | kind: ServiceAccount 17 | metadata: 18 | name: vol 19 | namespace: { { .Values.namespace } } 20 | --- 21 | kind: StatefulSet 22 | apiVersion: apps/v1 23 | metadata: 24 | name: vol 25 | namespace: { { .Values.namespace } } 26 | spec: 27 | selector: 28 | matchLabels: 29 | app: vol 30 | serviceName: 1vol 31 | template: 32 | metadata: 33 | labels: 34 | app: vol 35 | spec: 36 | serviceAccount: vol 37 | containers: 38 | - name: test 39 | image: quay.io/centos/centos:latest 40 | command: ["/bin/sleep", "3600"] 41 | volumeMounts: 42 | - mountPath: "/data0" 43 | name: pvol0 44 | volumes: 45 | - name: pvol0 46 | persistentVolumeClaim: 47 | claimName: pvol0 48 | -------------------------------------------------------------------------------- /test/helm/blocksnap/1volfromsnap/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 1volfromsnap 2 | version: 1.0.0 3 | apiVersion: v1 4 | appVersion: 1.0.0 5 | description: | 6 | Tests VxFlexOS CSI deployments. 7 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 8 | keywords: 9 | - vxflexos-csi 10 | - storage 11 | engine: gotpl 12 | -------------------------------------------------------------------------------- /test/helm/blocksnap/1volfromsnap/templates/test.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol0-copy1 5 | namespace: { { .Values.namespace } } 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | dataSource: 10 | apiGroup: snapshot.storage.k8s.io 11 | kind: VolumeSnapshot 12 | name: pvol0-snap1 13 | resources: 14 | requests: 15 | storage: 8Gi 16 | storageClassName: { { .Values.storageclass } } 17 | volumeMode: Block 18 | --- 19 | kind: StatefulSet 20 | apiVersion: apps/v1 21 | metadata: 22 | name: copy 23 | namespace: { { .Values.namespace } } 24 | spec: 25 | selector: 26 | matchLabels: 27 | app: copy 28 | serviceName: copy 29 | template: 30 | metadata: 31 | labels: 32 | app: copy 33 | spec: 34 | serviceAccount: vol 35 | containers: 36 | - name: copy 37 | image: quay.io/centos/centos:latest 38 | command: ["/bin/sleep", "3600"] 39 | securityContext: 40 | capabilities: 41 | add: 42 | - SYS_ADMIN 43 | volumeDevices: 44 | - devicePath: "/data0" 45 | name: pvol0-copy1 46 | volumes: 47 | - name: pvol0-copy1 48 | persistentVolumeClaim: 49 | claimName: pvol0-copy1 50 | -------------------------------------------------------------------------------- /test/helm/blocksnap/README.md: -------------------------------------------------------------------------------- 1 | Blocksnap Test 2 | ============== 3 | 4 | This is a real use case that arises in data protection. The idea is to make a mounted file system from a volume for a first pod, 5 | have that pod write some data to the file system, and then take a snap of the volume, and then to make a second pod which 6 | uses the snap as a volume source for a block mounted volume. 7 | 8 | The block volume created from the snapshot can then be used to transmit the volume efficiently by the 2nd pod to remote storage. 9 | 10 | The test mounts the block volume in the 2nd pod in a local directory, and compares the data written by the 1st pod (which is a tar .tgz file) 11 | with the data from mounting the snap contents in the 2nd pod, which should always be identical. 12 | 13 | Running the Test 14 | ---------------- 15 | 16 | Execute "sh run.sh" to run the test in a kubernetes environment that supports v1 block snapshots. The test is preconfigured to use 17 | the vxflexos CSI torage system in run.sh. You can edit run.sh and change the storageclass, snapclass (the volumesnapshotclass name), 18 | and namespace parameters to run the test for a different type of CSI storage. 19 | 20 | The test is constructed from three Helm charts that are deployed in the following sequence: 21 | 1. 1vol creates one volume and deploys it in a pod 22 | 2. 1snap creates a snapshot from the volume in step 1. 23 | 3. 1volfromsnap creates a volume from the snapshot and deploys it in a second pod. 24 | 25 | If the test runs succssfully, it compares the data generated in the first pod with the data from the snap in the second pod 26 | to make sure they match. Then it deletes the Helm deployments and waits until the pvcs in the namespace are deleted. 27 | -------------------------------------------------------------------------------- /test/helm/blocksnap/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | namespace=test 16 | helmsettings="storageclass=vxflexos,snapclass=vxflexos-snapclass" 17 | alias k=kubectl 18 | 19 | # arg1=pod name 20 | waitOnRunning() { 21 | echo "waiting on $1 to reach running" 22 | running=0 23 | while [ $running -ne 1 ] ; 24 | do 25 | k get pods -n $namespace | grep $1 26 | running=$(k get pods -n $namespace | grep $1 | grep Running | wc -l) 27 | sleep 5 28 | done 29 | } 30 | 31 | # arg1=volumesnapshot name 32 | waitOnSnapshotReady() { 33 | echo "waiting on $1 to reach ready" 34 | ready="false" 35 | while [ "$ready" != "true" ] ; 36 | do 37 | name=$(k get volumesnapshot -n $namespace | grep $1 | awk ' { print $1; }') 38 | ready=$(k get volumesnapshot -n $namespace | grep $1 | awk ' { print $2; }') 39 | echo $name ready: $ready 40 | sleep 5 41 | done 42 | } 43 | 44 | # waitOnNoPvc() 45 | waitOnNoPvc() { 46 | echo "waiting on all pvcs to be deleted from namespace" 47 | pvcs=$(k get pvc -n $namespace | grep -v NAME | wc -l) 48 | while [ $pvcs -gt 0 ] ; 49 | do 50 | pvcs=$(k get pvc -n $namespace | grep -v NAME | wc -l) 51 | k get pvc -n $namespace 52 | sleep 5 53 | done 54 | } 55 | 56 | helm install --set $helmsettings -n $namespace 1vol 1vol 57 | waitOnRunning vol-0 58 | 59 | # Write some data into the file system. 60 | echo "k exec -it -n test vxflextest-0 -- tar czvf /data0/data.tgz /usr" 61 | k exec -it -n test vol-0 -- tar czvf /data0/data.tgz /usr 62 | # Sync the data onto the file system 63 | k exec -it -n test vol-0 -- sync 64 | k exec -it -n test vol-0 -- ls -l /data0/data.tgz 65 | sumA=$(k exec -it -n test vol-0 -- md5sum /data0/data.tgz | awk ' {print $1}') 66 | echo sumA $sumA 67 | k exec -it -n test vol-0 -- sync 68 | 69 | helm install --set $helmsettings -n $namespace 1snap 1snap 70 | waitOnSnapshotReady vol0-snap1 71 | 72 | helm install --set $helmsettings -n test 1volfromsnap 1volfromsnap 73 | waitOnRunning copy-0 74 | k get pods -n test 75 | 76 | echo "Checking the data" 77 | echo "k exec -it -n test copy-0 -- mkdir /tmp/foo" 78 | k exec -it -n test copy-0 -- mkdir /tmp/foo 79 | echo "k exec -it -n test copy-0 -- mount /data0 /tmp/foo" 80 | k exec -it -n test copy-0 -- mount /data0 /tmp/foo 81 | echo "k exec -it -n test copy-0 -- ls -l /tmp/foo/data.tgz" 82 | k exec -it -n test copy-0 -- ls -l /tmp/foo/data.tgz 83 | echo "k exec -it -n test copy-0 -- tar tzvf /tmp/foo/data.tgz | tail -20" 84 | k exec -it -n test copy-0 -- tar tzvf /tmp/foo/data.tgz | tail -20 85 | sumB=$(k exec -it -n test copy-0 -- md5sum /tmp/foo/data.tgz | awk ' {print $1}') 86 | 87 | echo sumA $sumA sumB $sumB 88 | if [ "$sumA" != "$sumB" ] ; then 89 | echo "Different checksums- test failed" 90 | exit 2 91 | fi 92 | 93 | sleep 30 94 | helm delete -n $namespace 1volfromsnap 95 | 96 | sleep 30 97 | helm delete -n $namespace 1snap 98 | 99 | sleep 30 100 | helm delete -n $namespace 1vol 101 | 102 | waitOnNoPvc 103 | -------------------------------------------------------------------------------- /test/helm/common.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | waitOnRunning() { 15 | TARGET=$(kubectl get pods -n ${NS} | grep "test" | wc -l) 16 | RUNNING=0 17 | while [ $RUNNING -ne $TARGET ]; 18 | do 19 | sleep 10 20 | TARGET=$(kubectl get pods -n ${NS} | grep "test" | wc -l) 21 | RUNNING=$(kubectl get pods -n ${NS} | grep "Running" | wc -l) 22 | date 23 | echo running $RUNNING / $TARGET 24 | kubectl get pods -n ${NS} 25 | done 26 | } 27 | 28 | kMajorVersion=$(run_command kubectl version | grep 'Server Version' | sed -E 's/.*v([0-9]+)\.[0-9]+\.[0-9]+.*/\1/') 29 | kMinorVersion=$(run_command kubectl version | grep 'Server Version' | sed -E 's/.*v[0-9]+\.([0-9]+)\.[0-9]+.*/\1/') 30 | -------------------------------------------------------------------------------- /test/helm/deletepvcs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | force=no 15 | if [ "$1" == "--force" ]; 16 | then 17 | force=yes 18 | fi 19 | 20 | pvcs=$(kubectl get pvc -n helmtest-vxflexos | awk '/pvol/ { print $1; }') 21 | echo deleting... $pvcs 22 | for pvc in $pvcs 23 | do 24 | if [ $force == "yes" ]; 25 | then 26 | echo kubectl delete --force --grace-period=0 pvc $pvc -n helmtest-vxflexos 27 | kubectl delete --force --grace-period=0 pvc $pvc -n helmtest-vxflexos 28 | else 29 | echo kubectl delete pvc $pvc -n helmtest-vxflexos 30 | kubectl delete pvc $pvc -n helmtest-vxflexos 31 | fi 32 | done 33 | 34 | -------------------------------------------------------------------------------- /test/helm/ephemeral/sample.yaml: -------------------------------------------------------------------------------- 1 | kind: Pod 2 | apiVersion: v1 3 | metadata: 4 | name: my-csi-app-inline-volumes 5 | spec: 6 | containers: 7 | - name: my-frontend 8 | image: busybox 9 | command: ["sleep", "100000"] 10 | volumeMounts: 11 | - mountPath: "/data0" 12 | name: my-csi-volume 13 | - mountPath: "/data1" 14 | name: my-csi-volume-xfs 15 | volumes: 16 | - name: my-csi-volume 17 | csi: 18 | driver: csi-vxflexos.dellemc.com 19 | fsType: "ext4" 20 | volumeAttributes: 21 | volumeName: "my-csi-volume" 22 | size: "8Gi" 23 | storagepool: sample 24 | systemID: sample 25 | - name: my-csi-volume-xfs 26 | csi: 27 | driver: csi-vxflexos.dellemc.com 28 | fsType: "xfs" 29 | volumeAttributes: 30 | volumeName: "my-csi-volume-xfs" 31 | size: "10Gi" 32 | storagepool: sample 33 | systemID: sample 34 | -------------------------------------------------------------------------------- /test/helm/ephemeral/testEphemeral.sh: -------------------------------------------------------------------------------- 1 | # Copyright © 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #This test creates a pod with 2 inline volumes, one ext4, and one xfs. To use, replace the systemName and storagepool fields in sample.yaml 14 | 15 | kubectl create -f sample.yaml 16 | 17 | count=$(kubectl get pods | grep my-csi-app-inline-volume | grep Running | wc -l) 18 | limit=20 19 | iteration=0 20 | time_limit=$[$limit*3] 21 | 22 | 23 | while [ $count -lt 1 ]; do 24 | if [ $iteration -eq $limit ]; then 25 | echo "Pod is not ready after $time_limit seconds, timed out" 26 | exit 2 27 | fi 28 | echo "Waiting for pod to be ready" 29 | sleep 3 30 | count=$(kubectl get pods | grep my-csi-app-inline-volume | grep Running | wc -l) 31 | iteration=$[$iteration +1] 32 | done 33 | 34 | echo 35 | echo "kubectl get pods | grep my-csi-app-inline-volumes" 36 | kubectl get pods | grep my-csi-app-inline-volumes 37 | echo 38 | echo "kubectl exec my-csi-app-inline-volumes -- mount | grep data" 39 | kubectl exec my-csi-app-inline-volumes -- mount | grep data 40 | echo 41 | echo "Pod ready, writing 1 Gb to inline vols:" 42 | echo 43 | echo Before: 44 | echo "kubectl exec my-csi-app-inline-volumes -- df | grep data" 45 | kubectl exec my-csi-app-inline-volumes -- df | grep data 46 | echo 47 | echo kubectl exec -it my-csi-app-inline-volumes -- sh -c "dd bs=1024 count=1048576 data0/file" 48 | kubectl exec -it my-csi-app-inline-volumes -- sh -c "dd bs=1024 count=1048576 data0/file" 49 | echo 50 | echo kubectl exec -it my-csi-app-inline-volumes -- sh -c "dd bs=1024 count=1048576 data1/file" 51 | kubectl exec -it my-csi-app-inline-volumes -- sh -c "dd bs=1024 count=1048576 data1/file" 52 | echo 53 | echo After: 54 | echo "kubectl exec my-csi-app-inline-volumes -- df | grep data" 55 | kubectl exec my-csi-app-inline-volumes -- df | grep data 56 | echo 57 | echo Test Passed 58 | echo 59 | echo Cleaning up 60 | kubectl delete -f sample.yaml 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /test/helm/get.volume.ids: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ids=$(kubectl describe persistentvolume -n helmtest-vxflexos | grep VolumeHandle | awk ' { print $2; }') 3 | echo ids $ids 4 | ids=$(echo $ids | tr ' ' ',' ) 5 | echo ids $ids 6 | -------------------------------------------------------------------------------- /test/helm/helm.lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | FILES="10vols 2vols 7vols xfspre" 15 | 16 | for i in $FILES; 17 | do 18 | helm lint -n helmtest-vxflexos $i 19 | done 20 | -------------------------------------------------------------------------------- /test/helm/logit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | while true 15 | do 16 | date 17 | date >>log.output 18 | running=$(kubectl get pods -n helmtest-vxflexos | grep "Running" | wc -l) 19 | creating=$(kubectl get pods -n helmtest-vxflexos | grep "ContainerCreating" | wc -l) 20 | pvcs=$(kubectl get pvc -n helmtest-vxflexos | wc -l) 21 | echo running $running creating $creating pvcs $pvcs 22 | echo running $running creating $creating pvcs $pvcs >>log.output 23 | sleep 30 24 | done 25 | 26 | -------------------------------------------------------------------------------- /test/helm/mount/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: mount 2 | version: 1.0.0 3 | apiVersion: v1 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 7 | keywords: 8 | - vxflexos-csi 9 | - storage 10 | engine: gotpl 11 | -------------------------------------------------------------------------------- /test/helm/mount/templates/containers.yaml: -------------------------------------------------------------------------------- 1 | kind: StatefulSet 2 | apiVersion: apps/v1 3 | metadata: 4 | name: vxflexos-1-containers 5 | namespace: default 6 | spec: 7 | serviceName: vxflexos-1-containers 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: vxflexos-1-containers 12 | template: 13 | metadata: 14 | labels: 15 | app: vxflexos-1-containers 16 | spec: 17 | containers: 18 | - name: container1 19 | image: quay.io/centos/centos:latest 20 | imagePullPolicy: IfNotPresent 21 | command: ["/bin/sleep", "3600"] 22 | volumeMounts: 23 | - mountPath: "/data0" 24 | name: pvolx1 25 | - name: container2 26 | image: quay.io/centos/centos:latest 27 | imagePullPolicy: IfNotPresent 28 | command: ["/bin/sleep", "3600"] 29 | volumeMounts: 30 | - mountPath: "/data0" 31 | name: pvolx1 32 | - name: container3 33 | image: quay.io/centos/centos:latest 34 | imagePullPolicy: IfNotPresent 35 | command: ["/bin/sleep", "3600"] 36 | volumeMounts: 37 | - mountPath: "/data1" 38 | name: pvolx1 39 | volumes: 40 | - name: pvolx1 41 | persistentVolumeClaim: 42 | claimName: pvolx1-vxflexos 43 | affinity: 44 | podAffinity: 45 | requiredDuringSchedulingIgnoredDuringExecution: 46 | - labelSelector: 47 | matchExpressions: 48 | - key: app 49 | operator: In 50 | values: 51 | - vxflexos-1-containers 52 | topologyKey: "kubernetes.io/hostname" 53 | --- 54 | kind: PersistentVolumeClaim 55 | apiVersion: v1 56 | metadata: 57 | name: pvolx1-vxflexos 58 | namespace: default 59 | spec: 60 | accessModes: 61 | - ReadWriteOnce 62 | volumeMode: Filesystem 63 | resources: 64 | requests: 65 | storage: 8Gi 66 | storageClassName: vxflexos-xfs 67 | -------------------------------------------------------------------------------- /test/helm/mount/templates/test.yaml: -------------------------------------------------------------------------------- 1 | kind: StatefulSet 2 | apiVersion: apps/v1 3 | metadata: 4 | name: vxflexos-1-volumes 5 | namespace: default 6 | spec: 7 | serviceName: vxflexos-1-volumes 8 | replicas: 2 9 | selector: 10 | matchLabels: 11 | app: vxflexos-1-volumes 12 | template: 13 | metadata: 14 | labels: 15 | app: vxflexos-1-volumes 16 | spec: 17 | containers: 18 | - name: test 19 | image: quay.io/centos/centos:latest 20 | imagePullPolicy: IfNotPresent 21 | command: ["/bin/sleep", "3600"] 22 | volumeMounts: 23 | - mountPath: "/data0" 24 | name: pvolx0 25 | volumes: 26 | - name: pvolx0 27 | persistentVolumeClaim: 28 | claimName: pvolx0-vxflexos 29 | affinity: 30 | podAffinity: 31 | requiredDuringSchedulingIgnoredDuringExecution: 32 | - labelSelector: 33 | matchExpressions: 34 | - key: app 35 | operator: In 36 | values: 37 | - vxflexos-1-volumes 38 | topologyKey: "kubernetes.io/hostname" 39 | --- 40 | kind: PersistentVolumeClaim 41 | apiVersion: v1 42 | metadata: 43 | name: pvolx0-vxflexos 44 | namespace: default 45 | spec: 46 | accessModes: 47 | - ReadWriteOnce 48 | volumeMode: Filesystem 49 | resources: 50 | requests: 51 | storage: 8Gi 52 | storageClassName: vxflexos-xfs 53 | -------------------------------------------------------------------------------- /test/helm/scale/10replicas/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 2replicas 2 | version: 1.0.0 3 | appVersion: 1.0.0 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - csi-vxflexos 8 | - storage 9 | engine: gotpl 10 | -------------------------------------------------------------------------------- /test/helm/scale/10replicas/values.yaml: -------------------------------------------------------------------------------- 1 | Replicas: 1 2 | StorageClassName: "default" 3 | Namespace: "test" 4 | -------------------------------------------------------------------------------- /test/helm/scale/2replicas/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 2replicas 2 | version: 1.0.0 3 | appVersion: 1.0.0 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - vxflexos-csi 8 | - storage 9 | engine: gotpl 10 | -------------------------------------------------------------------------------- /test/helm/scale/2replicas/templates/test.yaml: -------------------------------------------------------------------------------- 1 | kind: StatefulSet 2 | apiVersion: apps/v1 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | spec: 7 | replicas: { { required "replicas required" .Values.replicas } } 8 | selector: 9 | matchLabels: 10 | app: vxflextest 11 | template: 12 | metadata: 13 | labels: 14 | app: vxflextest 15 | spec: 16 | serviceAccount: vxflextest 17 | containers: 18 | - name: test 19 | image: quay.io/centos/centos:latest 20 | command: ["/bin/sleep", "3600"] 21 | volumeMounts: 22 | - mountPath: "/data0" 23 | name: pvol0 24 | - mountPath: "/data1" 25 | name: pvol1 26 | volumeClaimTemplates: 27 | - metadata: 28 | name: pvol0 29 | spec: 30 | accessModes: ["ReadWriteOnce"] 31 | storageClassName: vxflexos 32 | resources: 33 | requests: 34 | storage: 8Gi 35 | - metadata: 36 | name: pvol1 37 | spec: 38 | accessModes: ["ReadWriteOnce"] 39 | storageClassName: 40 | { { required "storageClass required" .Values.storageClass } } 41 | resources: 42 | requests: 43 | storage: 8Gi 44 | -------------------------------------------------------------------------------- /test/helm/scale/50replicas/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: 2replicas 2 | version: 1.0.0 3 | appVersion: 1.0.0 4 | description: | 5 | Tests VxFlexOS CSI deployments. 6 | keywords: 7 | - csi-vxflexos 8 | - storage 9 | engine: gotpl 10 | -------------------------------------------------------------------------------- /test/helm/scale/50replicas/values.yaml: -------------------------------------------------------------------------------- 1 | Replicas: 1 2 | StorageClassName: "vxflexos" 3 | -------------------------------------------------------------------------------- /test/helm/scale/rescaletest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | if [ "$1" = "" ]; then echo "arg: replicas"; exit 2; fi 15 | replicas=$1 16 | target=$(expr $replicas \* 3) 17 | echo replicas $replicas target $target 18 | helm upgrade --set "name=pool1,namespace=test,replicas=$replicas,storageClass=vxflexos" pool1 --namespace helmtest-vxflexos 10replicas 19 | helm upgrade --set "name=pool2,namespace=test,replicas=$replicas,storageClass=vxflexos-pool2" pool2 --namespace helmtest-vxflexos 10replicas 20 | helm upgrade --set "name=pool3,namespace=test,replicas=$replicas,storageClass=vxflexos-pool3" pool3 --namespace helmtest-vxflexos 10replicas 21 | 22 | waitOnRunning() { 23 | if [ "$1" = "" ]; then echo "arg: target" ; exit 2; fi 24 | target=$1 25 | running=$(kubectl get pods -n helmtest-vxflexos | grep "Running" | wc -l) 26 | while [ $running -ne $target ]; 27 | do 28 | running=$(kubectl get pods -n helmtest-vxflexos | grep "Running" | wc -l) 29 | creating=$(kubectl get pods -n helmtest-vxflexos | grep "ContainerCreating" | wc -l) 30 | pvcs=$(kubectl get pvc -n helmtest-vxflexos | wc -l) 31 | date 32 | date >>log.output 33 | echo running $running creating $creating pvcs $pvcs 34 | echo running $running creating $creating pvcs $pvcs >>log.output 35 | sleep 30 36 | done 37 | } 38 | 39 | waitOnRunning $target 40 | 41 | -------------------------------------------------------------------------------- /test/helm/scale/results/v1.0.0-15pods-times: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | 0 4 | 0 5 | 0 6 | 0 7 | 0 8 | 0 9 | 0 10 | 0 11 | 0 12 | 0 13 | 0 14 | 0 15 | 0 16 | 1 17 | 1 18 | 1 19 | 1 20 | 1 21 | 1 22 | 2 23 | 2 24 | 2 25 | 2 26 | 2 27 | 2 28 | 2 29 | 2 30 | 2 31 | 2 32 | 2 33 | 2 34 | 2 35 | 2 36 | 3 37 | 3 38 | 3 39 | 3 40 | 3 41 | 3 42 | 3 43 | 3 44 | 3 45 | 4 46 | 4 47 | 4 48 | 4 49 | 4 50 | 4 51 | 4 52 | 4 53 | 4 54 | 5 55 | 5 56 | 5 57 | 5 58 | 5 59 | 6 60 | 6 61 | 6 62 | 6 63 | 6 64 | 6 65 | 6 66 | 6 67 | 6 68 | 6 69 | 6 70 | 6 71 | 6 72 | 6 73 | 6 74 | 6 75 | 6 76 | 6 77 | 6 78 | 6 79 | 7 80 | 7 81 | 7 82 | 7 83 | 7 84 | 7 85 | 8 86 | 8 87 | 8 88 | 8 89 | 8 90 | 8 91 | 8 92 | 8 93 | 8 94 | 8 95 | 8 96 | 8 97 | 8 98 | 8 99 | 8 100 | 8 101 | 9 102 | 9 103 | 9 104 | 9 105 | 9 106 | 9 107 | 9 108 | 10 109 | 10 110 | 10 111 | 10 112 | 10 113 | 10 114 | 10 115 | 10 116 | 10 117 | 10 118 | 10 119 | 10 120 | 10 121 | 10 122 | 10 123 | 10 124 | 10 125 | 10 126 | 10 127 | 10 128 | 10 129 | 10 130 | 11 131 | 11 132 | 11 133 | 11 134 | 10 135 | 11 136 | 11 137 | 11 138 | 13 139 | 13 140 | 13 141 | 13 142 | 13 143 | 13 144 | 13 145 | 13 146 | 13 147 | 13 148 | 13 149 | 13 150 | 13 151 | 13 152 | 13 153 | 13 154 | 14 155 | 14 156 | 14 157 | 14 158 | 14 159 | 14 160 | 14 161 | 14 162 | 14 163 | 14 164 | 14 165 | 14 166 | 14 167 | 14 168 | 14 169 | 14 170 | 14 171 | 14 172 | 14 173 | 14 174 | 14 175 | 14 176 | 14 177 | 15 178 | 12 179 | 12 180 | 12 181 | 10 182 | 9 183 | 9 184 | 8 185 | 6 186 | 6 187 | 4 188 | 2 189 | 2 190 | 1 191 | 0 192 | -------------------------------------------------------------------------------- /test/helm/scale/results/v1.0.1-15pods-times: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | 0 4 | 0 5 | 0 6 | 0 7 | 0 8 | 0 9 | 0 10 | 0 11 | 0 12 | 0 13 | 0 14 | 0 15 | 0 16 | 1 17 | 1 18 | 1 19 | 1 20 | 1 21 | 1 22 | 2 23 | 2 24 | 2 25 | 2 26 | 2 27 | 2 28 | 2 29 | 2 30 | 2 31 | 2 32 | 2 33 | 2 34 | 2 35 | 3 36 | 3 37 | 3 38 | 3 39 | 3 40 | 3 41 | 3 42 | 3 43 | 3 44 | 3 45 | 3 46 | 3 47 | 3 48 | 3 49 | 3 50 | 3 51 | 3 52 | 4 53 | 4 54 | 4 55 | 4 56 | 5 57 | 5 58 | 5 59 | 5 60 | 5 61 | 5 62 | 5 63 | 5 64 | 5 65 | 5 66 | 5 67 | 5 68 | 5 69 | 5 70 | 5 71 | 5 72 | 5 73 | 5 74 | 5 75 | 5 76 | 5 77 | 6 78 | 6 79 | 6 80 | 6 81 | 6 82 | 8 83 | 8 84 | 8 85 | 8 86 | 9 87 | 9 88 | 9 89 | 9 90 | 9 91 | 9 92 | 9 93 | 9 94 | 9 95 | 9 96 | 9 97 | 9 98 | 9 99 | 9 100 | 9 101 | 9 102 | 9 103 | 9 104 | 9 105 | 9 106 | 9 107 | 9 108 | 9 109 | 9 110 | 9 111 | 9 112 | 9 113 | 10 114 | 10 115 | 10 116 | 10 117 | 10 118 | 10 119 | 10 120 | 10 121 | 10 122 | 10 123 | 10 124 | 10 125 | 10 126 | 10 127 | 10 128 | 10 129 | 10 130 | 10 131 | 10 132 | 11 133 | 12 134 | 12 135 | 12 136 | 13 137 | 13 138 | 13 139 | 13 140 | 12 141 | 13 142 | 13 143 | 13 144 | 13 145 | 13 146 | 13 147 | 13 148 | 13 149 | 13 150 | 13 151 | 13 152 | 13 153 | 13 154 | 13 155 | 13 156 | 13 157 | 13 158 | 13 159 | 13 160 | 14 161 | 14 162 | 14 163 | 14 164 | 14 165 | 14 166 | 14 167 | 14 168 | 15 169 | 11 170 | 12 171 | 11 172 | 11 173 | 9 174 | 9 175 | 8 176 | 6 177 | 3 178 | 3 179 | 1 180 | 0 181 | -------------------------------------------------------------------------------- /test/helm/scale/results/v1.0.1-30pods-times: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | 0 4 | 0 5 | 0 6 | 0 7 | 0 8 | 0 9 | 0 10 | 0 11 | 0 12 | 0 13 | 0 14 | 0 15 | 0 16 | 1 17 | 1 18 | 1 19 | 1 20 | 1 21 | 1 22 | 2 23 | 2 24 | 2 25 | 2 26 | 2 27 | 2 28 | 2 29 | 2 30 | 2 31 | 2 32 | 2 33 | 2 34 | 2 35 | 3 36 | 3 37 | 3 38 | 3 39 | 3 40 | 3 41 | 3 42 | 3 43 | 3 44 | 3 45 | 3 46 | 4 47 | 4 48 | 4 49 | 4 50 | 4 51 | 4 52 | 4 53 | 4 54 | 5 55 | 5 56 | 5 57 | 5 58 | 5 59 | 5 60 | 5 61 | 6 62 | 6 63 | 6 64 | 6 65 | 6 66 | 6 67 | 6 68 | 6 69 | 6 70 | 6 71 | 6 72 | 6 73 | 6 74 | 6 75 | 6 76 | 6 77 | 6 78 | 6 79 | 6 80 | 7 81 | 7 82 | 7 83 | 7 84 | 7 85 | 7 86 | 7 87 | 8 88 | 8 89 | 8 90 | 8 91 | 8 92 | 8 93 | 8 94 | 8 95 | 8 96 | 8 97 | 8 98 | 8 99 | 8 100 | 8 101 | 8 102 | 9 103 | 9 104 | 9 105 | 9 106 | 9 107 | 9 108 | 9 109 | 10 110 | 10 111 | 10 112 | 10 113 | 10 114 | 10 115 | 10 116 | 10 117 | 10 118 | 10 119 | 10 120 | 10 121 | 10 122 | 10 123 | 10 124 | 10 125 | 10 126 | 10 127 | 11 128 | 11 129 | 11 130 | 11 131 | 11 132 | 11 133 | 11 134 | 11 135 | 11 136 | 11 137 | 11 138 | 11 139 | 11 140 | 11 141 | 11 142 | 12 143 | 12 144 | 12 145 | 12 146 | 12 147 | 12 148 | 12 149 | 12 150 | 12 151 | 12 152 | 13 153 | 13 154 | 13 155 | 13 156 | 13 157 | 13 158 | 13 159 | 13 160 | 13 161 | 13 162 | 14 163 | 14 164 | 14 165 | 14 166 | 14 167 | 14 168 | 14 169 | 14 170 | 14 171 | 14 172 | 14 173 | 14 174 | 14 175 | 14 176 | 14 177 | 14 178 | 13 179 | 15 180 | 15 181 | 15 182 | 15 183 | 15 184 | 15 185 | 15 186 | 15 187 | 15 188 | 15 189 | 15 190 | 15 191 | 15 192 | 15 193 | 15 194 | 17 195 | 17 196 | 17 197 | 17 198 | 17 199 | 17 200 | 17 201 | 17 202 | 17 203 | 17 204 | 17 205 | 17 206 | 17 207 | 17 208 | 17 209 | 17 210 | 17 211 | 17 212 | 18 213 | 18 214 | 18 215 | 18 216 | 18 217 | 18 218 | 18 219 | 18 220 | 18 221 | 18 222 | 18 223 | 18 224 | 18 225 | 18 226 | 18 227 | 18 228 | 18 229 | 18 230 | 18 231 | 18 232 | 18 233 | 18 234 | 18 235 | 19 236 | 20 237 | 20 238 | 20 239 | 20 240 | 20 241 | 20 242 | 20 243 | 20 244 | 20 245 | 20 246 | 20 247 | 20 248 | 20 249 | 20 250 | 20 251 | 20 252 | 20 253 | 20 254 | 20 255 | 20 256 | 20 257 | 20 258 | 21 259 | 22 260 | 22 261 | 22 262 | 22 263 | 22 264 | 22 265 | 22 266 | 22 267 | 22 268 | 22 269 | 22 270 | 22 271 | 22 272 | 22 273 | 22 274 | 22 275 | 22 276 | 22 277 | 22 278 | 22 279 | 22 280 | 22 281 | 21 282 | 23 283 | 23 284 | 23 285 | 23 286 | 23 287 | 23 288 | 23 289 | 22 290 | 23 291 | 23 292 | 23 293 | 23 294 | 23 295 | 23 296 | 22 297 | 23 298 | 23 299 | 23 300 | 23 301 | 23 302 | 24 303 | 24 304 | 24 305 | 24 306 | 24 307 | 24 308 | 24 309 | 24 310 | 24 311 | 24 312 | 24 313 | 24 314 | 24 315 | 24 316 | 24 317 | 26 318 | 26 319 | 26 320 | 26 321 | 26 322 | 27 323 | 27 324 | 27 325 | 27 326 | 27 327 | 27 328 | 27 329 | 27 330 | 27 331 | 27 332 | 27 333 | 27 334 | 27 335 | 27 336 | 27 337 | 26 338 | 27 339 | 27 340 | 27 341 | 27 342 | 27 343 | 27 344 | 27 345 | 28 346 | 28 347 | 28 348 | 29 349 | 29 350 | 29 351 | 29 352 | 29 353 | 28 354 | 29 355 | 29 356 | 29 357 | 29 358 | 29 359 | 29 360 | 29 361 | 29 362 | 29 363 | 29 364 | 29 365 | 29 366 | 29 367 | 30 368 | 27 369 | 27 370 | 27 371 | 27 372 | 27 373 | 27 374 | 27 375 | 26 376 | 25 377 | 26 378 | 26 379 | 24 380 | 24 381 | 24 382 | 24 383 | 24 384 | 22 385 | 22 386 | 22 387 | 21 388 | 21 389 | 21 390 | 21 391 | 20 392 | 19 393 | 19 394 | 19 395 | 19 396 | 17 397 | 16 398 | 16 399 | 16 400 | 16 401 | 16 402 | 16 403 | 16 404 | 13 405 | 13 406 | 11 407 | 12 408 | 12 409 | 9 410 | 9 411 | 6 412 | 6 413 | 5 414 | 3 415 | 3 416 | 1 417 | 1 418 | 0 419 | -------------------------------------------------------------------------------- /test/helm/scale/results/v1.0.1-3pods: -------------------------------------------------------------------------------- 1 | Wed Feb 27 11:21:31 EST 2019 2 | running 0 creating 0 pvcs 32 3 | Wed Feb 27 11:22:02 EST 2019 4 | running 0 creating 0 pvcs 151 5 | Wed Feb 27 11:22:32 EST 2019 6 | running 0 creating 1 pvcs 151 7 | Wed Feb 27 11:23:03 EST 2019 8 | running 0 creating 3 pvcs 151 9 | Wed Feb 27 11:23:33 EST 2019 10 | running 0 creating 3 pvcs 151 11 | Wed Feb 27 11:24:04 EST 2019 12 | running 0 creating 3 pvcs 151 13 | Wed Feb 27 11:24:34 EST 2019 14 | running 0 creating 3 pvcs 151 15 | Wed Feb 27 11:25:04 EST 2019 16 | running 0 creating 3 pvcs 151 17 | Wed Feb 27 11:25:35 EST 2019 18 | running 0 creating 3 pvcs 151 19 | Wed Feb 27 11:26:05 EST 2019 20 | running 0 creating 3 pvcs 151 21 | Wed Feb 27 11:26:36 EST 2019 22 | running 0 creating 3 pvcs 151 23 | Wed Feb 27 11:27:06 EST 2019 24 | running 0 creating 3 pvcs 151 25 | Wed Feb 27 11:27:36 EST 2019 26 | running 0 creating 3 pvcs 151 27 | Wed Feb 27 11:28:07 EST 2019 28 | running 0 creating 3 pvcs 151 29 | Wed Feb 27 11:28:37 EST 2019 30 | running 0 creating 3 pvcs 151 31 | Wed Feb 27 11:29:08 EST 2019 32 | running 1 creating 2 pvcs 151 33 | Wed Feb 27 11:29:38 EST 2019 34 | running 1 creating 2 pvcs 151 35 | Wed Feb 27 11:30:08 EST 2019 36 | running 1 creating 2 pvcs 151 37 | Wed Feb 27 11:30:39 EST 2019 38 | running 1 creating 2 pvcs 151 39 | Wed Feb 27 11:31:09 EST 2019 40 | running 1 creating 2 pvcs 151 41 | Wed Feb 27 11:31:40 EST 2019 42 | running 1 creating 2 pvcs 151 43 | Wed Feb 27 11:32:10 EST 2019 44 | running 1 creating 2 pvcs 151 45 | Wed Feb 27 11:32:40 EST 2019 46 | running 1 creating 2 pvcs 151 47 | Wed Feb 27 11:33:11 EST 2019 48 | running 1 creating 2 pvcs 151 49 | Wed Feb 27 11:33:41 EST 2019 50 | running 1 creating 2 pvcs 151 51 | Wed Feb 27 11:34:11 EST 2019 52 | running 1 creating 2 pvcs 151 53 | Wed Feb 27 11:34:42 EST 2019 54 | running 1 creating 2 pvcs 151 55 | Wed Feb 27 11:35:12 EST 2019 56 | running 1 creating 2 pvcs 151 57 | Wed Feb 27 11:35:43 EST 2019 58 | running 1 creating 2 pvcs 151 59 | Wed Feb 27 11:36:13 EST 2019 60 | running 1 creating 2 pvcs 151 61 | Wed Feb 27 11:36:43 EST 2019 62 | running 2 creating 1 pvcs 151 63 | Wed Feb 27 11:37:14 EST 2019 64 | running 2 creating 1 pvcs 151 65 | Wed Feb 27 11:37:44 EST 2019 66 | running 2 creating 1 pvcs 151 67 | Wed Feb 27 11:38:15 EST 2019 68 | running 2 creating 1 pvcs 151 69 | Wed Feb 27 11:38:45 EST 2019 70 | running 2 creating 1 pvcs 151 71 | Wed Feb 27 11:39:15 EST 2019 72 | running 2 creating 1 pvcs 151 73 | Wed Feb 27 11:39:46 EST 2019 74 | running 2 creating 1 pvcs 151 75 | Wed Feb 27 11:40:16 EST 2019 76 | running 2 creating 1 pvcs 151 77 | Wed Feb 27 11:40:47 EST 2019 78 | running 2 creating 1 pvcs 151 79 | Wed Feb 27 11:41:17 EST 2019 80 | running 3 creating 0 pvcs 151 81 | -------------------------------------------------------------------------------- /test/helm/scale/scaletest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | if [ "$1" = "" ]; then echo "arg: replicas"; exit 2; fi 15 | replicas=$1 16 | target=$(expr $replicas \* 3) 17 | echo replicas $replicas target $target 18 | helm install --set "name=pool1,replicas=$replicas,storageClass=vxflexos" -n pool1 --namespace helmtest-vxflexos 50replicas 19 | helm install --set "name=pool2,replicas=$replicas,storageClass=vxflexos-pool2" -n pool2 --namespace helmtest-vxflexos 50replicas 20 | helm install --set "name=pool3,replicas=$replicas,storageClass=vxflexos-pool3" -n pool3 --namespace helmtest-vxflexos 50replicas 21 | 22 | waitOnRunning() { 23 | if [ "$1" = "" ]; then echo "arg: target" ; exit 2; fi 24 | target=$1 25 | running=$(kubectl get pods -n helmtest-vxflexos | grep "Running" | wc -l) 26 | while [ $running -ne $target ]; 27 | do 28 | running=$(kubectl get pods -n helmtest-vxflexos | grep "Running" | wc -l) 29 | creating=$(kubectl get pods -n helmtest-vxflexos | grep "ContainerCreating" | wc -l) 30 | pvcs=$(kubectl get pvc -n helmtest-vxflexos | wc -l) 31 | date 32 | date >>log.output 33 | echo running $running creating $creating pvcs $pvcs 34 | echo running $running creating $creating pvcs $pvcs >>log.output 35 | sleep 30 36 | done 37 | } 38 | waitOnRunning $target 39 | 40 | sh rescaletest.sh 0 0 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /test/helm/scale/serviceAccount.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | -------------------------------------------------------------------------------- /test/helm/snap1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshot 3 | metadata: 4 | name: pvol0-snap1 5 | namespace: helmtest-vxflexos 6 | spec: 7 | volumeSnapshotClassName: vxflexos-snapclass 8 | source: 9 | persistentVolumeClaimName: pvol0 10 | -------------------------------------------------------------------------------- /test/helm/snap2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshot 3 | metadata: 4 | name: pvol0-snap2 5 | namespace: helmtest-vxflexos 6 | spec: 7 | volumeSnapshotClassName: vxflexos-snapclass 8 | source: 9 | persistentVolumeClaimName: pvol0 10 | -------------------------------------------------------------------------------- /test/helm/snaprestoretest-nfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | NS=helmtest-vxflexos 15 | source ./common.bash 16 | 17 | echo "installing a 1 volume container" 18 | bash starttest.sh 1vol-nfs 19 | echo "done installing a 1 volume container" 20 | echo "marking volume" 21 | kubectl exec -n ${NS} vxflextest-0 -- touch /data0/orig 22 | kubectl exec -n ${NS} vxflextest-0 -- ls -l /data0 23 | kubectl exec -n ${NS} vxflextest-0 -- sync 24 | kubectl exec -n ${NS} vxflextest-0 -- sync 25 | echo "creating snap1 of pvol0" 26 | kubectl create -f snap1.yaml 27 | sleep 10 28 | kubectl get volumesnapshot -n ${NS} 29 | echo "updating container to add a volume sourced from snapshot" 30 | helm upgrade -n helmtest-vxflexos 1vol-nfs 1vols+restore-nfs 31 | echo "waiting for container to upgrade/stabalize" 32 | sleep 20 33 | waitOnRunning 34 | kubectl describe pods -n ${NS} 35 | kubectl exec -n ${NS} vxflextest-0 -- df | grep data 36 | kubectl exec -n ${NS} vxflextest-0 -- mount | grep data 37 | echo "updating container finished" 38 | echo "marking volume" 39 | kubectl exec -n ${NS} vxflextest-0 -- touch /data0/new 40 | echo "listing /data0" 41 | kubectl exec -n ${NS} vxflextest-0 -- ls -l /data0 42 | sleep 20 43 | echo "deleting snap" 44 | kubectl delete volumesnapshot pvol0-snap1 -n ${NS} 45 | sleep 10 46 | echo "deleting container" 47 | bash stoptest.sh 1vol-nfs 48 | sleep 5 49 | 50 | -------------------------------------------------------------------------------- /test/helm/snaprestoretest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | NS=helmtest-vxflexos 15 | source ./common.bash 16 | 17 | echo "installing a 2 volume container" 18 | bash starttest.sh 2vols 19 | echo "done installing a 2 volume container" 20 | echo "marking volume" 21 | kubectl exec -n ${NS} vxflextest-0 -- touch /data0/orig 22 | kubectl exec -n ${NS} vxflextest-0 -- ls -l /data0 23 | kubectl exec -n ${NS} vxflextest-0 -- sync 24 | kubectl exec -n ${NS} vxflextest-0 -- sync 25 | echo "creating snap1 of pvol0" 26 | kubectl create -f snap1.yaml 27 | sleep 10 28 | kubectl get volumesnapshot -n ${NS} 29 | echo "updating container to add a volume sourced from snapshot" 30 | helm upgrade -n helmtest-vxflexos 2vols 2vols+restore 31 | echo "waiting for container to upgrade/stabalize" 32 | sleep 20 33 | waitOnRunning 34 | kubectl describe pods -n ${NS} 35 | kubectl exec -n ${NS} vxflextest-0 -- df | grep data 36 | kubectl exec -n ${NS} vxflextest-0 -- mount | grep data 37 | echo "updating container finished" 38 | echo "marking volume" 39 | kubectl exec -n ${NS} vxflextest-0 -- touch /data2/new 40 | echo "listing /data0" 41 | kubectl exec -n ${NS} vxflextest-0 -- ls -l /data0 42 | echo "listing /data2" 43 | kubectl exec -n ${NS} vxflextest-0 -- ls -l /data2 44 | sleep 20 45 | echo "deleting container" 46 | bash stoptest.sh 2vols 47 | sleep 5 48 | echo "deleting snap" 49 | kubectl delete volumesnapshot pvol0-snap1 -n ${NS} 50 | -------------------------------------------------------------------------------- /test/helm/snaptest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | NS=helmtest-vxflexos 15 | source ./common.bash 16 | 17 | echo "creating snap1 of pvol0" 18 | kubectl create -f snap1.yaml 19 | sleep 10 20 | kubectl get volumesnapshot -n ${NS} 21 | kubectl describe volumesnapshot -n ${NS} 22 | sleep 10 23 | echo "creating snap2 of pvol0" 24 | kubectl create -f snap2.yaml 25 | sleep 10 26 | kubectl describe volumesnapshot -n ${NS} 27 | sleep 10 28 | echo "deleting snapshots..." 29 | kubectl delete volumesnapshot pvol0-snap1 -n ${NS} 30 | sleep 10 31 | kubectl delete volumesnapshot pvol0-snap2 -n ${NS} 32 | sleep 10 33 | kubectl get volumesnapshot -n ${NS} 34 | 35 | -------------------------------------------------------------------------------- /test/helm/starttest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | [ "$1" = "" ] && { 15 | echo "requires test name as argument" 16 | exit 2 17 | } 18 | NS=helmtest-vxflexos 19 | source ./common.bash 20 | 21 | RELEASE=`basename "${1}"` 22 | 23 | helm install -n ${NS} "${RELEASE}" $1 24 | 25 | sleep 30 26 | kubectl describe pods -n ${NS} 27 | waitOnRunning 28 | kubectl describe pods -n ${NS} 29 | kubectl exec -n ${NS} vxflextest-0 -- df | grep data 30 | kubectl exec -n ${NS} vxflextest-0 -- mount | grep data 31 | -------------------------------------------------------------------------------- /test/helm/stoptest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | helm delete -n helmtest-vxflexos $1 15 | sleep 10 16 | kubectl get pods -n helmtest-vxflexos 17 | sleep 20 18 | sh deletepvcs.sh -n helmtest-vxflexos 19 | kubectl get persistentvolumes -o wide 20 | -------------------------------------------------------------------------------- /test/helm/volumeclonetest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | NS=helmtest-vxflexos 15 | source ./common.bash 16 | 17 | echo "installing a 2 volume container" 18 | bash starttest.sh 2vols 19 | echo "done installing a 2 volume container" 20 | echo "marking volume" 21 | kubectl exec -n $NS vxflextest-0 -- touch /data0/orig 22 | kubectl exec -n $NS vxflextest-0 -- ls -l /data0 23 | kubectl exec -n $NS vxflextest-0 -- sync 24 | kubectl exec -n $NS vxflextest-0 -- sync 25 | 26 | echo "Calculating checksum of /data0/orig" 27 | data0checksum=$(kubectl exec vxflextest-0 -n $NS -- md5sum /data0/orig) 28 | echo $data0checksum 29 | 30 | echo "updating container to add a volume cloned from another volume" 31 | helm upgrade -n $NS 2vols 2vols+clone 32 | echo "waiting for container to upgrade/stabalize" 33 | sleep 20 34 | waitOnRunning 35 | 36 | kubectl describe pods -n $NS 37 | kubectl exec -n $NS vxflextest-0 -- df | grep data 38 | kubectl exec -n $NS vxflextest-0 -- mount | grep data 39 | echo "updating container finished" 40 | echo "marking volume" 41 | kubectl exec -n $NS vxflextest-0 -- touch /data2/new 42 | echo "listing /data0" 43 | kubectl exec -n $NS vxflextest-0 -- ls -l /data0 44 | echo "listing /data2" 45 | kubectl exec -n $NS vxflextest-0 -- ls -l /data2 46 | 47 | echo "Calculating checksum of the cloned file(/data2/orig)" 48 | data2checksum=$(kubectl exec vxflextest-0 -n $NS -- md5sum /data2/orig) 49 | echo $data2checksum 50 | echo "Comparing checksums" 51 | echo $data0checksum 52 | echo $data2checksum 53 | data0chs=$(echo $data0checksum | awk '{print $1}') 54 | data2chs=$(echo $data2checksum | awk '{print $1}') 55 | if [ "$data0chs" = "$data2chs" ]; then 56 | echo "Both the checksums match!!!" 57 | else 58 | echo "Checksums don't match" 59 | fi 60 | 61 | sleep 5 62 | 63 | echo "deleting container" 64 | bash stoptest.sh 2vols 65 | sleep 5 66 | -------------------------------------------------------------------------------- /test/helm/volumesnapshotclass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshotClass 3 | metadata: 4 | name: vxflexos-snapclass 5 | driver: csi-vxflexos.dellemc.com 6 | deletionPolicy: Delete 7 | -------------------------------------------------------------------------------- /test/helm/xfspre/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: xfspre 2 | version: 0.0.1 3 | apiVersion: v1 4 | appVersion: 2.6.0 5 | description: | 6 | Tests VxFlexOS CSI deployments. 7 | icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 8 | keywords: 9 | - vxflexos-csi 10 | - storage 11 | engine: gotpl 12 | -------------------------------------------------------------------------------- /test/helm/xfspre/templates/pv.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: vol4 5 | namespace: helmtest-vxflexos 6 | spec: 7 | capacity: 8 | storage: 16Gi 9 | csi: 10 | driver: csi-vxflexos.dellemc.com 11 | fsType: xfs 12 | volumeHandle: 184e2e5300000000 13 | volumeMode: Filesystem 14 | accessModes: 15 | - ReadWriteOnce 16 | storageClassName: vxflexos 17 | -------------------------------------------------------------------------------- /test/helm/xfspre/templates/pvc4.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pvol4 5 | namespace: helmtest-vxflexos 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | volumeMode: Filesystem 10 | volumeName: vol4 11 | resources: 12 | requests: 13 | storage: 16Gi 14 | storageClassName: vxflexos 15 | -------------------------------------------------------------------------------- /test/helm/xfspre/templates/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: vxflextest 5 | namespace: helmtest-vxflexos 6 | --- 7 | kind: StatefulSet 8 | apiVersion: apps/v1 9 | metadata: 10 | name: vxflextest 11 | namespace: helmtest-vxflexos 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: vxflextest 16 | serviceName: xfspre 17 | template: 18 | metadata: 19 | labels: 20 | app: vxflextest 21 | spec: 22 | serviceAccount: vxflextest 23 | containers: 24 | - name: test 25 | image: quay.io/centos/centos:latest 26 | command: ["/bin/sleep", "3600"] 27 | volumeMounts: 28 | - mountPath: "/data4" 29 | name: pvol4 30 | volumes: 31 | - name: pvol4 32 | persistentVolumeClaim: 33 | claimName: pvol4 34 | -------------------------------------------------------------------------------- /test/integration/features/array-config/multi-az: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "endpoint": "https://127.0.0.1", 4 | "username": "username", 5 | "password": "password", 6 | "insecure": true, 7 | "isDefault": true, 8 | "systemID": "0000000000000001", 9 | "mdm": "127.0.0.2,127.0.0.3", 10 | "zone": { 11 | "name": "myZone", 12 | "labelKey": "zone.csi-vxflexos.dellemc.com", 13 | "protectionDomains": [ 14 | { 15 | "name": "myDomain", 16 | "pools": [ 17 | "myPool" 18 | ] 19 | } 20 | ] 21 | } 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /test/integration/pool.yml: -------------------------------------------------------------------------------- 1 | storagepool: pool1 2 | -------------------------------------------------------------------------------- /test/integration/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | # This will run coverage analysis using the integration testing. 15 | # The env.sh must point to a valid VxFlexOS deployment and and SDC must be installed 16 | # on this system. This will make real calls to the SIO. 17 | # NOTE: you must run this as root, as the plugin cannot retrieve the SdcGUID without being root! 18 | 19 | sh validate_http_unauthorized.sh 20 | rc=$? 21 | if [ $rc -ne 0 ]; then echo "failed http unauthorized test"; exit $rc; fi 22 | 23 | rm -f unix_sock 24 | . ../../env.sh 25 | echo $SDC_GUID 26 | 27 | testRun=$1 28 | 29 | GOOS=linux CGO_ENABLED=0 GO111MODULE=on go test -v -coverprofile=c.linux.out -timeout 60m -coverpkg=github.com/dell/csi-vxflexos/service -run "^$testRun\$\$" & 30 | if [ -f ./csi-sanity ] ; then 31 | sleep 5 32 | ./csi-sanity --csi.endpoint=./unix_sock --csi.testvolumeparameters=./pool.yml --csi.testvolumesize 8589934592 33 | fi 34 | wait 35 | 36 | echo "copying integration.xml from " `pwd` 37 | mv integration*.xml /root/vxflexos/logs/ 38 | -------------------------------------------------------------------------------- /test/integration/validate_http_unauthorized.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | source ../../env.sh 15 | rm -rf unix_sock 16 | 17 | ../../csi-vxflexos --driver-config-params=../../service/features/driver-config/logConfig.yaml --array-config="wrong_config.json" 2>stderr 18 | grep "Unauthorized" stderr 19 | rc=$? 20 | echo rc $rc 21 | if [ $rc -ne 0 ]; then echo "failed..."; else echo "passed"; fi 22 | exit $rc 23 | -------------------------------------------------------------------------------- /test/integration/wrong_config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "username": "username", 4 | "password": "password", 5 | "systemID": "system_name", 6 | "endpoint": "https://127.0.0.1", 7 | "insecure": true, 8 | "isDefault": true 9 | }, 10 | { 11 | "username": "username", 12 | "password": "password", 13 | "systemID": "system_name", 14 | "endpoint": "https://127.0.0.1", 15 | "insecure": true 16 | } 17 | ] 18 | 19 | -------------------------------------------------------------------------------- /test/sanity/README.md: -------------------------------------------------------------------------------- 1 | # Sanity Tests for CSI PowerFlex 2 | 3 | This test runs the Kubernetes sanity test at https://github.com/kubernetes-csi/csi-test. 4 | 5 | ## Running 6 | 7 | ### Installing csi-sanity 8 | 1. Clone the Kubernetes [csi-test](https://github.com/kubernetes-csi/csi-test.git). 9 | 1. From the [releases](https://github.com/kubernetes-csi/csi-test/releases), checkout the supported CSI spec version you wish to test against. 10 | 1. Navigate to `cmd/csi-sanity` and run `make clean install`. 11 | 12 | ### Running Sanity Test 13 | **Note:** Prior to running the sanity tests, ensure that the following files are up-to-date: 14 | - `csi-powerflex/env.sh` 15 | - `csi-powerflex/test/sanity/secrets.yaml` 16 | - `csi-powerflex/test/sanity/volParams.yaml` 17 | 18 | 1. Build the PowerFlex version that you wish to test against. 19 | - `make clean build` 20 | 1. Navigate to the testing folder: `csi-powerflex/test/sanity/`. 21 | 1. Update `start_driver.sh` to include the correct parameters. 22 | - Ensure `-array-config`, `-driver-config-params`, and `-kubeconfig` are poiting to the correct locations. 23 | 1. Start the driver: `sh start_driver.sh`. 24 | 1. Open up another window and navigate to `csi-powerflex/test/sanity`. 25 | 1. Run `sh run.sh` to execute the test once. 26 | - Use `debug_help.sh` to run the test X number of times. 27 | - `sh debug_help.sh run.sh 100 30` - This runs `run.sh` 100 times, with 30 second breaks inbetween each run. 28 | - This is useful for catching non-consitent errors. A 30 second wait time is a good idea when running the tests over 5 times with the script, to allow enough time for the tests to cleanup. 29 | 30 | ## Excluded Tests 31 | 32 | 1. `pagination should detect volumes added between pages and accept tokens when the last volume from a page is deleted` 33 | - **Reason:** The test attempts to delete all volumes on the page, even if they are not created by the test itself. This makes running the test on a non-idle server nearly impossible. 34 | 35 | 2. `check the presence of new volumes and absence of deleted ones in the volume list` 36 | - **Reason:** The test does not account for volumes created/deleted by other users while running. Here is an outline of the test: 37 | 1. Checks number of volumes 38 | 2. Adds a volume 39 | 3. Checks number of volumes 40 | 4. Deletes a volume 41 | 5. Checks number of volumes 42 | - When it checks number of volumes in step 5, it is expecting the same value as when it checked in step 1. However, if someone else was adding/deleting volumes on the server, while this test was running, then the total number of volumes in steps 1 and 5 aren't gaurenteed to be equal. 43 | 44 | 3. `should fail when the volume is missing` 45 | - **Reason:** The test: `should fail when the volume is missing` expects `NodeUnpublishVolume` to return an error when a volume is not found. The spec is a bit unclear, saying that the method should return an error, but also demanding that the method be idempotent. Since Kubelet might try forever if the "not found" error is returned, the node.go code was left unchanged and the test skipped. If we wanted to change the code to pass the test, we would need to stress test all supported versions of k8s to ensure that kubelet doesn't get stuck. 46 | -------------------------------------------------------------------------------- /test/sanity/debug_help.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | tests=$1 15 | times_to_run=$2 16 | seconds_to_wait=$3 17 | 18 | echo "Running the tests $times_to_run times, with $seconds_to_wait seconds in between runs!" 19 | 20 | 21 | counter=1 22 | sh $tests > debugTestOutput.txt 23 | echo "Ran tests once!" 24 | 25 | 26 | while grep "SUCCESS!" debugTestOutput.txt && (($counter<$times_to_run)) 27 | do 28 | echo "Sleeping for $seconds_to_wait seconds!" 29 | sleep $seconds_to_wait 30 | sh $tests > debugTestOutput.txt 31 | ((counter ++)) 32 | echo "Ran tests $counter times!" 33 | 34 | done 35 | 36 | 37 | if grep "SUCCESS!" debugTestOutput.txt 38 | then 39 | echo "tests passed all $counter times!" 40 | else 41 | echo "tests Failed on $counter attempt." 42 | fi 43 | 44 | -------------------------------------------------------------------------------- /test/sanity/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | rm -rf /tmp/csi-staging 15 | rm -rf /tmp/csi-mount 16 | 17 | csi-sanity --ginkgo.v --csi.endpoint=./unix_sock --csi.testvolumeexpandsize 25769803776 --csi.testvolumesize 17179869184 --csi.testvolumeparameters=volParams.yaml --csi.secrets=secrets.yaml --ginkgo.skip "pagination should detect volumes added between pages and accept tokens when the last volume from a page is deleted|check the presence of new volumes and absence of deleted ones in the volume list|should fail when the volume is missing" 18 | -------------------------------------------------------------------------------- /test/sanity/secrets.yaml: -------------------------------------------------------------------------------- 1 | CreateVolumeSecret: 2 | storagepool: "pool1" 3 | -------------------------------------------------------------------------------- /test/sanity/start_driver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License 13 | 14 | # The config.json should have connection data for a valid PowerFlex deployment set as "isDefault": true, and 15 | # the iscsi packages must be installed on this system. This will make real calls to PowerFlex 16 | 17 | rm -f unix_sock 18 | source ../../env.sh 19 | 20 | echo "Starting the csi-vxflexos driver. You should wait until the node setup is complete before running tests." 21 | 22 | ../../csi-vxflexos -array-config= -driver-config-params= -kubeconfig= 23 | -------------------------------------------------------------------------------- /test/sanity/volParams.yaml: -------------------------------------------------------------------------------- 1 | storagepool: pool1 2 | --------------------------------------------------------------------------------