~james-page/charms/trusty/nova-compute/hook-optimize

« back to all changes in this revision

Viewing changes to tests/charmhelpers/contrib/amulet/deployment.py

  • Committer: james.page at ubuntu
  • Date: 2014-10-01 21:17:11 UTC
  • mfrom: (79.2.21 ipv6)
  • Revision ID: james.page@ubuntu.com-20141001211711-eatkfiaqlaed6t79
[xianghui,dosaboy,r=james-page,t=gema] Add IPv6 support using prefer-ipv6 flag

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
        """Add services.
25
25
 
26
26
           Add services to the deployment where this_service is the local charm
27
 
           that we're focused on testing and other_services are the other
28
 
           charms that come from the charm store.
 
27
           that we're testing and other_services are the other services that
 
28
           are being used in the amulet tests.
29
29
           """
30
 
        name, units = range(2)
 
30
        name, units, location = range(3)
31
31
 
32
32
        if this_service[name] != os.path.basename(os.getcwd()):
33
33
            s = this_service[name]
37
37
        self.d.add(this_service[name], units=this_service[units])
38
38
 
39
39
        for svc in other_services:
40
 
            if self.series:
41
 
                self.d.add(svc[name],
42
 
                           charm='cs:{}/{}'.format(self.series, svc[name]),
43
 
                           units=svc[units])
 
40
            if len(svc) > 2:
 
41
                branch_location = svc[location]
 
42
            elif self.series:
 
43
                branch_location = 'cs:{}/{}'.format(self.series, svc[name]),
44
44
            else:
45
 
                self.d.add(svc[name], units=svc[units])
 
45
                branch_location = None
 
46
            self.d.add(svc[name], charm=branch_location, units=svc[units])
46
47
 
47
48
    def _add_relations(self, relations):
48
49
        """Add all of the relations for the services."""
57
58
    def _deploy(self):
58
59
        """Deploy environment and wait for all hooks to finish executing."""
59
60
        try:
60
 
            self.d.setup()
 
61
            self.d.setup(timeout=900)
61
62
            self.d.sentry.wait(timeout=900)
62
63
        except amulet.helpers.TimeoutError:
63
64
            amulet.raise_status(amulet.FAIL, msg="Deployment timed out")