def testKillNodes_NotConnected(self): """Test method for ScalarisVM.killNodes() with a closed connection.""" vm = ScalarisVM() vm.close_connection() #self.assertRaises(scalaris.ConnectionError, vm.killNodes(0)) vm.killNodes(0) vm.close_connection()
def testKillNodes_NotConnected(self): """Test method for ScalarisVM.killNodes() with a closed connection.""" vm = ScalarisVM() vm.close_connection() #self.assertRaises(scalaris.ConnectionError, vm.killNodes(0)) vm.killNodes(0) vm.close_connection()
def _testDeleteNodes(self, nodesToRemove, action): """Test method for ScalarisVM.shutdownNode() and ScalarisVM.killNode().""" vm = ScalarisVM() size = vm.getNumberOfNodes(); if nodesToRemove >= 1: vm.addNodes(nodesToRemove) self.assertEqual(size + nodesToRemove, vm.getNumberOfNodes()) if action == 'shutdown': result = vm.shutdownNodes(nodesToRemove) elif action == 'kill': result = vm.killNodes(nodesToRemove) self.assertEqual(nodesToRemove, len(result)) self.assertEqual(size, vm.getNumberOfNodes()) nodes = vm.getNodes() for name in result: self.assertTrue(not name in nodes, str(nodes) + " should not contain " + name) vm.close_connection()
def _testDeleteNodes(self, nodesToRemove, action): """Test method for ScalarisVM.shutdownNode() and ScalarisVM.killNode().""" vm = ScalarisVM() size = vm.getNumberOfNodes() if nodesToRemove >= 1: vm.addNodes(nodesToRemove) self.assertEqual(size + nodesToRemove, vm.getNumberOfNodes()) if action == 'shutdown': result = vm.shutdownNodes(nodesToRemove) elif action == 'kill': result = vm.killNodes(nodesToRemove) self.assertEqual(nodesToRemove, len(result)) self.assertEqual(size, vm.getNumberOfNodes()) nodes = vm.getNodes() for name in result: self.assertTrue(not name in nodes, str(nodes) + " should not contain " + name) vm.close_connection()