Exemplo n.º 1
0
 def test_check_partition_swappable_already_exists(self):
     b1 = self.cluster.brokers[1]
     b2 = self.cluster.brokers[2]
     replicas_a = [b1, b2]
     replicas_b = [b2, b1]
     assert check_partition_swappable(replicas_a, replicas_b, 0) is False
     assert check_partition_swappable(replicas_b, replicas_a, 0) is False
Exemplo n.º 2
0
 def test_check_partition_swappable_already_exists(self):
     b1 = self.cluster.brokers[1]
     b2 = self.cluster.brokers[2]
     replicas_a = [b1, b2]
     replicas_b = [b2, b1]
     assert check_partition_swappable(replicas_a, replicas_b, 0) is False
     assert check_partition_swappable(replicas_b, replicas_a, 0) is False
Exemplo n.º 3
0
 def test_check_partition_swappable_racks_ok(self):
     b1 = self.cluster.brokers[1]
     b2 = self.cluster.brokers[2]
     b3 = Broker(1, 'brokerhost3.example.com')
     b4 = Broker(1, 'brokerhost4.example.com')
     b2.rack = "a"
     b3.rack = "b"
     b4.rack = "b"
     replicas_a = [b1, b2]
     replicas_b = [b3, b4]
     assert check_partition_swappable(replicas_a, replicas_b, 0) is True
     assert check_partition_swappable(replicas_b, replicas_a, 0) is True
Exemplo n.º 4
0
 def test_check_partition_swappable_racks_ok(self):
     b1 = self.cluster.brokers[1]
     b2 = self.cluster.brokers[2]
     b3 = Broker(1, 'brokerhost3.example.com')
     b4 = Broker(1, 'brokerhost4.example.com')
     b2.rack = "a"
     b3.rack = "b"
     b4.rack = "b"
     replicas_a = [b1, b2]
     replicas_b = [b3, b4]
     assert check_partition_swappable(replicas_a, replicas_b, 0) is True
     assert check_partition_swappable(replicas_b, replicas_a, 0) is True