8
class TestDeployment(unittest.TestCase):
11
cls.deployment = amulet.Deployment()
13
cls.deployment.add('thruk-master')
14
cls.deployment.expose('thruk-master')
17
cls.deployment.setup(timeout=900)
18
cls.deployment.sentry.wait()
19
except amulet.helpers.TimeoutError:
20
amulet.raise_status(amulet.SKIP, msg="Environment wasn't stood up in time")
23
cls.unit = cls.deployment.sentry.unit['thruk-master/0']
26
# Now you can use self.deployment.sentry.unit[UNIT] to address each of
27
# the units and perform more in-depth steps. You can also reference
28
# the first unit as self.unit.
29
# There are three test statuses that can be triggered with
30
# amulet.raise_status():
34
# Each unit has the following methods:
35
# - .info - An array of the information of that unit from Juju
36
# - .file(PATH) - Get the details of a file on that unit
37
# - .file_contents(PATH) - Get plain text output of PATH file from that unit
38
# - .directory(PATH) - Get details of directory
39
# - .directory_contents(PATH) - List files and folders in PATH on that unit
40
# - .relation(relation, service:rel) - Get relation data from return service
41
# add tests here to confirm service is up and working properly
42
# For example, to confirm that it has a functioning HTTP server:
43
# page = requests.get('http://{}'.format(self.unit.info['public-address']))
44
# page.raise_for_status()
45
# More information on writing Amulet tests can be found at:
46
# https://juju.ubuntu.com/docs/tools-amulet.html
50
if __name__ == '__main__':