Commit 1ac242d1 authored by Vincent Pelletier's avatar Vincent Pelletier

Add more node state checks.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1195 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent a011baec
...@@ -145,9 +145,14 @@ class MasterTests(unittest.TestCase): ...@@ -145,9 +145,14 @@ class MasterTests(unittest.TestCase):
first_master_uuid = first_master.getUUID() first_master_uuid = first_master.getUUID()
# Check that the master node we started elected itself. # Check that the master node we started elected itself.
self.expectPrimaryMaster(first_master_uuid, timeout=60) self.expectPrimaryMaster(first_master_uuid, timeout=60)
# Check that no other node is known as running.
self.assertEqual(len(neo.getMasterNodeList(
state=protocol.RUNNING_STATE)), 1)
# Start a second master. # Start a second master.
second_master = master_list[1] second_master = master_list[1]
# Check that the second master is known as being down.
self.assertEqual(neo.getMasterNodeState(second_master.getUUID()), None)
second_master.start() second_master.start()
# Check that the second master is running under his known UUID. # Check that the second master is running under his known UUID.
self.expectMasterState(second_master.getUUID(), protocol.RUNNING_STATE) self.expectMasterState(second_master.getUUID(), protocol.RUNNING_STATE)
...@@ -156,6 +161,8 @@ class MasterTests(unittest.TestCase): ...@@ -156,6 +161,8 @@ class MasterTests(unittest.TestCase):
# Start a third master. # Start a third master.
third_master = master_list[2] third_master = master_list[2]
# Check that the third master is known as being down.
self.assertEqual(neo.getMasterNodeState(third_master.getUUID()), None)
third_master.start() third_master.start()
# Check that the third master is running under his known UUID. # Check that the third master is running under his known UUID.
self.expectMasterState(third_master.getUUID(), protocol.RUNNING_STATE) self.expectMasterState(third_master.getUUID(), protocol.RUNNING_STATE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment