Fixed some tests.
Some subnets were bogus so fixed that. Fixed issue where EC2-Classic was not respected. RDS Deepcopy was breaking on subnet generator
This commit is contained in:
parent
d935e0995f
commit
9ddf7fe436
4 changed files with 26 additions and 15 deletions
|
|
@ -7,6 +7,7 @@ import base64
|
|||
import datetime
|
||||
import ipaddress
|
||||
|
||||
import six
|
||||
import boto
|
||||
import boto3
|
||||
from boto.ec2.instance import Reservation, InstanceAttribute
|
||||
|
|
@ -414,6 +415,7 @@ def test_get_instances_filtering_by_image_id():
|
|||
'Values': [image_id]}])['Reservations']
|
||||
reservations[0]['Instances'].should.have.length_of(1)
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_get_instances_filtering_by_private_dns():
|
||||
image_id = 'ami-1234abcd'
|
||||
|
|
@ -428,6 +430,7 @@ def test_get_instances_filtering_by_private_dns():
|
|||
])['Reservations']
|
||||
reservations[0]['Instances'].should.have.length_of(1)
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_get_instances_filtering_by_ni_private_dns():
|
||||
image_id = 'ami-1234abcd'
|
||||
|
|
@ -442,6 +445,7 @@ def test_get_instances_filtering_by_ni_private_dns():
|
|||
])['Reservations']
|
||||
reservations[0]['Instances'].should.have.length_of(1)
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_get_instances_filtering_by_instance_group_name():
|
||||
image_id = 'ami-1234abcd'
|
||||
|
|
@ -459,6 +463,7 @@ def test_get_instances_filtering_by_instance_group_name():
|
|||
])['Reservations']
|
||||
reservations[0]['Instances'].should.have.length_of(1)
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_get_instances_filtering_by_instance_group_id():
|
||||
image_id = 'ami-1234abcd'
|
||||
|
|
@ -477,6 +482,7 @@ def test_get_instances_filtering_by_instance_group_id():
|
|||
])['Reservations']
|
||||
reservations[0]['Instances'].should.have.length_of(1)
|
||||
|
||||
|
||||
@mock_ec2_deprecated
|
||||
def test_get_instances_filtering_by_tag():
|
||||
conn = boto.connect_ec2()
|
||||
|
|
@ -832,7 +838,7 @@ def test_run_instance_with_placement():
|
|||
|
||||
|
||||
@mock_ec2
|
||||
def test_run_instance_with_subnet():
|
||||
def test_run_instance_with_subnet_boto3():
|
||||
client = boto3.client('ec2', region_name='eu-central-1')
|
||||
|
||||
ip_networks = [
|
||||
|
|
@ -865,7 +871,7 @@ def test_run_instance_with_subnet():
|
|||
instance = resp['Instances'][0]
|
||||
instance['SubnetId'].should.equal(subnet_id)
|
||||
|
||||
priv_ipv4 = ipaddress.ip_address(instance['PrivateIpAddress'])
|
||||
priv_ipv4 = ipaddress.ip_address(six.text_type(instance['PrivateIpAddress']))
|
||||
subnet_cidr.should.contain(priv_ipv4)
|
||||
|
||||
|
||||
|
|
@ -899,7 +905,7 @@ def test_run_instance_with_specified_private_ipv4():
|
|||
)
|
||||
instance = resp['Instances'][0]
|
||||
instance['SubnetId'].should.equal(subnet_id)
|
||||
instance['PrivateIpAddress'].shoud.equal('192.168.42.5')
|
||||
instance['PrivateIpAddress'].should.equal('192.168.42.5')
|
||||
|
||||
|
||||
@mock_ec2
|
||||
|
|
@ -949,7 +955,7 @@ def test_run_instance_with_nic_autocreated():
|
|||
'test security group #1', 'this is a test security group')
|
||||
security_group2 = conn.create_security_group(
|
||||
'test security group #2', 'this is a test security group')
|
||||
private_ip = "54.0.0.1"
|
||||
private_ip = "10.0.0.1"
|
||||
|
||||
reservation = conn.run_instances('ami-1234abcd', subnet_id=subnet.id,
|
||||
security_groups=[security_group1.name],
|
||||
|
|
|
|||
|
|
@ -126,9 +126,9 @@ def test_route_tables_filters_associations():
|
|||
conn = boto.connect_vpc('the_key', 'the_secret')
|
||||
|
||||
vpc = conn.create_vpc("10.0.0.0/16")
|
||||
subnet1 = conn.create_subnet(vpc.id, "10.0.0.0/18")
|
||||
subnet2 = conn.create_subnet(vpc.id, "10.0.1.0/18")
|
||||
subnet3 = conn.create_subnet(vpc.id, "10.0.2.0/18")
|
||||
subnet1 = conn.create_subnet(vpc.id, "10.0.0.0/24")
|
||||
subnet2 = conn.create_subnet(vpc.id, "10.0.1.0/24")
|
||||
subnet3 = conn.create_subnet(vpc.id, "10.0.2.0/24")
|
||||
route_table1 = conn.create_route_table(vpc.id)
|
||||
route_table2 = conn.create_route_table(vpc.id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue