22
22
from maastest.kvmfixture import KVMFixture
23
from maastest.prepare import (
24
determine_vm_architecture,
23
27
import testresources
25
29
from testtools.testcase import gather_details
31
35
def setUpClass(cls):
32
36
# TODO: series and architecture should be script parameters.
33
cls.machine = KVMFixture(series='saucy', architecture='amd64')
37
architecture = determine_vm_architecture()
38
cls.machine = KVMFixture(series='saucy', architecture=architecture)
34
39
cls.machine.setUp()
40
cls.maas_admin, cls.api_key = set_up_maas(cls.machine)
35
41
super(TestMAAS, cls).setUpClass()
68
74
super(TestMAAS, self).setUp()
69
75
self.addCleanup(self.unify_details)
71
def test_install_maas_package(self):
72
"""Installing MAAS package"""
73
# Install the English language pack first. If this is not done before
74
# postgres is installed, on some systems it won't be able to set up its
76
# TODO: Is there no way to ensure this through a dependency?
77
self.machine.run_command([
78
'sudo', 'DEBIAN_FRONTEND=noninteractive',
79
'apt-get', 'install', '-y', 'language-pack-en',
81
# Now we can install maas (which also installs postgres).
82
retcode, _, stderr = self.machine.run_command([
83
'sudo', 'DEBIAN_FRONTEND=noninteractive',
84
'apt-get', 'install', '-y', 'maas', 'maas-dhcp', 'maas-dns',
86
self.assertEqual(0, retcode)
78
# TODO: Placeholder test. Replace with actual tests.
79
# For now, just hold so you can log into the VM and play with it.
81
"****** VM RUNNING ON %s. PRESS ENTER TO SHUT DOWN. ******"
82
% self.machine.ip_address())
89
87
# Configure the main cluster's DHCP using the IP range provided by the fixture.