Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: note the standard ZONE_NAME value

...

Note that the testclient is available from the superclass using getClsTestClient in this case.

Anchor
checkin
checkin

Checkin/smoke Tests

The agent simulator and marvin are integrated into maven build phases to help you run basic tests before pushing a commit. These tests are integration tests that will test the CloudStack system as a whole. Management Server will be running during the tests with the Simulator Agent responding to hypervisor commands. For running the checkin tests, your developer environment needs to have Marvin installed and working with the latest CloudStack APIs. These tests are lightweight and should ensure that your commit doesnt break critical functionality for others working with the master branch. The checkin-tests utilize marvin and a one-time installation of marvin will be done so as to fetch all the related dependencies. Further updates to marvin can be done by using the sync mechanism described later in this section. In order for these tests to run on simulator, we need to add an attribute  <required_hardware="false"> to these test cases. 

...

command 1: Below command deploys a datacenter.

Code Block
$ python <cs_code_directory>/tools/marvin/marvin/deployDataCenter.py \
    -i <cs_code_directory>/setup/dev/advanced.cfg

Example configs are available in setup/dev/advanced.cfg and setup/dev/basic.cfg

...

command 2: Below command runs the test.

Code Block
$ export MARVIN_CONFIG=setup/dev/advanced.cfg
$ export TEST_SUITE=test/integration/smoke
$ export ZONE_NAME=Sandbox-simulator
$ nosetests-2.7 \
  --with-marvin \
  --marvin-config=/home/abc/softwares/cs_4_4_forward/setup/dev/advanced.cfg${MARVIN_CONFIG} \
  -w /home/abc/softwares/cs_4_4_forward/test/integration/smoke/${TEST_SUITE} \
  --with-xunit \
  --xunit-file=/tmp/bvt_selfservice_cases.xml \
  --zone=<zone_mentioned_config>${ZONE_NAME} \
  --hypervisor=simulator \
  -a tags=advanced,required_hardware=false

The --zone argument should match the name of the zone defined in the config file (currently Sandbox-simulator for basic.cfg and advanced.cfg).

Including your own

Check-In tests are the same as any other tests written using Marvin. The only additional step you need to do is ensure that your test is driven entirely by the API only. This makes it possible to run the test on a simulator. Once you have your test, you need to tag it to run on the simulator so the marvin test runner can pick it up during the checkin-test run. Then place your test module in the test/integration/smoke folder and it will become part of the checkin test run.

...