15
15
juju = command('juju')
17
def deploy(charm_config):
18
charm_config_file = make_charm_config_file(charm_config)
19
juju('deploy', 'buildbot-master', '--config='+charm_config_file.name)
20
wait_for_unit('buildbot-master')
21
addr = unit_info('buildbot-master', 'public-address')
22
url = 'http://{}:8010'.format(addr)
23
wait_for_page_contents(url, 'Welcome to the Buildbot')
26
18
class TestCharm(unittest.TestCase):
28
20
def tearDown(self):
29
21
juju('destroy-service', 'buildbot-master')
31
def test_deploy(self):
32
# See if the charm will actual deploy correctly. This test may be
33
# made redundant by standard charm tests run by some future centralized
35
juju('deploy', 'buildbot-master')
23
def deploy(self, charm_config=None):
25
if charm_config is not None:
26
charm_config_file = make_charm_config_file(charm_config)
27
additional_args.append('--config=' + charm_config_file.name)
28
juju('deploy', 'buildbot-master', *additional_args)
36
29
wait_for_unit('buildbot-master')
37
self.assertEqual(unit_info('buildbot-master', 'state'), 'started')
30
juju('expose', 'buildbot-master')
31
addr = unit_info('buildbot-master', 'public-address')
32
url = 'http://{}:8010'.format(addr)
33
wait_for_page_contents(url, 'Welcome to the Buildbot')
39
35
def test_port_opened(self):
40
36
# Deploying a buildbot master should result in it opening a port and
46
42
'installdir': '/tmp/buildbot',
47
43
'config-file': open(bb_config_path).read(),
45
self.deploy(charm_config)
51
47
def test_lpbuildbot(self):
52
48
# Deploying a Launchpad-specific buildbot master does a good job of