~vila/uci-engine/stores-with-path

« back to all changes in this revision

Viewing changes to tests/deployers.py

  • Committer: Ubuntu CI Bot
  • Author(s): Celso Providelo
  • Date: 2014-11-12 15:26:57 UTC
  • mfrom: (875.2.10 webui-selenium-phantomjs)
  • Revision ID: ubuntu_ci_bot-20141112152657-vwgbgchby2fe4j6y
[r=PS Jenkins bot, Joe Talbott] Using SST/selenium and phantomjs in webui integration tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
    return _juju_call([action, service])
84
84
 
85
85
 
 
86
def juju_get_ip_and_port(service, unit=0):
 
87
    status = deploy.juju_status()
 
88
    units = status['services'][service]['units']
 
89
    ip = units['%s/%d' % (service, unit)]['public-address']
 
90
    formatted = '%s/%d' % (service, unit)
 
91
    port, _ = units[formatted]['open-ports'][0].split('/')
 
92
    return ip, int(port)
 
93
 
 
94
 
86
95
# TODO ev 2014-06-16 @features.requires(features.settled_units)
87
96
@features.requires(features.bootstrapped_juju)
88
97
class DeployerTest(testing.TestCaseWithGnupg):
89
98
    '''Base class for building juju deployer based tests.'''
90
99
 
91
100
    def get_ip_and_port(self, service, unit=0):
92
 
        status = deploy.juju_status()
93
 
        units = status['services'][service]['units']
94
 
        ip = units['%s/%d' % (service, unit)]['public-address']
95
 
        formatted = '%s/%d' % (service, unit)
96
 
        port, _ = units[formatted]['open-ports'][0].split('/')
97
 
        return ip, int(port)
 
101
        return juju_get_ip_and_port(service, unit)
98
102
 
99
103
    def assert_job_running(self, service, unit=0, upstart_job=None):
100
104
        # Ensure the given upstart job is running on a unit