Merge pull request #241 from DreadPirateShawn/RouteVPCPeeringConnection
Route vpc peering connection
This commit is contained in:
		
						commit
						83481b589b
					
				@ -4,6 +4,7 @@ python:
 | 
				
			|||||||
  - 2.7
 | 
					  - 2.7
 | 
				
			||||||
env:
 | 
					env:
 | 
				
			||||||
    matrix:
 | 
					    matrix:
 | 
				
			||||||
 | 
					      - BOTO_VERSION=2.34.0
 | 
				
			||||||
      - BOTO_VERSION=2.32.1
 | 
					      - BOTO_VERSION=2.32.1
 | 
				
			||||||
      - BOTO_VERSION=2.25.0
 | 
					      - BOTO_VERSION=2.25.0
 | 
				
			||||||
      - BOTO_VERSION=2.7
 | 
					      - BOTO_VERSION=2.7
 | 
				
			||||||
 | 
				
			|||||||
@ -155,6 +155,7 @@ DESCRIBE_ROUTE_TABLES_RESPONSE = """
 | 
				
			|||||||
                  <state>active</state>
 | 
					                  <state>active</state>
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                {% if route.vpc_pcx %}
 | 
					                {% if route.vpc_pcx %}
 | 
				
			||||||
 | 
					                  <vpcPeeringConnectionId>{{ route.vpc_pcx.id }}</vpcPeeringConnectionId>
 | 
				
			||||||
                  <origin>CreateRoute</origin>
 | 
					                  <origin>CreateRoute</origin>
 | 
				
			||||||
                  <state>blackhole</state>
 | 
					                  <state>blackhole</state>
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
 | 
				
			|||||||
@ -392,28 +392,29 @@ def test_routes_not_supported():
 | 
				
			|||||||
    conn.replace_route.when.called_with(main_route_table.id, ROUTE_CIDR, interface_id='eni-1234abcd').should.throw(NotImplementedError)
 | 
					    conn.replace_route.when.called_with(main_route_table.id, ROUTE_CIDR, interface_id='eni-1234abcd').should.throw(NotImplementedError)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#@requires_boto_gte("2.32.2")
 | 
					@requires_boto_gte("2.34.0")
 | 
				
			||||||
#@mock_ec2
 | 
					@mock_ec2
 | 
				
			||||||
#def test_routes_vpc_peering_connection():
 | 
					def test_routes_vpc_peering_connection():
 | 
				
			||||||
#    conn = boto.connect_vpc('the_key', 'the_secret')
 | 
					    conn = boto.connect_vpc('the_key', 'the_secret')
 | 
				
			||||||
#    vpc = conn.create_vpc("10.0.0.0/16")
 | 
					    vpc = conn.create_vpc("10.0.0.0/16")
 | 
				
			||||||
#    main_route_table = conn.get_all_route_tables(filters={'association.main':'true','vpc-id':vpc.id})[0]
 | 
					    main_route_table = conn.get_all_route_tables(filters={'association.main':'true','vpc-id':vpc.id})[0]
 | 
				
			||||||
#    local_route = main_route_table.routes[0]
 | 
					    local_route = main_route_table.routes[0]
 | 
				
			||||||
#    ROUTE_CIDR = "10.0.0.4/24"
 | 
					    ROUTE_CIDR = "10.0.0.4/24"
 | 
				
			||||||
#
 | 
					
 | 
				
			||||||
#    peer_vpc = conn.create_vpc("11.0.0.0/16")
 | 
					    peer_vpc = conn.create_vpc("11.0.0.0/16")
 | 
				
			||||||
#    vpc_pcx = conn.create_vpc_peering_connection(vpc.id, peer_vpc.id)
 | 
					    vpc_pcx = conn.create_vpc_peering_connection(vpc.id, peer_vpc.id)
 | 
				
			||||||
#
 | 
					
 | 
				
			||||||
#    conn.create_route(main_route_table.id, ROUTE_CIDR, vpc_peering_connection_id=vpc_pcx.id)
 | 
					    conn.create_route(main_route_table.id, ROUTE_CIDR, vpc_peering_connection_id=vpc_pcx.id)
 | 
				
			||||||
#
 | 
					
 | 
				
			||||||
#    # Refresh route table
 | 
					    # Refresh route table
 | 
				
			||||||
#    main_route_table = conn.get_all_route_tables(main_route_table.id)[0]
 | 
					    main_route_table = conn.get_all_route_tables(main_route_table.id)[0]
 | 
				
			||||||
#    new_routes = [route for route in main_route_table.routes if route.destination_cidr_block != vpc.cidr_block]
 | 
					    new_routes = [route for route in main_route_table.routes if route.destination_cidr_block != vpc.cidr_block]
 | 
				
			||||||
#    new_routes.should.have.length_of(1)
 | 
					    new_routes.should.have.length_of(1)
 | 
				
			||||||
#
 | 
					
 | 
				
			||||||
#    new_route = new_routes[0]
 | 
					    new_route = new_routes[0]
 | 
				
			||||||
#    new_route.gateway_id.should.be.none
 | 
					    new_route.gateway_id.should.be.none
 | 
				
			||||||
#    new_route.instance_id.should.be.none
 | 
					    new_route.instance_id.should.be.none
 | 
				
			||||||
#    new_route.state.should.equal('blackhole')
 | 
					    new_route.vpc_peering_connection_id.should.equal(vpc_pcx.id)
 | 
				
			||||||
#    new_route.destination_cidr_block.should.equal(ROUTE_CIDR)
 | 
					    new_route.state.should.equal('blackhole')
 | 
				
			||||||
 | 
					    new_route.destination_cidr_block.should.equal(ROUTE_CIDR)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user