Commit af374f83 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Storage node must never send this packet, even during recovery, so remove this test case.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1491 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent f82331fc
......@@ -90,63 +90,6 @@ class MasterRecoveryTests(NeoTestBase):
self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(),
NodeStates.BROKEN)
def test_08_notifyNodeInformation(self):
recovery = self.recovery
uuid = self.identifyToMasterNode(NodeTypes.MASTER, port=self.master_port)
packet = Packets.NotifyNodeInformation()
# tell about a client node, do nothing
conn = self.getFakeConnection(uuid, self.master_address)
node_list = [(NodeTypes.CLIENT, '127.0.0.1', self.client_port,
self.getNewUUID(), NodeStates.DOWN),]
self.assertEqual(len(self.app.nm.getList()), 0)
recovery.notifyNodeInformation(conn, packet, node_list)
self.assertEqual(len(self.app.nm.getList()), 0)
# tell the master node about itself, if running must do nothing
conn = self.getFakeConnection(uuid, self.master_address)
node_list = [(NodeTypes.MASTER, '127.0.0.1', self.master_port-1,
self.app.uuid, NodeStates.RUNNING),]
node = self.app.nm.getByAddress(("127.0.0.1", self.master_port-1))
self.assertEqual(node, None)
recovery.notifyNodeInformation(conn, packet, node_list)
node = self.app.nm.getByAddress(("127.0.0.1", self.master_port-1))
# tell the master node about itself, if down must raise
conn = self.getFakeConnection(uuid, self.master_address)
node_list = [(NodeTypes.MASTER, '127.0.0.1', self.master_port-1,
self.app.uuid, NodeStates.DOWN),]
node = self.app.nm.getByAddress(("127.0.0.1", self.master_port-1))
self.assertEqual(node, None)
self.assertRaises(RuntimeError, recovery.notifyNodeInformation, conn, packet, node_list)
# tell about an unknown storage node, do nothing
conn = self.getFakeConnection(uuid, self.master_address)
node_list = [(NodeTypes.STORAGE, '127.0.0.1', self.master_port - 1,
self.getNewUUID(), NodeStates.DOWN),]
self.assertEqual(len(self.app.nm.getStorageList()), 0)
recovery.notifyNodeInformation(conn, packet, node_list)
self.assertEqual(len(self.app.nm.getStorageList()), 0)
# tell about a known node but different address
conn = self.getFakeConnection(uuid, self.master_address)
node_list = [(NodeTypes.MASTER, '127.0.0.2', self.master_port, uuid,
NodeStates.DOWN),]
node = self.app.nm.getByAddress(("127.0.0.1", self.master_port))
self.assertEqual(node.getState(), NodeStates.RUNNING)
recovery.notifyNodeInformation(conn, packet, node_list)
node = self.app.nm.getByAddress(("127.0.0.1", self.master_port))
self.assertEqual(node.getState(), NodeStates.RUNNING)
# tell about a known node
conn = self.getFakeConnection(uuid, self.master_address)
node_list = [(NodeTypes.MASTER, '127.0.0.1', self.master_port, uuid,
NodeStates.DOWN),]
node = self.app.nm.getByAddress(("127.0.0.1", self.master_port))
self.assertEqual(node.getState(), NodeStates.RUNNING)
recovery.notifyNodeInformation(conn, packet, node_list)
node = self.app.nm.getByAddress(("127.0.0.1", self.master_port))
self.assertEqual(node.getState(), NodeStates.DOWN)
def test_09_answerLastIDs(self):
recovery = self.recovery
......
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