@@ -0,0 +1,737 @@
+#!/usr/bin/env python%0A%0A# Both have a very small chance of occuring%0A%0Afrom twisted.internet import reactor%0Afrom mesh import Mesh, MeshNode, packet_type, BYE, DATA%0Aimport sys%0A%0ANUMNODES = 2%0ADELAY = 0.1%0A%0Am = Mesh()%0A%0Aclass TestMeshNode(MeshNode):%0A%0A  def newNode (self, data):%0A    MeshNode.newNode (self, data)%0A    print data + %22 joined%22%0A    self.fail(data)%0A%0A  def leftNode (self, data):%0A    MeshNode.leftNode (self, data)%0A    print data + %22 left%22%0A%0An = TestMeshNode(%22node%22, m)%0Am.addMeshNode(n)%0A%0Afailnode = MeshNode(%22failnode%22, m)%0Am.addMeshNode(failnode)%0A%0A# Connect all nodes to all others. 1024 bytes/s bandwidth, 50ms delay and 0%25%0A# packet loss.. (bandwidth and delay aren't implemented just yet)%0Am.connect_full(1024, 50, 0.30)%0A%0Areactor.run()%0A

Add a test continously failing one node, causing group split and reconnects