7
class TestDeployment(unittest.TestCase):
10
cls.deployment = amulet.Deployment(series='trusty')
11
cls.deployment.load_bundle_file(
12
bundle_file='files/plumgrid-gateway.yaml',
13
deployment_name='test')
15
cls.deployment.setup(timeout=2000)
16
cls.deployment.sentry.wait()
17
except amulet.helpers.TimeoutError:
20
msg="Environment wasn't stood up in time")
24
def test_plumgrid_gateway_external_interface(self):
25
pg_sentry = self.deployment.sentry['plumgrid-gateway/0']
26
pg_options = self.deployment.services['plumgrid-gateway']['options']
27
external_interface = pg_options['external-interface']
28
if not external_interface:
31
msg='plumgrid external-interface parameter was not found.')
32
output, code = pg_sentry.run("ethtool {}".format(external_interface))
36
msg='external interface not found on the host')
38
def test_plumgrid_gateway_started(self):
39
pg_sentry = self.deployment.sentry['plumgrid-gateway/0']
40
agent_state = pg_sentry.info['agent-state']
41
if agent_state != 'started':
44
msg='plumgrid gateway is not in a started state')
46
def test_plumgrid_gateway_relation(self):
47
pg_sentry = self.deployment.sentry['plumgrid-gateway/0']
48
relation = pg_sentry.relation(
49
'plumgrid', 'plumgrid-director:plumgrid')
50
if not relation['private-address']:
52
amulet.FAIL, msg='Relation not found.')
54
if __name__ == '__main__':