-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a problem where counting repetable blocks was incorrect. Also r…
…eported in #194.
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/functional/test_counting_repeatable_argument_blocks/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
provider "aws" { | ||
region = "us-west-2" | ||
access_key = "my-access-key" | ||
secret_key = "my-secret-key" | ||
skip_credentials_validation = true | ||
skip_get_ec2_platforms = true | ||
skip_region_validation = true | ||
skip_requesting_account_id = true | ||
version = "~> 2.43" | ||
} | ||
|
||
resource "aws_instance" "one" { | ||
ami = "ami-6d1c2007" | ||
instance_type = "t2.micro" | ||
|
||
network_interface { | ||
device_index = 1 | ||
network_interface_id = "eth0" | ||
} | ||
} | ||
|
||
resource "aws_instance" "two" { | ||
ami = "ami-6d1c2007" | ||
instance_type = "t2.micro" | ||
|
||
network_interface { | ||
device_index = 1 | ||
network_interface_id = "eth0" | ||
} | ||
|
||
network_interface { | ||
device_index = 2 | ||
network_interface_id = "eth1" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/functional/test_counting_repeatable_argument_blocks/plan.out.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"format_version":"0.1","terraform_version":"0.12.18","planned_values":{"root_module":{"resources":[{"address":"aws_instance.one","mode":"managed","type":"aws_instance","name":"one","provider_name":"aws","schema_version":1,"values":{"ami":"ami-6d1c2007","credit_specification":[],"disable_api_termination":null,"ebs_optimized":null,"get_password_data":false,"iam_instance_profile":null,"instance_initiated_shutdown_behavior":null,"instance_type":"t2.micro","monitoring":null,"network_interface":[{"delete_on_termination":false,"device_index":1,"network_interface_id":"eth0"}],"source_dest_check":null,"tags":null,"timeouts":null,"user_data":null,"user_data_base64":null}},{"address":"aws_instance.two","mode":"managed","type":"aws_instance","name":"two","provider_name":"aws","schema_version":1,"values":{"ami":"ami-6d1c2007","credit_specification":[],"disable_api_termination":null,"ebs_optimized":null,"get_password_data":false,"iam_instance_profile":null,"instance_initiated_shutdown_behavior":null,"instance_type":"t2.micro","monitoring":null,"network_interface":[{"delete_on_termination":false,"device_index":1,"network_interface_id":"eth0"},{"delete_on_termination":false,"device_index":2,"network_interface_id":"eth1"}],"source_dest_check":null,"tags":null,"timeouts":null,"user_data":null,"user_data_base64":null}}]}},"resource_changes":[{"address":"aws_instance.one","mode":"managed","type":"aws_instance","name":"one","provider_name":"aws","change":{"actions":["create"],"before":null,"after":{"ami":"ami-6d1c2007","credit_specification":[],"disable_api_termination":null,"ebs_optimized":null,"get_password_data":false,"iam_instance_profile":null,"instance_initiated_shutdown_behavior":null,"instance_type":"t2.micro","monitoring":null,"network_interface":[{"delete_on_termination":false,"device_index":1,"network_interface_id":"eth0"}],"source_dest_check":null,"tags":null,"timeouts":null,"user_data":null,"user_data_base64":null},"after_unknown":{"arn":true,"associate_public_ip_address":true,"availability_zone":true,"cpu_core_count":true,"cpu_threads_per_core":true,"credit_specification":[],"ebs_block_device":true,"ephemeral_block_device":true,"host_id":true,"id":true,"instance_state":true,"ipv6_address_count":true,"ipv6_addresses":true,"key_name":true,"network_interface":[{}],"network_interface_id":true,"password_data":true,"placement_group":true,"primary_network_interface_id":true,"private_dns":true,"private_ip":true,"public_dns":true,"public_ip":true,"root_block_device":true,"security_groups":true,"subnet_id":true,"tenancy":true,"volume_tags":true,"vpc_security_group_ids":true}}},{"address":"aws_instance.two","mode":"managed","type":"aws_instance","name":"two","provider_name":"aws","change":{"actions":["create"],"before":null,"after":{"ami":"ami-6d1c2007","credit_specification":[],"disable_api_termination":null,"ebs_optimized":null,"get_password_data":false,"iam_instance_profile":null,"instance_initiated_shutdown_behavior":null,"instance_type":"t2.micro","monitoring":null,"network_interface":[{"delete_on_termination":false,"device_index":1,"network_interface_id":"eth0"},{"delete_on_termination":false,"device_index":2,"network_interface_id":"eth1"}],"source_dest_check":null,"tags":null,"timeouts":null,"user_data":null,"user_data_base64":null},"after_unknown":{"arn":true,"associate_public_ip_address":true,"availability_zone":true,"cpu_core_count":true,"cpu_threads_per_core":true,"credit_specification":[],"ebs_block_device":true,"ephemeral_block_device":true,"host_id":true,"id":true,"instance_state":true,"ipv6_address_count":true,"ipv6_addresses":true,"key_name":true,"network_interface":[{},{}],"network_interface_id":true,"password_data":true,"placement_group":true,"primary_network_interface_id":true,"private_dns":true,"private_ip":true,"public_dns":true,"public_ip":true,"root_block_device":true,"security_groups":true,"subnet_id":true,"tenancy":true,"volume_tags":true,"vpc_security_group_ids":true}}}],"configuration":{"provider_config":{"aws":{"name":"aws","version_constraint":"~\u003e 2.43","expressions":{"access_key":{"constant_value":"my-access-key"},"region":{"constant_value":"us-west-2"},"secret_key":{"constant_value":"my-secret-key"},"skip_credentials_validation":{"constant_value":true},"skip_get_ec2_platforms":{"constant_value":true},"skip_region_validation":{"constant_value":true},"skip_requesting_account_id":{"constant_value":true}}}},"root_module":{"resources":[{"address":"aws_instance.one","mode":"managed","type":"aws_instance","name":"one","provider_config_key":"aws","expressions":{"ami":{"constant_value":"ami-6d1c2007"},"instance_type":{"constant_value":"t2.micro"},"network_interface":[{"device_index":{"constant_value":1},"network_interface_id":{"constant_value":"eth0"}}]},"schema_version":1},{"address":"aws_instance.two","mode":"managed","type":"aws_instance","name":"two","provider_config_key":"aws","expressions":{"ami":{"constant_value":"ami-6d1c2007"},"instance_type":{"constant_value":"t2.micro"},"network_interface":[{"device_index":{"constant_value":1},"network_interface_id":{"constant_value":"eth0"}},{"device_index":{"constant_value":2},"network_interface_id":{"constant_value":"eth1"}}]},"schema_version":1}]}}} |
15 changes: 15 additions & 0 deletions
15
tests/functional/test_counting_repeatable_argument_blocks/test.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Count bug | ||
|
||
Scenario: Ensure one network is attached to one | ||
Given I have aws_instance defined | ||
When its name is one | ||
And it contains network_interface | ||
And I count them | ||
Then I expect the result is equal to 1 | ||
|
||
Scenario: Ensure two networks are attached to two | ||
Given I have aws_instance defined | ||
When its name is two | ||
And it contains network_interface | ||
And I count them | ||
Then I expect the result is equal to 2 |