~gary/charms/oneiric/buildbot-master/typo

« back to all changes in this revision

Viewing changes to tests/buildbot-master.test

  • Committer: Graham Binns
  • Date: 2012-02-13 18:06:04 UTC
  • mfrom: (24.3.10 master-smart-timeouts)
  • Revision ID: graham@canonical.com-20120213180604-659cy3phqblstl9s
Merged smarter timeouts work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
juju = command('juju')
16
16
 
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')
24
 
 
25
17
 
26
18
class TestCharm(unittest.TestCase):
27
19
 
28
20
    def tearDown(self):
29
21
        juju('destroy-service', 'buildbot-master')
30
22
 
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
34
 
        # charm repository.
35
 
        juju('deploy', 'buildbot-master')
 
23
    def deploy(self, charm_config=None):
 
24
        additional_args = []
 
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')
38
34
 
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(),
48
44
            }}
49
 
        deploy(charm_config)
 
45
        self.deploy(charm_config)
50
46
 
51
47
    def test_lpbuildbot(self):
52
48
        # Deploying a Launchpad-specific buildbot master does a good job of
65
61
                    ' lucid main universe',
66
62
                'installdir': '/var/lib/buildbot/masters/lpbuildbot',
67
63
            }}
68
 
        deploy(charm_config)
 
64
        self.deploy(charm_config)
69
65
 
70
66
 
71
67
if __name__ == '__main__':