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