2
"""Assess mixed deployment of images from two sets of simplestreams."""
4
from __future__ import print_function
11
from deploy_stack import (
12
assess_juju_relations,
16
add_basic_testing_arguments,
25
log = logging.getLogger("assess_mixed_images")
27
IMG_URL = 'https://s3.amazonaws.com/temp-streams/aws-image-streams/'
30
def assess_mixed_images(client):
31
charm_path = local_charm_path(charm='dummy-sink', juju_ver=client.version,
32
series='centos7', platform='centos')
33
client.deploy(charm_path)
34
charm_path = local_charm_path(charm='dummy-source',
35
juju_ver=client.version, series='trusty')
36
client.deploy(charm_path)
37
client.juju('add-relation', ('dummy-source', 'dummy-sink'))
38
# Wait for the deployment to finish.
39
client.wait_for_started()
40
assess_juju_relations(client)
44
"""Parse all arguments."""
45
parser = argparse.ArgumentParser(
46
description="Deploy images from two sets of simplestreams.")
47
add_basic_testing_arguments(parser)
48
# Fallback behaviour fails without --bootstrap-series: Bug 1560625
49
parser.set_defaults(series='trusty')
50
return parser.parse_args(argv)
54
args = parse_args(argv)
55
configure_logging(args.verbose)
56
bs_manager = BootstrapManager.from_args(args)
57
client = bs_manager.client
58
client.env.config['image-metadata-url'] = IMG_URL
59
key_path = os.path.join(client.env.juju_home,
61
log.info("Using JUJU_STREAMS_PUBLICKEY_FILE=%s", key_path)
62
os.environ['JUJU_STREAMS_PUBLICKEY_FILE'] = key_path
63
with bs_manager.booted_context(args.upload_tools):
64
assess_mixed_images(bs_manager.client)
68
if __name__ == '__main__':