How can I deploy two charms to the same node in Amulet testing?

share|improve this question
    
Why do you want to deploy two charms to the same node with an Amulet test? – Marco Ceppi Apr 28 '15 at 14:16
    
Yeah if you could provide a use case it would help us understand what you're trying to do, thanks! – Jorge Castro Apr 29 '15 at 11:46
    
Well my charms are for a openstack-neutron plugin therefore i need to deploy all the openstack charms along with my own charms. In total thats like 13 charms to perform a test. I cant spin up 13 nodes for them right now. – Bilal Baqar May 1 '15 at 22:55
up vote 1 down vote accepted

If your use case requires more than 1 machine, i.e. you are testing a service that must be stood up on a different machine from its dependent services:

On the machine you manage your infrastructure with juju:

sudo pip install juju-deployerizer

Export your environment, including the location of all services/units:

juju deployerizer --environment <your environment> --include-placement -o <your export file.yaml>

Edit your export file, make sure to follow the format specified in the docs: http://pythonhosted.org/juju-deployer/config.html#placement

Some things to note: only 0 is recognized as a machine Id. If your testing environment calls for more than one machine: designate 1 service to be deployed without to: specification, then use that service name in the to: specification for all the other services/units needed on the new machine.

The default output of juju-deployerizer does not currently (05/2015) add the series information to the output, so just add it manually under the deployment name in your export file:

test:
    series: 'trusty'
    ...

Use the following to load your export file in the set up class method of your amulet test:

cls.deployment.load_bundle_file(bundle_file='<path to your export file.yaml>')

Proceed with the amulet tests as you normally would after that.

share|improve this answer
    
Thanks a lot. I got it done exactly that. You summed it up beautifully. – Bilal Baqar May 11 '15 at 5:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.