Skip to content

Commit

Permalink
Merge pull request #122 from terraform-providers/fix-tests
Browse files Browse the repository at this point in the history
Fixing the NIC/Subnet tests
  • Loading branch information
tombuildsstuff authored Jun 22, 2017
2 parents 8e99f05 + 0f43a51 commit df207cb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 28 deletions.
6 changes: 3 additions & 3 deletions azurerm/resource_arm_network_interface_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,12 @@ func resourceArmNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e
d.Set("network_security_group_id", resp.NetworkSecurityGroup.ID)
}

d.Set("name", resp.Name)
d.Set("resource_group_name", resGroup)
d.Set("location", azureRMNormalizeLocation(*resp.Location))
d.Set("applied_dns_servers", appliedDNSServers)
d.Set("dns_servers", dnsServers)
d.Set("enable_ip_forwarding", resp.EnableIPForwarding)
d.Set("location", resp.Location)
d.Set("name", resp.Name)
d.Set("resource_group_name", resGroup)

flattenAndSetTags(d, resp.Tags)

Expand Down
41 changes: 19 additions & 22 deletions azurerm/resource_arm_network_interface_card_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ func TestAccAzureRMNetworkInterface_bug7986(t *testing.T) {
{
Config: testAccAzureRMNetworkInterface_bug7986(rInt),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMNetworkInterfaceExists("azurerm_network_interface.test"),
testCheckAzureRMNetworkInterfaceExists("azurerm_network_interface.test1"),
testCheckAzureRMNetworkInterfaceExists("azurerm_network_interface.test2"),
),
},
},
Expand Down Expand Up @@ -505,26 +506,28 @@ resource "azurerm_network_security_group" "test" {
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
security_rule {
name = "test123"
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "*"
destination_address_prefix = "*"
}
tags {
environment = "Production"
}
}
resource "azurerm_network_security_rule" "test" {
name = "test"
priority = 100
resource "azurerm_network_security_rule" "test1" {
name = "test1"
priority = 101
direction = "Outbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "*"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.test.name}"
network_security_group_name = "${azurerm_network_security_group.test.name}"
}
resource "azurerm_network_security_rule" "test2" {
name = "test2"
priority = 102
direction = "Outbound"
access = "Allow"
protocol = "Tcp"
Expand Down Expand Up @@ -552,12 +555,6 @@ resource "azurerm_virtual_network" "test" {
address_space = ["10.0.0.0/16"]
resource_group_name = "${azurerm_resource_group.test.name}"
location = "${azurerm_resource_group.test.location}"
subnet {
name = "second"
address_prefix = "10.0.3.0/24"
security_group = "${azurerm_network_security_group.test.id}"
}
}
resource "azurerm_subnet" "test" {
Expand Down
7 changes: 4 additions & 3 deletions azurerm/resource_arm_subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ func TestAccAzureRMSubnet_bug7986(t *testing.T) {
{
Config: initConfig,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMSubnetExists("azurerm_subnet.test"),
testCheckAzureRMSubnetExists("azurerm_subnet.first"),
testCheckAzureRMSubnetExists("azurerm_subnet.second"),
),
},
},
Expand Down Expand Up @@ -445,7 +446,7 @@ resource "azurerm_subnet" "first" {
}
resource "azurerm_route_table" "second" {
name = "$acctest%d-private-2"
name = "acctest%d-private-2"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
}
Expand All @@ -459,7 +460,7 @@ resource "azurerm_route" "second" {
}
resource "azurerm_subnet" "second" {
name = "acctest%d-private-1"
name = "acctest%d-private-2"
resource_group_name = "${azurerm_resource_group.test.name}"
virtual_network_name = "${azurerm_virtual_network.test.name}"
address_prefix = "10.0.1.0/24"
Expand Down

0 comments on commit df207cb

Please sign in to comment.