From 5c36d4f4acdcff4cc0cf4a186fa944a33f5c1b34 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Thu, 30 Jul 2015 05:53:21 +0000 Subject: [PATCH 1/3] amulet test update - switch to consume the usual vip env var; extend test coverage across supported releases --- Makefile | 16 +++++++--------- metadata.yaml | 2 +- ...trusty-icehouse => 015-basic-trusty-icehouse} | 0 tests/016-basic-trusty-juno | 11 +++++++++++ tests/017-basic-trusty-kilo | 11 +++++++++++ tests/019-basic-vivid-kilo | 9 +++++++++ tests/basic_deployment.py | 2 +- 7 files changed, 40 insertions(+), 11 deletions(-) rename tests/{15-basic-trusty-icehouse => 015-basic-trusty-icehouse} (100%) create mode 100755 tests/016-basic-trusty-juno create mode 100755 tests/017-basic-trusty-kilo create mode 100755 tests/019-basic-vivid-kilo diff --git a/Makefile b/Makefile index 4d4c462..d776bbb 100644 --- a/Makefile +++ b/Makefile @@ -5,20 +5,18 @@ lint: @flake8 --exclude hooks/charmhelpers hooks unit_tests tests @charm proof -unit_test: +test: + @# Bundletester expects unit tests here. @echo Starting unit tests... @$(PYTHON) /usr/bin/nosetests --nologcapture --with-coverage unit_tests -test: +functional_test: @echo Starting Amulet tests... -ifndef OS_CHARMS_AMULET_VIP - @echo "WARNING: HA tests require OS_CHARMS_AMULET_VIP set to usable vip address" +ifndef AMULET_OS_VIP + @echo "ERROR: HA tests require AMULET_OS_VIP set to usable vip address" + @exit 1 endif - # 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,OS_CHARMS_AMULET_VIP --timeout 900 \ - 00-setup 15-basic-trusty-icehouse + @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --timeout 2700 bin/charm_helpers_sync.py: @mkdir -p bin diff --git a/metadata.yaml b/metadata.yaml index 8609915..a4d5ede 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -4,7 +4,7 @@ maintainer: Andres Rodriguez subordinate: true description: | Corosync/Pacemaker -categories: +tags: - misc requires: juju-info: diff --git a/tests/15-basic-trusty-icehouse b/tests/015-basic-trusty-icehouse similarity index 100% rename from tests/15-basic-trusty-icehouse rename to tests/015-basic-trusty-icehouse diff --git a/tests/016-basic-trusty-juno b/tests/016-basic-trusty-juno new file mode 100755 index 0000000..3e84395 --- /dev/null +++ b/tests/016-basic-trusty-juno @@ -0,0 +1,11 @@ +#!/usr/bin/python + +"""Amulet tests on a basic hacluster deployment on trusty-juno.""" + +from basic_deployment import HAClusterBasicDeployment + +if __name__ == '__main__': + deployment = HAClusterBasicDeployment(series='trusty', + openstack='cloud:trusty-juno', + source='cloud:trusty-updates/juno') + deployment.run_tests() diff --git a/tests/017-basic-trusty-kilo b/tests/017-basic-trusty-kilo new file mode 100755 index 0000000..7391457 --- /dev/null +++ b/tests/017-basic-trusty-kilo @@ -0,0 +1,11 @@ +#!/usr/bin/python + +"""Amulet tests on a basic hacluster deployment on trusty-kilo.""" + +from basic_deployment import HAClusterBasicDeployment + +if __name__ == '__main__': + deployment = HAClusterBasicDeployment(series='trusty', + openstack='cloud:trusty-kilo', + source='cloud:trusty-updates/kilo') + deployment.run_tests() diff --git a/tests/019-basic-vivid-kilo b/tests/019-basic-vivid-kilo new file mode 100755 index 0000000..9398b31 --- /dev/null +++ b/tests/019-basic-vivid-kilo @@ -0,0 +1,9 @@ +#!/usr/bin/python + +"""Amulet tests on a basic hacluster deployment on vivid-kilo.""" + +from basic_deployment import HAClusterBasicDeployment + +if __name__ == '__main__': + deployment = HAClusterBasicDeployment(series='vivid') + deployment.run_tests() diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 617d600..91d8e2d 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -24,7 +24,7 @@ class HAClusterBasicDeployment(OpenStackAmuletDeployment): """Deploy the entire test environment.""" super(HAClusterBasicDeployment, self).__init__(series, openstack, source, stable) - env_var = 'OS_CHARMS_AMULET_VIP' + env_var = 'AMULET_OS_VIP' self._vip = os.getenv(env_var, None) if not self._vip: amulet.raise_status(amulet.SKIP, msg="No vip provided with '%s' - " From b7c7a3b0d3eb8e228e94c0b5b047f5724e8b028e Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Thu, 30 Jul 2015 06:41:07 +0000 Subject: [PATCH 2/3] remove t-j, t-k test targets, charm does not support openstack-origin. --- tests/016-basic-trusty-juno | 11 ----------- tests/017-basic-trusty-kilo | 11 ----------- 2 files changed, 22 deletions(-) delete mode 100755 tests/016-basic-trusty-juno delete mode 100755 tests/017-basic-trusty-kilo diff --git a/tests/016-basic-trusty-juno b/tests/016-basic-trusty-juno deleted file mode 100755 index 3e84395..0000000 --- a/tests/016-basic-trusty-juno +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/python - -"""Amulet tests on a basic hacluster deployment on trusty-juno.""" - -from basic_deployment import HAClusterBasicDeployment - -if __name__ == '__main__': - deployment = HAClusterBasicDeployment(series='trusty', - openstack='cloud:trusty-juno', - source='cloud:trusty-updates/juno') - deployment.run_tests() diff --git a/tests/017-basic-trusty-kilo b/tests/017-basic-trusty-kilo deleted file mode 100755 index 7391457..0000000 --- a/tests/017-basic-trusty-kilo +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/python - -"""Amulet tests on a basic hacluster deployment on trusty-kilo.""" - -from basic_deployment import HAClusterBasicDeployment - -if __name__ == '__main__': - deployment = HAClusterBasicDeployment(series='trusty', - openstack='cloud:trusty-kilo', - source='cloud:trusty-updates/kilo') - deployment.run_tests() From ad4ab2220863af4d6664a8a0c697b351cf7553f1 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Thu, 30 Jul 2015 07:49:11 +0000 Subject: [PATCH 3/3] remove vivid test re: bug 1479661 --- tests/019-basic-vivid-kilo | 9 --------- 1 file changed, 9 deletions(-) delete mode 100755 tests/019-basic-vivid-kilo diff --git a/tests/019-basic-vivid-kilo b/tests/019-basic-vivid-kilo deleted file mode 100755 index 9398b31..0000000 --- a/tests/019-basic-vivid-kilo +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/python - -"""Amulet tests on a basic hacluster deployment on vivid-kilo.""" - -from basic_deployment import HAClusterBasicDeployment - -if __name__ == '__main__': - deployment = HAClusterBasicDeployment(series='vivid') - deployment.run_tests()