Commit Graph

327 Commits

Author SHA1 Message Date
Jon Beilke
c1ebec1b35 remove start_time from attrib comparison in test_copy_snapshot() 2018-10-08 10:17:51 -05:00
hans
cedb89dc3b Fix #1830 Add support for cross-region VPC peering
Add a class level store in models/VPCBackend of ec2
for saving vpcs of all regions info. Any instance can correctly find vpc in another region
when connecting vpc of cross-region or vpc of same region.

Modify vpc_peering_connections in ec2/responses to handle
vpc peering of same region or cross region.

Update vpc_peering_connections response
template content to latest (2016-11-15) .

Add vpc cross region peering successful test case.
Add vpc cross region peering fail test case.

Related: https://github.com/spulec/moto/issues/1830

Reference
CreateVpcPeeringConnection Sample Response
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVpcPeeringConnection.html
2018-09-21 23:29:04 +08:00
Gary Donovan
2e5e7e7f5e Fix typo in test name (#1729) 2018-07-24 23:11:04 +01:00
Steve Pulec
b26d233820
Merge pull request #1565 from spulec/fix-1522
Fix security group rules for single rule case. Closes #1522.
2018-06-08 17:58:30 -04:00
Steve Pulec
96aba00242 Add freeze_time for ebs test. 2018-05-30 20:39:37 -04:00
zane
12188733b7 adding Address reallocate capability for EIP 2018-05-10 23:39:19 -07:00
Phil Christensen
ae2650ffc7 copy snapshot unit test 2018-04-15 17:08:54 -04:00
Steve Pulec
af8697c9a7 Fix security group rules for single rule case. Closes #1522. 2018-04-13 15:03:07 -04:00
Tom Elliff
e2af8bc836 Allow tagging snapshots on creation
Largely copying what was done for volume creation in https://github.com/spulec/moto/pull/1432
2018-04-04 17:46:51 +01:00
Rob Walker
4b3469292a Enable Extended CIDR Associations on VPC (#1511)
* Enable Extended CIDR Associations on VPC

* Ooops missed the utils, try to be more flakey?, remove unnecessary part in tests

* try to be even more flakey
2018-03-21 09:10:38 -07:00
keirbadger
fecdf388c2 Add in filtering of EBS volumes on availability-zone (#1468) 2018-03-21 08:58:32 -07:00
Graham Lyons
5d51329c34 Don't create volumes for AMIs (#1456)
* Delete the volume used during AMI creation

Creating an AMI doesn't actually result in the creation of an EBS
volume, although the associated snapshot does reference one. To that
end, delete the volume once we've used it.

* Add `owner_id` to `Snapshot`, verify AMI snapshots

The default AMIs which are created by moto have EBS volume mappings
but the snapshots associated with those don't have the correct
owners set.

This adds the owner to the snapshot model and passes it through from
the JSON data.
2018-03-21 08:55:58 -07:00
Steve Pulec
924c99bcea
Merge pull request #1448 from grahamlyons/fix-ebs-tagging
Change `'image'` for `'volume'` when getting tags
2018-03-06 22:16:59 -05:00
Steve Pulec
6826b82cfb
Merge pull request #1455 from grahamlyons/snapshot-search-bug
Snapshot search bug
2018-03-06 22:06:33 -05:00
Hugo Lopes Tavares
5f61950096 Make SpotPrice optional when requesting a spot fleet
When price is omitted, AWS will default to the on-demand price
2018-02-01 18:07:35 -05:00
grahamlyons
f3debf8f6f Test and fix bug for snapshot searching
The logic which contructed a list of values for parameters with
multiple values was flawed in that e.g. `Subnet.1` and `Subnet.10`
would be have their values counted against `Subnet.1` because they
share a prefix.

This now checks for a starting `.` before counting that name as
having the requested prefix.
2018-01-29 14:30:21 +00:00
grahamlyons
3ce57644cd Change 'image' for 'volume' when getting tags
The AWS docs say that: "Currently, the resource types that support
tagging on creation are instance and volume." Calling `create_volume`
and passing `image` as the resource type in tag specifications causes
an `InvalidParameterValue` error.
2018-01-26 11:12:50 +00:00
Jack Danger
4520cd930f
Merge pull request #1378 from william-richard/start-running-ami-tests
Make test_amis not executable, so nose runs it
2018-01-24 18:28:40 -08:00
dbfr3qs
597676c59c add tags when creating ebs volume 2018-01-15 21:52:32 +13:00
William Richard
09c5407b86
Fix tests that were introduced in PR #1398 2018-01-11 15:02:03 -05:00
William Richard
e0d4728c5d
Fix ami tests
- missing and malformed image ids
- test_ami_filters

- test_ami_copy tests

- test_ami_create_and_delete test

- test_ami_filter_wildcard test

- the rest of the tests by using the non-deprecated mock_ec2
2018-01-11 15:02:01 -05:00
William Richard
00a4249b74
Make test_amis not executable, so nose runs it
In trying to debug changes to the ami mock introduced in 1.1.25,
I noticed that the ami tests were not running.  Turns out that nose does not
run test files that are executable.

http://nose.readthedocs.io/en/latest/finding_tests.html

The ami test file was the only test file I could find that had the executable bit set.
2018-01-11 15:00:38 -05:00
Nuwan Goonasekera
56ce26a728 Added support for filtering AMIs by self (#1398)
* Added support for filtering AMIs by self

Closes: https://github.com/spulec/moto/issues/1396

* Adjusted regex to also match signature v4 and fixed py3 compatibility
2018-01-04 10:01:17 +00:00
Gordon Irving
4d9833b972 add test for descrie_regions with args 2017-12-28 21:02:58 +00:00
Nuwan Goonasekera
c68cd650e7 Make sure invalid or malformed AMIs raise an exception
Closes: https://github.com/spulec/moto/issues/1408
2017-12-22 18:50:22 +05:30
Archa91
474023f9a1 fix EC2 instances ebsOptimized not handled (#1340)
* fix EC2 instances ebsOptimized not handled

* add test_create_instance_ebs_optimized
2017-11-14 14:31:54 +00:00
Terry Cain
bd8c1e4567
adding owner id to amis v2 (#1331)
* Adding owner-id/OwnerId to the AMI classes to allow the value to be specified to test filtering images based on owner.

* Added default AMIs and filtering by owner-id

* Fixed some tests

* Fixed more random tests

* Updated MANIFEST

* .
2017-11-12 11:18:25 +00:00
Terry Cain
9ddf7fe436
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
2017-10-25 19:29:56 +01:00
Terry Cain
5b0e463554
Fixed a few ip issues
Fixes #1175
2017-10-24 23:57:43 +01:00
Terry Cain
f3623e3cd3 Fix for #1258 (#1260)
* Fix for #1258

* Updated doc link
2017-10-12 13:59:02 -07:00
William Johansson
88fb732302 Support wildcard tag filters on SecurityGroups 2017-10-06 21:55:01 +02:00
David Morrison
fa3268b7b7 fix tests 2017-10-06 08:07:21 -07:00
David Morrison
3d3d0e916e minor bugfixes and added tests 2017-10-05 18:46:58 -07:00
David Morrison
8ca7ccfcb5 add support for the modify_spot_fleet_request operation 2017-10-05 12:50:42 -07:00
Nuwan Goonasekera
5b01071bd4 Fix for regression in get_console_output() 2017-09-27 20:26:45 +05:30
Nuwan Goonasekera
ca56955a97 Added invalid id exceptions when filtering vpcs and subnets 2017-09-18 23:38:39 +05:30
Nuwan Goonasekera
08c4eff0b2 Added invalid id exceptions when filtering snapshots and volumes 2017-09-18 23:38:04 +05:30
Nuwan Goonasekera
298772ca92 Raise InvalidGroup.NotFound in DescribeSecurityGroups 2017-09-18 19:51:01 +05:30
Nuwan Goonasekera
0953ddde51 Fix for instance public ip not being cleared on eip disassociation 2017-09-16 12:26:43 +05:30
Jack Danger
b3ce255eee Merge pull request #1148 from gvlproject/vpc_address_filtering
Improved support for VPC Address filtering
2017-09-15 14:22:21 -07:00
Nuwan Goonasekera
8776129816 Improved support for VPC Address filtering 2017-09-16 01:49:57 +05:30
Nuwan Goonasekera
c116c57eb8 Ensure root device is listed in block device mappings 2017-09-15 21:30:32 +05:30
Nuwan Goonasekera
d0c610c5ac Added keypair filtering 2017-09-14 14:59:13 +05:30
Jack Danger
d2a234f75d falling back to use nic' 2017-09-08 16:30:21 -07:00
Jack Danger
5a03497367 rendering vpc_id in ec2 responses 2017-09-08 15:07:44 -07:00
Daniel Lutsch
1f6b1b8c4a Add list support to filters (#1083)
* initial pass with TODOs

* add list support to get_object_value

* fix group-id filters

* add tests for sg name and id filters
2017-08-25 23:43:29 -07:00
Daniel Lutsch
945b984538 Add private-dns-name filter and fix regional DNS (#1076)
* add private-dns-name to filter_dict_attribute_mapping

* add region_name attribute to Instance and InstanceResponse

* set dns name based on region

* test private-dns-name and network-interface.private-dns-name filters. checking both regional dns formats

* update test_ec2_classic_has_public_ip_address to use correct dns values
2017-08-23 01:39:50 -07:00
Christian Hellman
63b09eae13 Added DescribeAccountAttributes 2017-07-17 23:33:40 +00:00
Jeff Hardy
4e2f775c1f Use region list from Boto.
Boto can be configured with extra regions, but moto will fail to import
if they are not in the hardcoded list in ec2/models.py. Instead, use the
region list from boto to build the ec2_backends dict to ensure all
regions are available.
2017-05-26 12:47:28 -07:00
Jerome Bosman
b6d9b4f584 Replace and delete Network ACL Entries 2017-05-14 13:03:43 +01:00