charm-cinder/tests
2015-05-12 14:49:27 +00:00
..
charmhelpers Sync charm-helpers 2015-04-22 18:45:46 +00:00
00-setup Initial support for deploying from git 2015-03-07 21:27:57 -05:00
014-basic-precise-icehouse auto rename amulet tests 2015-04-16 21:35:53 +00:00
015-basic-trusty-icehouse auto rename amulet tests 2015-04-16 21:35:53 +00:00
016-basic-trusty-juno auto rename amulet tests 2015-04-16 21:35:53 +00:00
017-basic-trusty-kilo auto disable kilo amulet tests (until later confirmed as functional) 2015-04-16 21:36:22 +00:00
018-basic-utopic-juno auto add amulet tests for supported releases 2015-04-16 21:36:11 +00:00
019-basic-vivid-kilo auto disable kilo amulet tests (until later confirmed as functional) 2015-04-16 21:36:22 +00:00
050-basic-trusty-icehouse-git auto rename amulet tests 2015-04-16 21:35:53 +00:00
051-basic-trusty-juno-git auto rename amulet tests 2015-04-16 21:35:53 +00:00
053-basic-trusty-kilo-git auto disable kilo amulet tests (until later confirmed as functional) 2015-04-16 21:36:22 +00:00
054-basic-vivid-kilo-git auto disable kilo amulet tests (until later confirmed as functional) 2015-04-16 21:36:22 +00:00
basic_deployment.py Clone from github in deploy from source amulet tests 2015-05-12 14:49:27 +00:00
README Amulet test fixes: 2014-10-07 18:32:59 +00:00

This directory provides Amulet tests that focus on verification of Cinder
deployments.

In order to run tests, you'll need charm-tools installed (in addition to
juju, of course):
    sudo add-apt-repository ppa:juju/stable
    sudo apt-get update
    sudo apt-get install charm-tools

If you use a web proxy server to access the web, you'll need to set the
AMULET_HTTP_PROXY environment variable to the http URL of the proxy server.

The following examples demonstrate different ways that tests can be executed.
All examples are run from the charm's root directory.

  * To run all tests (starting with 00-setup):

      make test

  * To run a specific test module (or modules):

      juju test -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse

  * To run a specific test module (or modules), and keep the environment
    deployed after a failure:

      juju test --set-e -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse

  * To re-run a test module against an already deployed environment (one
    that was deployed by a previous call to 'juju test --set-e'):

      ./tests/15-basic-trusty-icehouse


For debugging and test development purposes, all code should be idempotent.
In other words, the code should have the ability to be re-run without changing
the results beyond the initial run.  This enables editing and re-running of a
test module against an already deployed environment, as described above.

Additional testing and debug information:

  * Use DEBUG to turn on debug logging, use ERROR otherwise.

      u = OpenStackAmuletUtils(ERROR)
      u = OpenStackAmuletUtils(DEBUG)

  * To interact with the deployed environment:

      export OS_USERNAME=admin
      export OS_PASSWORD=openstack
      export OS_TENANT_NAME=admin
      export OS_REGION_NAME=RegionOne
      export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0
      keystone user-list
      cinder list

  * Handy commands for watching these tests run or manually poking around:

      watch "cinder list && cinder snapshot-list && glance image-list"
      watch "juju get cinder | egrep 'verbose|debug|true|false'"
      watch "juju ssh cinder/0 'sudo lvs && sudo status cinder-api && sudo status cinder-volume'"
      juju set cinder verbose=false && juju set cinder debug=false

  * Be aware that method names that start with 'test_' are called in alpha/num
    order.  Test methods which are order-sensitive can be numbered to ensure
    that they run in the expected order.  ex:

      test_000_earlytest
      test_300_sometest
      test_999_latertest

  * Preserving the deployed environment:
    Even with juju --set-e, amulet will tear down the juju environment
    when all tests pass.  This force_fail 'test' can be used in basic_deployment.py
    to simulate a failed test and keep the environment.

    def test_zzzz_fake_fail(self):
        '''Force a fake fail to keep juju environment after a successful test run'''
        # Useful in test writing, when used with:   juju test --set-e
        amulet.raise_status(amulet.FAIL, msg='using fake fail to keep juju environment')