~rvb/maas/ephemeral-simplestreams

« back to all changes in this revision

Viewing changes to maastest/main.py

  • Committer: jtv at canonical
  • Date: 2013-11-14 07:53:12 UTC
  • mfrom: (27.1.2 check-error)
  • Revision ID: jtv@canonical.com-20131114075312-q5wlai32uq6nk6z6
[r=julian-edwards][author=jtv] Check for installation errors; make MAAS installation setup, not test; hold completed VM for dev debugging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import unittest
21
21
 
22
22
from maastest.kvmfixture import KVMFixture
 
23
from maastest.prepare import (
 
24
    determine_vm_architecture,
 
25
    set_up_maas,
 
26
    )
23
27
import testresources
24
28
import testtools
25
29
from testtools.testcase import gather_details
30
34
    @classmethod
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()
36
42
 
37
43
    @classmethod
68
74
        super(TestMAAS, self).setUp()
69
75
        self.addCleanup(self.unify_details)
70
76
 
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
75
 
        # main cluster.
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',
80
 
            ])
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',
85
 
            ])
86
 
        self.assertEqual(0, retcode)
 
77
    def test_dummy(self):
 
78
        # TODO: Placeholder test.  Replace with actual tests.
 
79
        # For now, just hold so you can log into the VM and play with it.
 
80
        print(
 
81
            "****** VM RUNNING ON %s.  PRESS ENTER TO SHUT DOWN. ******"
 
82
            % self.machine.ip_address())
 
83
        sys.stdin.readline()
 
84
 
87
85
 
88
86
# TODO:
89
87
# Configure the main cluster's DHCP using the IP range provided by the fixture.