3
Ubuntu charm functional test. Take note that the Ubuntu
4
charm does not have any relations or config options
9
from charmhelpers.contrib.amulet.utils import AmuletUtils
13
def ubuntu_basic_deployment(series):
14
""" Common test routines to run per-series. """
18
u = AmuletUtils(logging.DEBUG)
19
d = amulet.Deployment(series=series)
22
lsb_command = 'lsb_release -cs'
24
# Deploy services, wait for started state. Fail or skip on timeout.
26
d.setup(timeout=seconds)
27
except amulet.helpers.TimeoutError:
28
message = 'Deployment timed out ({}s)'.format(seconds)
29
amulet.raise_status(amulet.SKIP, msg=message)
33
# Confirm Ubuntu release name from the unit.
34
u.log.debug('Command: {}'.format(lsb_command))
35
output, code = d.sentry.unit[unit].run(lsb_command)
36
u.log.debug('Output: {}'.format(output))
39
message = 'Command FAIL: {}'.format(lsb_command)
41
amulet.raise_status(amulet.FAIL, msg=message)
44
message = 'Series: OK'
47
message = 'Series: FAIL ({})'.format(output)
49
amulet.raise_status(amulet.FAIL, msg=message)