def configure_lxc_root_tarball(self, rootfs): """ Use a local copy of the cloud rootfs tarball """ host = self.machine.dns_name cmds = "sudo mkdir -p /var/cache/lxc/cloud-trusty" utils._run("ssh -oStrictHostKeyChecking=no " "ubuntu@{host} {cmds}".format(host=host, cmds=cmds)) utils._run("scp -oStrictHostKeyChecking=no " "{rootfs} " "ubuntu@{host}:/var/cache/lxc/cloud-trusty/.".format( rootfs=rootfs, host=host)) self.lxc_root_tarball_configured = True
def setUp(self): self.juju = None if JUJU_USELIVE and JUJU_INSTALLED: self.juju = JujuState(_run('juju status').decode('ascii')) else: with open('test/juju-output/juju-status-multi-install.yaml') as f: self.juju = JujuState(f.read())
def configure_lxc_network(self): # upload our lxc-host-only template # and reboot so any containers will be deployed with # the proper subnet host = self.machine.dns_name utils._run("scp -oStrictHostKeyChecking=no " "/usr/share/cloud-installer/templates/lxc-host-only " "ubuntu@{host}:/tmp/lxc-host-only".format(host=host)) cmds = [] cmds.append("sudo mv /tmp/lxc-host-only " "/etc/network/interfaces.d/lxcbr0.cfg") cmds.append("sudo rm /etc/network/interfaces.d/eth0.cfg") cmds.append("sudo reboot") utils._run("ssh -oStrictHostKeyChecking=no " "ubuntu@{host} {cmds}".format(host=host, cmds=" && ".join(cmds))) self.single_net_configured = True