~ahasenack/landscape-client/landscape-client-11.07.1.1-0ubuntu0.11.10.0

« back to all changes in this revision

Viewing changes to landscape/tests/helpers.py

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Hasenack
  • Date: 2010-09-08 15:34:09 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20100908153409-q9omqf75uv7n3s1w
Tags: 1.5.5-0ubuntu0.10.10.0
* New upstream version (LP: #633468)

  - The --help command line option can now be used without being
    root (LP: #613256).

  - The client Unix sockets and symlinks are now cleaned up at shutdown.
    Without this cleaning, the client could refuse to start because of a PID
    collision (LP: #607747).

  - The network traffic plugin didn't use to take into account integer
    overflows. This would cause the plugin to send negative values
    sometimes (LP: #615371).

  - If a payload had many user activities in it, only the last one would be
    carried out (LP: #617624).

  - The Eucalyptus plugin was not enabled by default, which means the Cloud
    Topology feature of Landscape was not available (LP: #614493).

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from landscape.monitor.monitor import Monitor
27
27
from landscape.manager.manager import Manager
28
28
 
29
 
# FIXME: We can drop the "_" suffix and replace the current classes once the
30
 
# AMP migration is completed
31
 
from landscape.broker.service import BrokerService as BrokerService_
32
 
from landscape.broker.amp import (
33
 
    FakeRemoteBroker as FakeRemoteBroker_, RemoteBrokerConnector)
34
 
from landscape.manager.config import (
35
 
    ManagerConfiguration as ManagerConfiguration_)
 
29
from landscape.broker.service import BrokerService
 
30
from landscape.broker.amp import FakeRemoteBroker, RemoteBrokerConnector
 
31
from landscape.manager.config import ManagerConfiguration
36
32
 
37
33
 
38
34
DEFAULT_ACCEPTED_TYPES = [
284
280
        config = BrokerConfiguration()
285
281
        config.load(["-c", test_case.config_filename])
286
282
 
287
 
        class FakeBrokerService(BrokerService_):
 
283
        class FakeBrokerService(BrokerService):
288
284
            reactor_factory = FakeReactor
289
285
            transport_factory = FakeTransport
290
286
 
 
287
            def stopService(service):
 
288
                # We need to explictely stop listening to the socket
 
289
                # because the reactor would still have active selectables
 
290
                # at the end of the test otherwise
 
291
                if os.path.exists(service.port.port):
 
292
                    service.port.connectionLost(None)
 
293
                super(FakeBrokerService, service).stopService()
 
294
 
291
295
        test_case.broker_service = FakeBrokerService(config)
292
 
        test_case.remote = FakeRemoteBroker_(
 
296
        test_case.remote = FakeRemoteBroker(
293
297
            test_case.broker_service.exchanger,
294
298
            test_case.broker_service.message_store)
295
299
 
351
355
 
352
356
    def set_up(self, test_case):
353
357
        super(ManagerHelper, self).set_up(test_case)
354
 
        test_case.config = ManagerConfiguration_()
 
358
        test_case.config = ManagerConfiguration()
355
359
        test_case.config.load(["-c", test_case.config_filename])
356
360
        test_case.reactor = FakeReactor()
357
361
        test_case.manager = Manager(test_case.reactor, test_case.config)