Adds support for enable/disable/describe vpc-classic-link-dns-support.
This commit is contained in:
parent
17cc46b91e
commit
6d52cd06cb
4 changed files with 127 additions and 3 deletions
|
|
@ -746,3 +746,63 @@ def test_describe_classic_link_multiple():
|
|||
response = ec2.meta.client.describe_vpc_classic_link(VpcIds=[vpc1.id, vpc2.id])
|
||||
assert response.get('Vpcs')[0].get('ClassicLinkEnabled').should.be.false
|
||||
assert response.get('Vpcs')[1].get('ClassicLinkEnabled').should.be.true
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_enable_vpc_classic_link_dns_support():
|
||||
ec2 = boto3.resource('ec2', region_name='us-west-1')
|
||||
|
||||
# Create VPC
|
||||
vpc = ec2.create_vpc(CidrBlock='10.1.0.0/16')
|
||||
|
||||
response = ec2.meta.client.enable_vpc_classic_link_dns_support(VpcId=vpc.id)
|
||||
assert response.get('Return').should.be.true
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_disable_vpc_classic_link_dns_support():
|
||||
ec2 = boto3.resource('ec2', region_name='us-west-1')
|
||||
|
||||
# Create VPC
|
||||
vpc = ec2.create_vpc(CidrBlock='10.0.0.0/16')
|
||||
|
||||
ec2.meta.client.enable_vpc_classic_link_dns_support(VpcId=vpc.id)
|
||||
response = ec2.meta.client.disable_vpc_classic_link_dns_support(VpcId=vpc.id)
|
||||
assert response.get('Return').should.be.false
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_describe_classic_link_dns_support_enabled():
|
||||
ec2 = boto3.resource('ec2', region_name='us-west-1')
|
||||
|
||||
# Create VPC
|
||||
vpc = ec2.create_vpc(CidrBlock='10.0.0.0/16')
|
||||
|
||||
ec2.meta.client.enable_vpc_classic_link_dns_support(VpcId=vpc.id)
|
||||
response = ec2.meta.client.describe_vpc_classic_link_dns_support(VpcIds=[vpc.id])
|
||||
assert response.get('Vpcs')[0].get('ClassicLinkDnsSupported').should.be.true
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_describe_classic_link_dns_support_disabled():
|
||||
ec2 = boto3.resource('ec2', region_name='us-west-1')
|
||||
|
||||
# Create VPC
|
||||
vpc = ec2.create_vpc(CidrBlock='10.90.0.0/16')
|
||||
|
||||
response = ec2.meta.client.describe_vpc_classic_link_dns_support(VpcIds=[vpc.id])
|
||||
assert response.get('Vpcs')[0].get('ClassicLinkDnsSupported').should.be.false
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_describe_classic_link_dns_support_multiple():
|
||||
ec2 = boto3.resource('ec2', region_name='us-west-1')
|
||||
|
||||
# Create VPC
|
||||
vpc1 = ec2.create_vpc(CidrBlock='10.90.0.0/16')
|
||||
vpc2 = ec2.create_vpc(CidrBlock='10.0.0.0/16')
|
||||
|
||||
ec2.meta.client.enable_vpc_classic_link_dns_support(VpcId=vpc2.id)
|
||||
response = ec2.meta.client.describe_vpc_classic_link_dns_support(VpcIds=[vpc1.id, vpc2.id])
|
||||
assert response.get('Vpcs')[0].get('ClassicLinkDnsSupported').should.be.false
|
||||
assert response.get('Vpcs')[1].get('ClassicLinkDnsSupported').should.be.true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue