~ubuntu-branches/ubuntu/trusty/maas/trusty-proposed-201409031457

« back to all changes in this revision

Viewing changes to src/metadataserver/tests/test_api.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Andres Rodriguez, Julian Edwards, Dustin Kirkland
  • Date: 2014-03-28 10:43:53 UTC
  • mfrom: (1.2.26)
  • Revision ID: package-import@ubuntu.com-20140328104353-9hj74f1nvl7xis5z
Tags: 1.5+bzr2204-0ubuntu1
* New upstream release (LP: #1281881)

[ Andres Rodriguez ]
* debian/maas-region-controller-min.templates: Set installation note to false
  by default.
* Check rabbitmqctl is present before running commands:
  - debian/maas-region-controller-min.maas-region-celery.upstart.
  - debian/maas-region-controller-min.maas-txlongpoll.upstart.
* make sure maas_longpoll rabbitmq user is created/with correct password on
  a package reconfigure.
* debian/maas-dns.postinst: Fix upgrade setup of named.conf.options.
* debian/maas-cluster-controller.install: Install UEFI templates (LP: #1299143)

[ Julian Edwards ]
* debian/extas/maas: Echo warning to stderr so json stdout is not polluted
* debian/maas-cluster-controller.postinst: Run upgrade-cluster on each
  upgrade
* debian/maas-dns.postinst: Call edit_named_options to add a line in
  /etc/bind/named.conf.options that includes the
  /etc/named/maas/named.conf.options.inside.maas file.
* debian/control:
  - maas-dns depends on python-iscpy
  - maas-cluster-controller depends on python-seamicroclient
* debian/maas-cluster-controller.install: Install bootresources.yaml

[ Dustin Kirkland ]
* debian/control: LP: #1297097
  - clean up package descriptions, modernize, and more clearly/simply
    explain what each package does
  - drop "Ubuntu" in front of MAAS, clean up command line/API description

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2012 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2012-2014 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Tests for the metadata API."""
41
41
from maasserver.testing import reload_object
42
42
from maasserver.testing.factory import factory
43
43
from maasserver.testing.oauthclient import OAuthAuthenticatedClient
 
44
from maasserver.testing.testcase import MAASServerTestCase
44
45
from maastesting.djangotestcase import DjangoTestCase
 
46
from maastesting.matchers import MockCalledOnceWith
45
47
from maastesting.utils import sample_binary_data
46
48
from metadataserver import api
47
49
from metadataserver.api import (
390
392
 
391
393
    def test_curtin_user_data_view_returns_curtin_data(self):
392
394
        node = factory.make_node()
 
395
        arch, subarch = node.architecture.split('/')
 
396
        factory.make_boot_image(
 
397
            architecture=arch, subarchitecture=subarch,
 
398
            release=node.get_distro_series(), purpose='xinstall',
 
399
            nodegroup=node.nodegroup)
393
400
        client = make_node_client(node)
394
401
        response = client.get(
395
402
            reverse('curtin-metadata-user-data', args=['latest']))
398
405
        self.assertIn("PREFIX='curtin'", response.content)
399
406
 
400
407
 
401
 
class TestCommissioningAPI(DjangoTestCase):
 
408
class TestCommissioningAPI(MAASServerTestCase):
402
409
 
403
410
    def test_commissioning_scripts(self):
404
411
        script = factory.make_commissioning_script()
446
453
        response = call_signal(client, status='OK', script_result='0')
447
454
        self.assertEqual(httplib.OK, response.status_code)
448
455
        self.assertEqual(NODE_STATUS.READY, reload_object(node).status)
449
 
        populate_tags_for_single_node.assert_called_once_with(ANY, node)
 
456
        self.assertThat(
 
457
            populate_tags_for_single_node,
 
458
            MockCalledOnceWith(ANY, node))
450
459
 
451
460
    def test_signaling_requires_status_code(self):
452
461
        node = factory.make_node(status=NODE_STATUS.COMMISSIONING)