Skip to content

Commit

Permalink
Add zone volume creation integration tests (#359)
Browse files Browse the repository at this point in the history
* Add zone volume creation integration tests

* Fix golangci-lint issue

* Create e2e zone tests

* Adjust indentation of template yaml files

* Adjust indentation of template yaml files

* Update e2e file names

* Format e2e files for golangci-lint

* Update e2e test scenarios

* Update pod templates

* Address PR comments

* Add README to e2e tests

* Update sts templates
  • Loading branch information
falfaroc committed Dec 4, 2024
1 parent 9f53cb4 commit 7a581e2
Show file tree
Hide file tree
Showing 12 changed files with 703 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ unit-test:

# Linux only; populate env.sh with the hardware parameters
integration-test:
( cd test/integration; sh run.sh )
( cd test/integration; sh run.sh TestIntegration )

check:
@scripts/check.sh ./provider/ ./service/
Expand Down
23 changes: 23 additions & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: all
all: help

help:
@echo
@echo "The following targets are commonly used:"
@echo
@echo "integration - Run integration tests"
@echo "zone-integration - Run zone-integration tests"
@echo "zone-e2e - Run zone-e2e tests"
@echo

.PHONY: integration
integration:
cd integration; ./run.sh TestIntegration

.PHONY: zone-integration
zone-integration:
cd integration; ./run.sh TestZoneIntegration

.PHONY: zone-e2e
zone-e2e:
go test -v -count=1 -timeout 1h -run '^TestZoneVolumes$$' ./e2e
24 changes: 24 additions & 0 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# End-to-End Tests Overview

## Prerequisite

A couple of assumptions made in the e2e tests are that the driver runs with a valid secret. Other assumptions are:

1. The namespace `vxflexos-test` exists since all k8s objects will be created and checked for there.
2. For `multi-available-zone` tests, the storage class `vxflexos-az-wait` exists (see [storage class](../../samples/storageclass/storageclass-az.yaml) for example).
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.

## Using the Makefile

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:

- `make zone-e2e` -> Runs the end to end tests for `multi-available-zone`.

## Overview of Targets/Tests

### Multi-Available Zone

The following tests are implemented and run during the `zone-e2e` test.

1. Creates a stateful set of 7 replicas and ensures that everything is up and ready with the zone configuration.
2. Cordons a node (marks it as unschedulable), creates 7 volumes/pods, and ensures that none gets scheduled on the cordoned node.
Loading

0 comments on commit 7a581e2

Please sign in to comment.