diff --git a/Makefile b/Makefile index c353b10..3d95205 100644 --- a/Makefile +++ b/Makefile @@ -2,19 +2,17 @@ PYTHON := /usr/bin/env python lint: - @flake8 --exclude hooks/charmhelpers --ignore=E125 hooks - @flake8 --exclude hooks/charmhelpers --ignore=E125 unit_tests tests + @flake8 --exclude hooks/charmhelpers,tests/charmhelpers \ + hooks unit_tests tests @charm proof -unit_test: - @echo Starting unit tests... - @$(PYTHON) /usr/bin/nosetests --nologcapture --with-coverage unit_tests - test: + @# Bundletester expects unit tests here. + @echo Starting unit tests... + @$(PYTHON) /usr/bin/nosetests -v --nologcapture --with-coverage unit_tests + +functional_test: @echo Starting Amulet tests... - # coreycb note: The -v should only be temporary until Amulet sends - # raise_status() messages to stderr: - # https://bugs.launchpad.net/amulet/+bug/1320357 @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --timeout 2700 bin/charm_helpers_sync.py: diff --git a/metadata.yaml b/metadata.yaml index 3c65b5a..c124a8d 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -4,7 +4,8 @@ summary: "Swift proxy node" description: | Swift is a distributed virtual object store. This formula deploys the proxy node to be related to storage nodes. -categories: +tags: + - openstack - cache-proxy provides: nrpe-external-master: diff --git a/tests/00-setup b/tests/00-setup index b78050f..95dffc4 100755 --- a/tests/00-setup +++ b/tests/00-setup @@ -4,8 +4,13 @@ set -ex sudo add-apt-repository --yes ppa:juju/stable sudo apt-get update --yes -sudo apt-get install --yes python-amulet \ - python-swiftclient \ +sudo apt-get install --yes amulet \ + python-cinderclient \ + python-distro-info \ python-glanceclient \ + python-heatclient \ python-keystoneclient \ - python-novaclient + python-neutronclient \ + python-novaclient \ + python-pika \ + python-swiftclient diff --git a/tests/010-basic-precise-essex b/tests/010-basic-precise-essex old mode 100755 new mode 100644 diff --git a/tests/017-basic-trusty-kilo b/tests/017-basic-trusty-kilo old mode 100644 new mode 100755 diff --git a/tests/019-basic-vivid-kilo b/tests/019-basic-vivid-kilo old mode 100644 new mode 100755 diff --git a/tests/020-basic-trusty-liberty b/tests/020-basic-trusty-liberty new file mode 100644 index 0000000..0de89a4 --- /dev/null +++ b/tests/020-basic-trusty-liberty @@ -0,0 +1,11 @@ +#!/usr/bin/python + +"""Amulet tests on a basic swift-proxy deployment on trusty-liberty.""" + +from basic_deployment import SwiftProxyBasicDeployment + +if __name__ == '__main__': + deployment = SwiftProxyBasicDeployment(series='trusty', + openstack='cloud:trusty-liberty', + source='cloud:trusty-updates/liberty') + deployment.run_tests() diff --git a/tests/021-basic-wily-liberty b/tests/021-basic-wily-liberty new file mode 100644 index 0000000..451af87 --- /dev/null +++ b/tests/021-basic-wily-liberty @@ -0,0 +1,9 @@ +#!/usr/bin/python + +"""Amulet tests on a basic swift-proxy deployment on wily-liberty.""" + +from basic_deployment import SwiftProxyBasicDeployment + +if __name__ == '__main__': + deployment = SwiftProxyBasicDeployment(series='wily') + deployment.run_tests() diff --git a/tests/README b/tests/README index cb2c743..2fd8cd6 100644 --- a/tests/README +++ b/tests/README @@ -1,6 +1,16 @@ This directory provides Amulet tests that focus on verification of swift-proxy deployments. +test_* methods are called in lexical sort order, although each individual test +should be idempotent, and expected to pass regardless of run order. + +Test name convention to ensure desired test order: + 1xx service and endpoint checks + 2xx relation checks + 3xx config checks + 4xx functional checks + 9xx restarts and other final checks + In order to run tests, you'll need charm-tools installed (in addition to juju, of course): sudo add-apt-repository ppa:juju/stable diff --git a/tests/tests.yaml b/tests/tests.yaml new file mode 100644 index 0000000..b288149 --- /dev/null +++ b/tests/tests.yaml @@ -0,0 +1,20 @@ +bootstrap: true +reset: true +virtualenv: true +makefile: + - lint + - test +sources: + - ppa:juju/stable +packages: + - amulet + - python-amulet + - python-cinderclient + - python-distro-info + - python-glanceclient + - python-heatclient + - python-keystoneclient + - python-neutronclient + - python-novaclient + - python-pika + - python-swiftclient