From 7a15e60dbcc740fa008c48d5afdb6a52ab30e5d1 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Wed, 2 Dec 2015 10:30:35 +0000 Subject: [PATCH 1/3] Workaround odl creating duplicate controller entries in amulet tests --- tests/basic_deployment.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 8b25e4c..343f447 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -217,16 +217,18 @@ class OVSODLBasicDeployment(OpenStackAmuletDeployment): msg="Missing bridge {} from gateway unit".format(bridge) ) cmd = 'ovs-vsctl get-controller {}'.format(bridge) - br_controller, _ = self.gateway_sentry.run(cmd) - br_controller = br_controller.strip() - if br_controller != controller_url: + br_controllers, _ = self.gateway_sentry.run(cmd) + # Beware of duplicate entries: + # https://bugs.opendaylight.org/show_bug.cgi?id=960 + br_controllers = list(set(br_controllers.split('\n'))) + if len(br_controllers) != 1 or br_controllers[0] != controller_url: status, _ = self.gateway_sentry.run('ovs-vsctl show') amulet.raise_status( amulet.FAIL, msg="Controller configuration on bridge" " {} incorrect: {} != {}\n" "{}".format(bridge, - br_controller, + br_controllers, controller_url, status) ) From e445dfbaf192c54ee80c9a26c83e52713aa0fc99 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Fri, 4 Dec 2015 09:38:45 +0000 Subject: [PATCH 2/3] Use tox for lint and unit test targets in Makefile --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5e15fff..1006839 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,16 @@ #!/usr/bin/make PYTHON := /usr/bin/env python +TOX := /usr/bin/env tox lint: @flake8 --exclude hooks/charmhelpers,tests/charmhelpers \ hooks unit_tests tests - @charm proof + @$(TOX) -e lint test: @# Bundletester expects unit tests here. @echo Starting tests... - @$(PYTHON) /usr/bin/nosetests -v --nologcapture --with-coverage unit_tests + @$(TOX) -e py27-trusty functional_test: @echo Starting Amulet tests... From 89821254ff6fb1f4dfc9e51d4839e041f25017db Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 7 Dec 2015 07:37:45 +0000 Subject: [PATCH 3/3] Tox is not available on osci atm so revert to using old method with CHARM_DIR set --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1006839..449fdd5 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,17 @@ #!/usr/bin/make PYTHON := /usr/bin/env python -TOX := /usr/bin/env tox +CHARM_DIR := $(pwd) +export CHARM_DIR lint: @flake8 --exclude hooks/charmhelpers,tests/charmhelpers \ hooks unit_tests tests - @$(TOX) -e lint + @charm proof test: @# Bundletester expects unit tests here. - @echo Starting tests... - @$(TOX) -e py27-trusty + @echo Starting unit tests... + @$(PYTHON) /usr/bin/nosetests -v --nologcapture --with-coverage unit_tests functional_test: @echo Starting Amulet tests...