Commit 340b9dd7 authored by Aurel's avatar Aurel

test that the number of partition is well stored in DB when received from PMN


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@456 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6781b089
...@@ -500,6 +500,7 @@ server: 127.0.0.1:10020 ...@@ -500,6 +500,7 @@ server: 127.0.0.1:10020
self.app.trying_master_node = self.trying_master_node self.app.trying_master_node = self.trying_master_node
self.assertNotEquals(self.app.trying_master_node.getUUID(), uuid) self.assertNotEquals(self.app.trying_master_node.getUUID(), uuid)
self.assertNotEquals(self.app.trying_master_node.getUUID(), uuid) self.assertNotEquals(self.app.trying_master_node.getUUID(), uuid)
self.assertEqual(None, self.app.dm.getNumPartitions())
packet = Packet(msg_id=1, msg_type=ACCEPT_NODE_IDENTIFICATION) packet = Packet(msg_id=1, msg_type=ACCEPT_NODE_IDENTIFICATION)
self.bootstrap.handleAcceptNodeIdentification( self.bootstrap.handleAcceptNodeIdentification(
conn=conn, conn=conn,
...@@ -514,6 +515,7 @@ server: 127.0.0.1:10020 ...@@ -514,6 +515,7 @@ server: 127.0.0.1:10020
# check PT # check PT
self.assertEquals(self.app.num_partitions, self.num_partitions) self.assertEquals(self.app.num_partitions, self.num_partitions)
self.assertEquals(self.app.num_replicas, self.num_replicas) self.assertEquals(self.app.num_replicas, self.num_replicas)
self.assertEqual(self.num_partitions, self.app.dm.getNumPartitions())
self.assertTrue(isinstance(self.app.pt, PartitionTable)) self.assertTrue(isinstance(self.app.pt, PartitionTable))
self.assertEquals(self.app.ptid, self.app.dm.getPTID()) self.assertEquals(self.app.ptid, self.app.dm.getPTID())
# uuid # uuid
...@@ -536,6 +538,7 @@ server: 127.0.0.1:10020 ...@@ -536,6 +538,7 @@ server: 127.0.0.1:10020
packet = Packet(msg_id=1, msg_type=ACCEPT_NODE_IDENTIFICATION) packet = Packet(msg_id=1, msg_type=ACCEPT_NODE_IDENTIFICATION)
uuid, your_uuid = self.getNewUUID(), self.getNewUUID() uuid, your_uuid = self.getNewUUID(), self.getNewUUID()
self.assertNotEquals(self.app.trying_master_node.getUUID(), uuid) self.assertNotEquals(self.app.trying_master_node.getUUID(), uuid)
self.assertEqual(None, self.app.dm.getNumPartitions())
self.bootstrap.handleAcceptNodeIdentification( self.bootstrap.handleAcceptNodeIdentification(
conn=conn, conn=conn,
uuid=uuid, uuid=uuid,
...@@ -558,7 +561,8 @@ server: 127.0.0.1:10020 ...@@ -558,7 +561,8 @@ server: 127.0.0.1:10020
self.assertTrue(isinstance(packet, Packet)) self.assertTrue(isinstance(packet, Packet))
self.assertEquals(packet.getType(), ASK_PRIMARY_MASTER) self.assertEquals(packet.getType(), ASK_PRIMARY_MASTER)
self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 1) self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 1)
self.assertEqual(self.num_partitions, self.app.dm.getNumPartitions())
def test_10_handleAnswerPrimaryMaster01(self): def test_10_handleAnswerPrimaryMaster01(self):
# server connection rejected # server connection rejected
conn = Mock({"isServerConnection": True, conn = Mock({"isServerConnection": True,
......
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