Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
/ dothill-api-go Public archive

A Dothill (Seagate) AssuredSAN client library written in Go

License

Notifications You must be signed in to change notification settings

enix/dothill-api-go

Repository files navigation

❗ Warning
As of January 2023, this project is no longer maintained by Enix, and Seagate has taken over the project. We have archived the repository, and we invite you to join this project at Seagate/seagate-exos-x-csi.

dothill-api-go

Build status Go Report Card PkgGoDev License

A Go implementation of the Dothill API.

Run tests using our mock server

In order to run tests, you will need to start a mock server by running go run cmd/mock/mock.go. It will expose the mocked api on localhost:8080.

You're now ready to go, just run go test -v to run the tests suite.

You can also run tests with docker-compose, using this command, which is the one used in the CI:

docker-compose up --build --abort-on-container-exit --exit-code-from tests

Both the mocked api and the tests use as username and passwords variables from the environment, or from the .env file if missing. Since the .env file is pre-filled, you should not have to add any environment variable in order to make the tests work.

Test using a live system

This option runs the golang test cases against a live storage system. Two steps are required:

  • Update .env with the correct system IP address and credentials
  • Run go test -v

Another option is to define environment variables, which take precedence over .env values

export TEST_STORAGEIP=http://<ipaddress>
export TEST_USERNAME=<username>
export TEST_PASSWORD=<password>
go test -v
unset TEST_STORAGEIP TEST_PASSWORD TEST_USERNAME