Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.62 KB

TESTING.md

File metadata and controls

57 lines (43 loc) · 1.62 KB

Testing

There are many unit tests written in the respective packages in _test.go files. Along with the unit tests there are integration tests written separately for both Sidecar and Replication controller. These integration tests cover complete end to end scenario testing starting from automated way of creating the resources PVC, PV and RG and by running the sidecar/replication controllers internally from the tests itself.

Integration Tests

The integration test cases can be executed by using the Makefile recipe or from any IDE directly. These tests can be ran against any driver without any modification to the code by just updating the driver and the storage class to use in the stubs and in the integration tests config variable.

	suite.driver = common.Driver{
		DriverName:   "csi-powerstore.dellemc.com",
		StorageClass: "replication-powerstore",
	}

Sidecar

To run sidecar integration tests:

  • Start the mock gRPC server based on the dev environment operating system and wait for the server to start.

    For Linux distros:

     make start-server-unix

    For Windows:

     make start-server-win
  • Open a new terminal window and run the tests.

     make run-sidecar-tests

Replication Controller Manager

To run replication controller tests:

Set REMOTE_KUBE_CONFIG_PATH to the path to the remote cluster's kubeconfig and run the tests.

export REMOTE_KUBE_CONFIG_PATH=$HOME/.kube/config-remote
make run-controller-tests

Unit Tests

To run unit tests for CSM Replication:

make unit-test

Repctl

To run unit test for repctl:

cd ./repctl
make test