~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/tests/test_bootimage.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Raphaël Badin, Julian Edwards, Andres Rodriguez, Gavin Panella, Jeroen Vermeulen
  • Date: 2012-11-13 14:58:21 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20121113145821-6jq53jtljo3qou80
Tags: 1.2+bzr1349+dfsg-0ubuntu1
* New upstream bugfix release. Fixes:
  - The DNS configuration is not created if maas-dns is installed after
    the DNS config has been set up (LP: #1085865).
  - IPMI detection ends up with power_address of 0.0.0.0 (LP: #1064224)
  - Main page slow to load with many nodes (LP: #1066775)
  - maas-cluster-controller doesn't have images for
    provisioning (LP: #1068843)
  - Filestorage is unique to each appserver instance (LP: #1069734)
  - import_pxe_files does not include quantal (LP: #1069850)
  - maas-cli nodes new incomplete documentation (LP: #1070522)
  - DNS forward zone ends up with nonsensical entries (LP: #1070765)
  - The hostname of a node can still be changed once the node is in
    use. (LP: #1070774)
  - The zone name (attached to a cluster controller) can still be changed
    when it contains in-use nodes and DNS is managed. (LP: #1070775)
  - Duplicated prefix in the url used by the CLI (LP: #1075597)
  - Not importing Quantal boot images (LP: #1077180)
  - Nodes are deployed with wrong domain name. (LP: #1078744)
  - src/maasserver/api.py calls request.data.getlist with a 'default'
    parameter. That parameter is not supported by Django 1.3. (LP: #1080673)
  - API calls that return a node leak private data (LP: #1034318)
  - MAAS hostnames should be 5 easily disambiguated characters (LP: #1058998)
  - URI in API description wrong when accessing machine via alternative
    interface. (LP: #1059645)
  - Oops when renaming nodegroup w/o interface (LP: #1077075)
  - Error in log when using 'Start node' button: MAASAPINotFound: No user
    data available for this node. (LP: #1069603)

[ Raphaël Badin ]
* debian/maas-dns.postinst: Call write_dns_config (LP: #1085865).
* debian/maas-dns.postinst: fix permissions and group ownership of
  file /etc/bind/maas/named.conf.rndc.maas. (LP: #1066935)

[ Julian Edwards ]
* debian/maas-region-controller.install: Remove installation of maas-gc; it
  is no longer required as upstream no longer stores files in the filesystem.
  (LP: #1069734)
* debian/maas-cluster-controller.postinst: Ensure that /etc/maas/pserv.yaml
  is updated when reconfiguring. (LP: #1081212)

[ Andres Rodriguez ]
* debian/control:
  - maas-cluster-controller Conflicts with tftpd-hpa (LP: #1076028)
  - maas-dns: Conflicts with dnsmasq
  - Drop Dependency on rabbitmq-server for maas-cluster-controller.
    (LP: #1072744)
  - Add conflicts/replaces for maas-region-controller to
    maas-cluster-controller.
* debian/maas-cluster-controller.config: If URL has been detected, add
  /MAAS if it doesn't contain it. This helps upgrades from versions where
  DEFAULT_MAAS_URL didn't use /MAAS.
* Install maas-import-pxe-files and related files with
  maas-cluster-controller, as well as configure tgtd, as
  maas-region-controller no longer stores images. Thanks to Jeroen
  Vermuelen.

[ Gavin Panella ]
* debian/extras/99-maas: squashfs image download is no longer needed.
* debian/maas-cluster-controller.install: maas-import-squashfs and its
  configuration file are no longer part of upstream.

[ Jeroen Vermeulen ]
* debian/maas-cluster-controller.maas-pserv.upstart: Source maas_cluster.conf
  before starting pserv (tftpd) process.
* debian/maas-cluster-controller.postinst: Duplicate CLUSTER_UUID setting
  to maas_cluster.conf.
* Bumped revision number to current 1.2 revision 1342 (requested by rvba).

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
__metaclass__ = type
13
13
__all__ = []
14
14
 
15
 
from maasserver.models import BootImage
 
15
from maasserver.models import (
 
16
    BootImage,
 
17
    NodeGroup,
 
18
    )
16
19
from maasserver.testing.factory import factory
17
20
from maasserver.testing.testcase import TestCase
18
21
from provisioningserver.testing.boot_images import make_boot_image_params
20
23
 
21
24
class TestBootImageManager(TestCase):
22
25
 
 
26
    def setUp(self):
 
27
        super(TestBootImageManager, self).setUp()
 
28
        self.nodegroup = NodeGroup.objects.ensure_master()
 
29
 
23
30
    def test_have_image_returns_False_if_image_not_available(self):
24
31
        self.assertFalse(
25
 
            BootImage.objects.have_image(**make_boot_image_params()))
 
32
            BootImage.objects.have_image(
 
33
                self.nodegroup, **make_boot_image_params()))
26
34
 
27
35
    def test_have_image_returns_True_if_image_available(self):
28
36
        params = make_boot_image_params()
29
 
        factory.make_boot_image(**params)
30
 
        self.assertTrue(BootImage.objects.have_image(**params))
 
37
        factory.make_boot_image(nodegroup=self.nodegroup, **params)
 
38
        self.assertTrue(
 
39
            BootImage.objects.have_image(self.nodegroup, **params))
31
40
 
32
41
    def test_register_image_registers_new_image(self):
33
42
        params = make_boot_image_params()
34
 
        BootImage.objects.register_image(**params)
35
 
        self.assertTrue(BootImage.objects.have_image(**params))
 
43
        BootImage.objects.register_image(self.nodegroup, **params)
 
44
        self.assertTrue(
 
45
            BootImage.objects.have_image(self.nodegroup, **params))
36
46
 
37
47
    def test_register_image_leaves_existing_image_intact(self):
38
48
        params = make_boot_image_params()
39
 
        factory.make_boot_image(**params)
40
 
        BootImage.objects.register_image(**params)
41
 
        self.assertTrue(BootImage.objects.have_image(**params))
 
49
        factory.make_boot_image(nodegroup=self.nodegroup, **params)
 
50
        BootImage.objects.register_image(self.nodegroup, **params)
 
51
        self.assertTrue(
 
52
            BootImage.objects.have_image(self.nodegroup, **params))