There are unit tests for gen_extra in Enterprise DC/OS in gen_extra/tests and other unit tests in tests/.
These tests do not need a cluster to run.
Running these locally is documented at https://github.com/mesosphere/dcos-enterprise/blob/master/gen_extra/README.md#manual-setup.
A few changes had to be made to run these tests on macOS.
1. We needed xv
This can be added to the README.
2. We needed to use GNU tar
https://github.com/dcos/dcos/blob/master/pkgpanda/util.py#L228 uses the --owner option which is not supported by bsdtar.
What we did:
- Add brew install gnu-tar to the README and change the relevant code which uses tar so it uses gnu-tar where available.
- Change the to use the relevant options from --gid, --gname, --uid, --uname for a solution compatible with bsdtar and GNU tar.
3. Some tests require new openssl
gen_extra/ca_validate.py uses an openssl binary on the PATH as openssl. Some tests use the relevant function.
By default macOS at the time of writing uses OpenSSL 0.9.8.
This is not new enough to support the -partial_chain option.
At least version 1.0.2 and above support the -partial_chain option.
There are multiple options available:
- Skip the relevant tests if the required openssl version is not available,
- Allow the path to OpenSSL to be passed in, or set as an environment variable.
4. We needed python3.5 on the path
This is possible with pyenv.
5. We needed zlib available