From f8fa9162f8de05ce7f784901d7dfa1fba248b2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Wisniewski?= <gregory@nexedi.com> Date: Wed, 13 Jan 2010 10:39:40 +0000 Subject: [PATCH] Only storage nodes are binded to the verification handler, so there no need to check with a master node. Moreover, initial nodes are set in UNKNOWN state. git-svn-id: https://svn.erp5.org/repos/neo/trunk@1418 71dcc9de-d417-0410-9af5-da40c76e7ee4 --- neo/tests/master/testVerificationHandler.py | 27 +++------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/neo/tests/master/testVerificationHandler.py b/neo/tests/master/testVerificationHandler.py index 616be176..e30b5b91 100644 --- a/neo/tests/master/testVerificationHandler.py +++ b/neo/tests/master/testVerificationHandler.py @@ -75,52 +75,31 @@ class MasterVerificationTests(NeoTestBase): # Tests def test_01_connectionClosed(self): - uuid = self.identifyToMasterNode(node_type=NodeTypes.MASTER, port=self.master_port) - conn = self.getFakeConnection(uuid, self.master_address) - self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.RUNNING) - self.verification.connectionClosed(conn) - self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.TEMPORARILY_DOWN) # test a storage, must raise as cluster no longer op uuid = self.identifyToMasterNode() conn = self.getFakeConnection(uuid, self.storage_address) self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.RUNNING) + NodeStates.UNKNOWN) self.assertRaises(VerificationFailure, self.verification.connectionClosed,conn) self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), NodeStates.TEMPORARILY_DOWN) def test_02_timeoutExpired(self): - uuid = self.identifyToMasterNode(node_type=NodeTypes.MASTER, port=self.master_port) - conn = self.getFakeConnection(uuid, self.master_address) - self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.RUNNING) - self.verification.timeoutExpired(conn) - self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.TEMPORARILY_DOWN) # test a storage, must raise as cluster no longer op uuid = self.identifyToMasterNode() conn = self.getFakeConnection(uuid, self.storage_address) self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.RUNNING) + NodeStates.UNKNOWN) self.assertRaises(VerificationFailure, self.verification.connectionClosed,conn) self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), NodeStates.TEMPORARILY_DOWN) def test_03_peerBroken(self): - uuid = self.identifyToMasterNode(node_type=NodeTypes.MASTER, port=self.master_port) - conn = self.getFakeConnection(uuid, self.master_address) - self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.RUNNING) - self.verification.peerBroken(conn) - self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.BROKEN) # test a storage, must raise as cluster no longer op uuid = self.identifyToMasterNode() conn = self.getFakeConnection(uuid, self.storage_address) self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), - NodeStates.RUNNING) + NodeStates.UNKNOWN) self.assertRaises(VerificationFailure, self.verification.connectionClosed,conn) self.assertEqual(self.app.nm.getByAddress(conn.getAddress()).getState(), NodeStates.TEMPORARILY_DOWN) -- 2.30.9