tests: in case 'go test' is run in a container, skip TestGetPIDLimit()

In (standard, non-privileged) container environments the /sys/fs/cgroup
mountpoint is not available. This would cause the tests to fail, as
TestGetPIDLimit() tries to write to the cgroup configuration.

The test will work when run as root on a privileged container or
directly on a host (as Travis CI does).

Setting the CEPH_CSI_RUN_ALL_TESTS environment variable to a non-empty
value will cause the test to be executed.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos
2020-03-24 08:53:55 +01:00
committed by mergify[bot]
parent 15578432a4
commit a1de56dbd3
3 changed files with 13 additions and 1 deletions

View File

@ -66,6 +66,10 @@ tests:
`$ make test`
Certain unit tests may require extended permissions or other external resources
that are not available by default. To run these tests as well, export the
environment variable `CEPH_CSI_RUN_ALL_TESTS=1` before running the tests.
You will need to provide unit tests and functional tests for your changes
wherever applicable.