diff --git a/tests/14-juno b/tests/14-juno index f984cd9..63886be 100755 --- a/tests/14-juno +++ b/tests/14-juno @@ -1,39 +1,55 @@ #!/usr/bin/env python3 import amulet -import requests import unittest + class TestDeployment(unittest.TestCase): @classmethod def setUpClass(cls): cls.deployment = amulet.Deployment(series='trusty') - cls.deployment.load_bundle_file(bundle_file='files/plumgrid-gateway.yaml', deployment_name='test') + cls.deployment.load_bundle_file( + bundle_file='files/plumgrid-gateway.yaml', + deployment_name='test') try: cls.deployment.setup(timeout=2000) cls.deployment.sentry.wait() except amulet.helpers.TimeoutError: - amulet.raise_status(amulet.SKIP, msg="Environment wasn't stood up in time") + amulet.raise_status( + amulet.SKIP, + msg="Environment wasn't stood up in time") except: raise - + def test_plumgrid_gateway_external_interface(self): - external_interface = self.deployment.services['plumgrid-gateway']['options']['external-interface'] + pg_sentry = self.deployment.sentry['plumgrid-gateway/0'] + pg_options = self.deployment.services['plumgrid-gateway']['options'] + external_interface = pg_options['external-interface'] if not external_interface: - amulet.raise_status(amulet.FAIL, msg='plumgrid external-interface parameter was not found.') - output, code = self.deployment.sentry['plumgrid-gateway/0'].run("ethtool {}".format(external_interface)) + amulet.raise_status( + amulet.FAIL, + msg='plumgrid external-interface parameter was not found.') + output, code = pg_sentry.run("ethtool {}".format(external_interface)) if code != 0: - amulet.raise_status(amulet.FAIL, msg='external interface not found on the host') + amulet.raise_status( + amulet.FAIL, + msg='external interface not found on the host') def test_plumgrid_gateway_started(self): - agent_state = self.deployment.sentry['plumgrid-gateway/0'].info['agent-state'] + pg_sentry = self.deployment.sentry['plumgrid-gateway/0'] + agent_state = pg_sentry.info['agent-state'] if agent_state != 'started': - amulet.raise_status(amulet.FAIL, msg='plumgrid gateway is not in a started state') + amulet.raise_status( + amulet.FAIL, + msg='plumgrid gateway is not in a started state') def test_plumgrid_gateway_relation(self): - relation = self.deployment.sentry['plumgrid-gateway/0'].relation('plumgrid-plugin', 'neutron-iovisor:plumgrid-plugin') + pg_sentry = self.deployment.sentry['plumgrid-gateway/0'] + relation = pg_sentry.relation( + 'plumgrid-plugin', 'neutron-iovisor:plumgrid-plugin') if not relation['private-address']: - amulet.raise_status(amulet.FAIL, msg='private address was not set in the plumgrid gateway relation') + amulet.raise_status( + amulet.FAIL, msg='Relation not found.') if __name__ == '__main__': unittest.main() diff --git a/tests/files/plumgrid-gateway.yaml b/tests/files/plumgrid-gateway.yaml index 4bb13bd..8a5af15 100644 --- a/tests/files/plumgrid-gateway.yaml +++ b/tests/files/plumgrid-gateway.yaml @@ -1,10 +1,14 @@ test: series: 'trusty' relations: - - - neutron-api - - neutron-iovisor - - neutron-iovisor - plumgrid-gateway + - - neutron-iovisor + - neutron-plumgrid-plugin + - - keystone + - neutron-plumgrid-plugin + - - neutron-api + - neutron-plumgrid-plugin - - nova-cloud-controller - nova-compute - - glance @@ -26,6 +30,12 @@ test: - - neutron-api - nova-cloud-controller services: + plumgrid-gateway: + charm: cs:~plumgrid-team/trusty/plumgrid-gateway + num_units: 1 + options: + external-interface: 'eth1' + to: 'nova-compute' cinder: charm: cs:trusty/cinder num_units: 1 @@ -50,30 +60,27 @@ test: num_units: 1 to: 'lxc:0' neutron-api: - charm: cs:~juliann/trusty/neutron-api + charm: cs:~plumgrid-team/trusty/neutron-api num_units: 1 options: - install_keys: 'null' - install_sources: "deb http://10.22.24.200/debs ./" neutron-plugin: "plumgrid" - neutron-security-groups: "true" + neutron-security-groups: "false" openstack-origin: "cloud:trusty-juno" plumgrid-password: "plumgrid" plumgrid-username: "plumgrid" plumgrid-virtual-ip: "192.168.100.250" to: 'lxc:0' + neutron-plumgrid-plugin: + charm: cs:~plumgrid-team/trusty/neutron-plumgrid-plugin + options: + install_keys: 'null' + install_sources: "deb http://54.193.161.94/debs/plumgrid/ ./" neutron-iovisor: - charm: cs:~juliann/trusty/neutron-iovisor + charm: cs:~plumgrid-team/trusty/neutron-iovisor num_units: 1 options: install_keys: 'null' - install_sources: "deb http://10.22.24.200/debs ./" - to: 'nova-compute' - plumgrid-gateway: - charm: cs:~juliann/trusty/plumgrid-gateway - num_units: 1 - options: - external-interface: 'eth1' + install_sources: "deb http://54.193.161.94/debs/plumgrid/ ./" to: 'nova-compute' nova-cloud-controller: charm: cs:trusty/nova-cloud-controller @@ -85,7 +92,7 @@ test: quantum-security-groups: 'yes' to: 'lxc:0' nova-compute: - charm: cs:~juliann/trusty/nova-compute + charm: cs:~plumgrid-team/trusty/nova-compute num_units: 1 options: enable-live-migration: true