Testing DCM Agent For Linux¶
This document covers how to run tests locally for development purposes.
Local development tests are supported by Vagrant. You will
find a multi machine Vagrantfile located in src/dcm/agent/tests
. Running the test
suite on a particular distribution is as simple as going to that directory and running
vagrant up <machine name>
. You can get a list of available machine names by running
vagrant status
.
Vagrant up provisions the image with an agent and runs the tests suite with coverage. You will see the output in your terminal.
The following environment variables can be set to customize the test environment.
TEST_AGENT_STORAGE_CREDS
TEST_AGENT_VERSION
TEST_AGENT_BASE_URL
TEST_AGENT_LOCAL
TEST_AGENT_DOCKER_INSTALL
TEST_AGENT_STORAGE_CREDS
is optional and should point to a local file with entries listed like soand enables a subset of tests dealing with mount/unmount commands to run.:
1 <aws_access_key> <aws_secret_key> us_west_oregon
TEST_AGENT_VERSION
is optional and lets you explicitly set the version to test.TEST_AGENT_BASE_URL
is optional and lets you explicitly set where to get the agent package to test.TESTS_AGENT_LOCAL
is optional and runs the test suite against the local source code.TEST_AGENT_DOCKER_INSTALL
is optional and provisions the VM with the agent_docker script.
Running Tests Manually¶
You can alternatively run the tests manually in the VM after the VM is in a running state.
Simply vagrant ssh <machinename>
and do
$ sudo -i
$ source /opt/dcm-agent/embedded/agentve/bin/activate
$ nosetests -v dcm.agent.tests
Using a Remote Debugger¶
Coming Soon!