diff --git a/tests/st/bgp/test_global_config.py b/tests/st/bgp/test_global_config.py index b4eb748c0..93f598530 100644 --- a/tests/st/bgp/test_global_config.py +++ b/tests/st/bgp/test_global_config.py @@ -48,7 +48,7 @@ def test_defaults(self): self.assertEquals(host.calicoctl("config get nodeToNodeMesh"), "on") @attr('slow') - def test_as_num(self): + def _test_as_num(self, backend='bird'): """ Test using different AS number for the node-to-node mesh. @@ -66,8 +66,8 @@ def test_as_num(self): # Start host1 using the inherited AS, and host2 using a specified # AS (same as default). - host1.start_calico_node() - host2.start_calico_node("--as=%s" % LARGE_AS_NUM) + host1.start_calico_node("--backend=%s" % backend) + host2.start_calico_node("--backend=%s --as=%s" % (backend, LARGE_AS_NUM)) # Create a network and a couple of workloads on each host. network1 = host1.create_network("subnet1", subnet=DEFAULT_IPV4_POOL_CIDR) @@ -86,3 +86,11 @@ def test_as_num(self): # Check the BGP status on each host. check_bird_status(host1, [("node-to-node mesh", host2.ip, "Established")]) check_bird_status(host2, [("node-to-node mesh", host1.ip, "Established")]) + + @attr('slow') + def test_bird_as_num(self): + self._test_as_num(backend='bird') + + @attr('slow') + def test_gobgp_as_num(self): + self._test_as_num(backend='gobgp') diff --git a/tests/st/bgp/test_global_peers.py b/tests/st/bgp/test_global_peers.py index 66f611249..5bc0ed997 100644 --- a/tests/st/bgp/test_global_peers.py +++ b/tests/st/bgp/test_global_peers.py @@ -25,8 +25,7 @@ class TestGlobalPeers(TestBase): - @attr('slow') - def test_global_peers(self): + def _test_global_peers(self, backend='bird'): """ Test global BGP peer configuration. @@ -40,8 +39,8 @@ def test_global_peers(self): additional_docker_options=ADDITIONAL_DOCKER_OPTIONS, start_calico=False) as host2: # Start both hosts using specific AS numbers. - host1.start_calico_node("--as=%s" % LARGE_AS_NUM) - host2.start_calico_node("--as=%s" % LARGE_AS_NUM) + host1.start_calico_node("--backend=%s --as=%s" % (backend, LARGE_AS_NUM)) + host2.start_calico_node("--backend=%s --as=%s" % (backend, LARGE_AS_NUM)) # Create a network and a couple of workloads on each host. network1 = host1.create_network("subnet1", subnet=DEFAULT_IPV4_POOL_CIDR) @@ -71,7 +70,15 @@ def test_global_peers(self): # Check the BGP status on each host. Connections from a node to # itself will be idle since this is invalid BGP configuration. - check_bird_status(host1, [("global", host1.ip, "Idle"), + check_bird_status(host1, [("global", host1.ip, ["Idle", "Active"]), ("global", host2.ip, "Established")]) check_bird_status(host2, [("global", host1.ip, "Established"), - ("global", host2.ip, "Idle")]) + ("global", host2.ip, ["Idle", "Active"])]) + + @attr('slow') + def test_bird_node_peers(self): + self._test_global_peers(backend='bird') + + @attr('slow') + def test_gobgp_node_peers(self): + self._test_global_peers(backend='gobgp') diff --git a/tests/st/bgp/test_node_peers.py b/tests/st/bgp/test_node_peers.py index 182440838..acc694d77 100644 --- a/tests/st/bgp/test_node_peers.py +++ b/tests/st/bgp/test_node_peers.py @@ -23,8 +23,7 @@ class TestNodePeers(TestBase): - @attr('slow') - def test_node_peers(self): + def _test_node_peers(self, backend='bird'): """ Test per-node BGP peer configuration. @@ -39,8 +38,8 @@ def test_node_peers(self): start_calico=False) as host2: # Start both hosts using specific AS numbers. - host1.start_calico_node("--as=%s" % LARGE_AS_NUM) - host2.start_calico_node("--as=%s" % LARGE_AS_NUM) + host1.start_calico_node("--backend=%s --as=%s" % (backend, LARGE_AS_NUM)) + host2.start_calico_node("--backend=%s --as=%s" % (backend, LARGE_AS_NUM)) # Create a network and a couple of workloads on each host. network1 = host1.create_network("subnet1", subnet=DEFAULT_IPV4_POOL_CIDR) @@ -72,3 +71,11 @@ def test_node_peers(self): # Check the BGP status on each host. check_bird_status(host1, [("node specific", host2.ip, "Established")]) check_bird_status(host2, [("node specific", host1.ip, "Established")]) + + @attr('slow') + def test_bird_node_peers(self): + self._test_node_peers(backend='bird') + + @attr('slow') + def test_gobgp_node_peers(self): + self._test_node_peers(backend='gobgp') diff --git a/tests/st/bgp/test_route_reflector_cluster.py b/tests/st/bgp/test_route_reflector_cluster.py index 5e7eab2eb..3c4c602db 100644 --- a/tests/st/bgp/test_route_reflector_cluster.py +++ b/tests/st/bgp/test_route_reflector_cluster.py @@ -21,20 +21,27 @@ class TestRouteReflectorCluster(TestBase): - @attr('slow') - def test_route_reflector_cluster(self): + def _test_route_reflector_cluster(self, backend='bird'): """ Run a multi-host test using a cluster of route reflectors and node specific peerings. """ with DockerHost('host1', - additional_docker_options=ADDITIONAL_DOCKER_OPTIONS) as host1, \ + additional_docker_options=ADDITIONAL_DOCKER_OPTIONS, + start_calico=False) as host1, \ DockerHost('host2', - additional_docker_options=ADDITIONAL_DOCKER_OPTIONS) as host2, \ + additional_docker_options=ADDITIONAL_DOCKER_OPTIONS, + start_calico=False) as host2, \ DockerHost('host3', - additional_docker_options=ADDITIONAL_DOCKER_OPTIONS) as host3, \ + additional_docker_options=ADDITIONAL_DOCKER_OPTIONS, + start_calico=False) as host3, \ RouteReflectorCluster(2, 2) as rrc: + # Start both hosts using specific backends. + host1.start_calico_node("--backend=%s" % backend) + host2.start_calico_node("--backend=%s" % backend) + host3.start_calico_node("--backend=%s" % backend) + # Set the default AS number - as this is used by the RR mesh, and # turn off the node-to-node mesh (do this from any host). host1.calicoctl("config set asNumber 64513") @@ -69,3 +76,11 @@ def test_route_reflector_cluster(self): ip_pass_list=[workload_host1.ip, workload_host2.ip, workload_host3.ip]) + + @attr('slow') + def test_bird_route_reflector_cluster(self): + self._test_route_reflector_cluster(backend='bird') + + @attr('slow') + def test_gobgp_route_reflector_cluster(self): + self._test_route_reflector_cluster(backend='gobgp') diff --git a/tests/st/bgp/test_single_route_reflector.py b/tests/st/bgp/test_single_route_reflector.py index f847a6e3f..eb73636ea 100644 --- a/tests/st/bgp/test_single_route_reflector.py +++ b/tests/st/bgp/test_single_route_reflector.py @@ -22,17 +22,23 @@ class TestSingleRouteReflector(TestBase): @attr('slow') - def test_single_route_reflector(self): + def _test_single_route_reflector(self, backend='bird'): """ Run a multi-host test using a single route reflector and global peering. """ with DockerHost('host1', - additional_docker_options=ADDITIONAL_DOCKER_OPTIONS) as host1, \ + additional_docker_options=ADDITIONAL_DOCKER_OPTIONS, + start_calico=False) as host1, \ DockerHost('host2', - additional_docker_options=ADDITIONAL_DOCKER_OPTIONS) as host2, \ + additional_docker_options=ADDITIONAL_DOCKER_OPTIONS, + start_calico=False) as host2, \ RouteReflectorCluster(1, 1) as rrc: + # Start both hosts using specific backends. + host1.start_calico_node("--backend=%s" % backend) + host2.start_calico_node("--backend=%s" % backend) + # Set the default AS number - as this is used by the RR mesh, and # turn off the node-to-node mesh (do this from any host). host1.calicoctl("config set asNumber 64514") @@ -62,3 +68,11 @@ def test_single_route_reflector(self): workload_host2], ip_pass_list=[workload_host1.ip, workload_host2.ip]) + + @attr('slow') + def test_bird_route_reflector_cluster(self): + self._test_single_route_reflector(backend='bird') + + @attr('slow') + def test_gobgp_route_reflector_cluster(self): + self._test_single_route_reflector(backend='gobgp')