def test_tiny_nop(self): config = MockConfig(Tiny.interface_ip, Tiny.internal_ip, Tiny.topology()) coordinator = MockCoordinator(Tiny.connections()) topo_changed = update_gen.fullsync_local_gen(config, coordinator, Tiny.asid, 0) self.assertFalse(topo_changed) self.assertEqual(config.writtenTopo, {})
def test_as1_17_nop(self): """ Fullsync with same set of connections """ config = MockConfig(AS1_17.interface_ip, AS1_17.internal_ip, AS1_17.topology()) coordinator = MockCoordinator(AS1_17.connections()) topo_changed = update_gen.fullsync_local_gen(config, coordinator, AS1_17.asid, 0) self.assertFalse(topo_changed) self.assertEqual(config.writtenTopo, {})
def test_tiny_remove(self): """ Fullsync with one removed connection. """ config = MockConfig(Tiny.interface_ip, Tiny.internal_ip, Tiny.topologyAdded()) coordinator = MockCoordinator(Tiny.connections()) topo_changed = update_gen.fullsync_local_gen(config, coordinator, Tiny.asid, 0) self.assertTrue(topo_changed) self.assertEqual(config.writtenTopo[Tiny.asid], Tiny.topology())
def test_as1_17_upgrade_oneBR_to_current(self): """ Fullsync with same set of connections, initially with one for all connection, upgrade to the latest version with <= 12 interfaces per BR and a separate infrastructure BR """ config = MockConfig(AS1_17.interface_ip, AS1_17.internal_ip, AS1_17.topologyOneBR()) coordinator = MockCoordinator(AS1_17.connections()) topo_changed = update_gen.fullsync_local_gen(config, coordinator, AS1_17.asid, 0) self.assertTrue(topo_changed) self.assertEqual(config.writtenTopo[AS1_17.asid], AS1_17.topology())
def test_tiny_upgrade_manyBR_to_current(self): """ Fullsync with same set of connections, initially with one BR per connection, upgrade to the latest version with <= 12 interfaces per BR and a separate infrastructure BR """ config = MockConfig(Tiny.interface_ip, Tiny.internal_ip, Tiny.topologyManyBRs()) coordinator = MockCoordinator(Tiny.connections()) topo_changed = update_gen.fullsync_local_gen(config, coordinator, Tiny.asid, 0) self.assertTrue(topo_changed) self.assertEqual(config.writtenTopo[Tiny.asid], Tiny.topology())