~landscape/landscape-client/landscape-client-12.05-0ubuntu1-quantal

« back to all changes in this revision

Viewing changes to landscape/manager/tests/test_eucalyptus.py

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2010-07-28 08:14:02 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20100728081402-2ygupluqwc2bbe8j
Tags: 1.5.4-0ubuntu0.10.10.0
* New upstream version (LP: #610744):

  - The Eucalyptus management plugin reports the output of the
    'euca-describe-availability-zones verbose' command, which includes
    information about the available instance types and the maximum
    number of each instance type that the cloud can support (LP: #599338)

  - Check if the package directory exists before trying to check the
    package changer lock in the dbus-proxy. This fixes a bug when upgrading
    a dbus-landscape which never registered (LP: #603514).

  - Allow an LDS server to bootstrap new cloud instances with its own CA,
    which is picked up by the client, written to a file on the instance, and
    used in subsequent exchanges with the server (LP: #605079).

  - Skip loopback interface when reporting device info (LP: #608314)

  - Disable landscape-sysinfo when load is more than 1 (LP: #608278)

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
  10.1.1.75  canyonedge
41
41
"""
42
42
 
 
43
fake_capacity_output = """\
 
44
AVAILABILITYZONE        bruterobe       10.0.1.113
 
45
AVAILABILITYZONE        |- vm types     free / max   cpu   ram  disk
 
46
AVAILABILITYZONE        |- m1.small     0008 / 0008   1    128     2
 
47
AVAILABILITYZONE        |- c1.medium    0008 / 0008   1    256     5
 
48
AVAILABILITYZONE        |- m1.large     0004 / 0004   2    512    10
 
49
AVAILABILITYZONE        |- m1.xlarge    0004 / 0004   2   1024    20
 
50
AVAILABILITYZONE        |- c1.xlarge    0002 / 0002   4   2048    20
 
51
"""
 
52
 
43
53
 
44
54
class FakeEucalyptusInfo(object):
45
55
    """A fake version of L{EucalyptusInfo} for use in tests."""
46
56
 
47
57
    def __init__(self, version_output=None, walrus_output=None,
48
58
                 cluster_controller_output=None,
49
 
                 storage_controller_output=None, node_controller_output=None):
 
59
                 storage_controller_output=None, node_controller_output=None,
 
60
                 capacity_output=None):
50
61
        self._version_output = version_output
51
62
        self._walrus_output = walrus_output
52
63
        self._cluster_controller_output = cluster_controller_output
53
64
        self._storage_controller_output = storage_controller_output
54
65
        self._node_controller_output = node_controller_output
 
66
        self._capacity_output = capacity_output
55
67
 
56
68
    def get_version_info(self):
57
69
        return succeed(self._version_output)
68
80
    def get_node_controller_info(self):
69
81
        return succeed(self._node_controller_output)
70
82
 
 
83
    def get_capacity_info(self):
 
84
        return succeed(self._capacity_output)
 
85
 
71
86
 
72
87
class FakeServiceHub(object):
73
88
 
101
116
            eucalyptus_info_factory=lambda tools: FakeEucalyptusInfo(
102
117
                fake_version_output, fake_walrus_output,
103
118
                fake_cluster_controller_output, fake_storage_controller_output,
104
 
                fake_node_controller_output))
 
119
                fake_node_controller_output, fake_capacity_output))
105
120
        self.manager.add(plugin)
106
121
        return plugin
107
122
 
139
154
                "cluster_controller_info": fake_cluster_controller_output,
140
155
                "node_controller_info": fake_node_controller_output,
141
156
                "storage_controller_info": fake_storage_controller_output,
142
 
                "walrus_info": fake_walrus_output}
 
157
                "walrus_info": fake_walrus_output,
 
158
                "capacity_info": fake_capacity_output}
143
159
            self.assertMessages(
144
160
                self.broker_service.message_store.get_pending_messages(),
145
161
                [expected])