+ self.assertEquals(self.client._socket.send_count, len(self.new_peers))
+ self.assert_(self.client._socket.last_address in self.new_peers)
+
+ def testSetPeersFamily(self):
+ self.client._SetPeersAddressFamily()
+ self.assertEquals(self.client._family, self.family)
+ mixed_peers = ["192.0.2.99", "2001:db8:beef::13"]
+ self.client.UpdatePeerList(mixed_peers)
+ self.assertRaises(errors.ConfdClientError,
+ self.client._SetPeersAddressFamily)
+
+
+class TestIP4Client(unittest.TestCase, _BaseClientTest):
+ """Client tests"""
+ mc_list = ["192.0.2.1",
+ "192.0.2.2",
+ "192.0.2.3",
+ "192.0.2.4",
+ "192.0.2.5",
+ "192.0.2.6",
+ "192.0.2.7",
+ "192.0.2.8",
+ "192.0.2.9",
+ ]
+ new_peers = ["198.51.100.1", "198.51.100.2"]
+ family = socket.AF_INET
+
+ def setUp(self):
+ unittest.TestCase.setUp(self)
+ _BaseClientTest.setUp(self)
+
+
+class TestIP6Client(unittest.TestCase, _BaseClientTest):
+ """Client tests"""
+ mc_list = ["2001:db8::1",
+ "2001:db8::2",
+ "2001:db8::3",
+ "2001:db8::4",
+ "2001:db8::5",
+ "2001:db8::6",
+ "2001:db8::7",
+ "2001:db8::8",
+ "2001:db8::9",
+ ]
+ new_peers = ["2001:db8:beef::11", "2001:db8:beef::12"]
+ family = socket.AF_INET6
+
+ def setUp(self):
+ unittest.TestCase.setUp(self)
+ _BaseClientTest.setUp(self)