4 1. Creates a model on the current controller
5 2. Deploys a charm to it.
6 3. Attempts to ssh into the charm
10 from juju
import utils
11 from juju
.controller
import Controller
13 from logging
import getLogger
15 LOG
= getLogger(__name__
)
19 controller
= Controller()
20 print("Connecting to controller")
21 await controller
.connect_current()
24 model
= await controller
.add_model("quux")
26 print('Deploying ubuntu')
27 application
= await model
.deploy(
29 application_name
='ubuntu',
34 print('Waiting for active')
35 await asyncio
.sleep(10)
36 await model
.block_until(
37 lambda: all(unit
.workload_status
== 'active'
38 for unit
in application
.units
))
40 print("Verifying that we can ssh into the created model")
41 ret
= utils
.execute_process('juju', 'ssh', 'ls /', log
=LOG
)
44 print('Removing ubuntu')
45 await application
.remove()
47 print("Destroying model")
48 await controller
.destroy_model(model
.info
.uuid
)
51 print('Disconnecting from controller')
52 await model
.disconnect()
53 await controller
.disconnect()