~therve/pyjuju/validate-config-values

« back to all changes in this revision

Viewing changes to juju/state/tests/test_base.py

  • Committer: kapil.thangavelu at canonical
  • Date: 2012-04-12 18:39:20 UTC
  • mfrom: (509.1.4 managed-zk-client)
  • Revision ID: kapil.thangavelu@canonical.com-20120412183920-jjrhrpibxzkexk1v
merge managed-zk-client, also fix trunk test, and disable topo migration [r=fwereade]

 juju now uses the txzookeeper.managed Client which automatically restablishes 
 sessions recreating presence nodes and triggering extant watches.

 This also fixes some subordinte changes, namely a broken lxc test, and disables the 
 transparent topology migration as without accompanying code changes to running agents
 it will cause problems.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from twisted.internet.defer import inlineCallbacks, Deferred
2
 
from txzookeeper import ZookeeperClient
3
2
 
4
3
from juju.state.tests.common import StateTestBase
5
4
 
6
5
from juju.state.base import StateBase
7
6
from juju.state.errors import StopWatcher
8
7
from juju.state.topology import InternalTopology
9
 
from juju.tests.common import get_test_zookeeper_address
10
8
 
11
9
 
12
10
class StateBaseTest(StateTestBase):
339
337
 
340
338
        # Use a separate client connection for watching so it can be
341
339
        # disconnected.
342
 
        watch_client = ZookeeperClient(get_test_zookeeper_address())
 
340
        watch_client = self.get_zookeeper_client()
343
341
        yield watch_client.connect()
344
342
        watch_base = StateBase(watch_client)
345
343
 
402
400
        """
403
401
        # Use a separate client connection for watching so it can be
404
402
        # disconnected.
405
 
        watch_client = ZookeeperClient(get_test_zookeeper_address())
 
403
        watch_client = self.get_zookeeper_client()
406
404
        yield watch_client.connect()
407
405
        watch_base = StateBase(watch_client)
408
406
 
416
414
        topology = InternalTopology()
417
415
        topology.add_machine("m-0")
418
416
        yield self.set_topology(topology)
419
 
        
 
417
 
420
418
        # Now disconnect the client.
421
419
        watch_client.close()
422
420
        self.assertFalse(watch_client.connected)