Update test for azurerm_lb_nat_pool id.
This commit is contained in:
parent
f4980bf1b5
commit
4bf1985453
|
@ -2,6 +2,7 @@ package azurerm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/arm/network"
|
"github.com/Azure/azure-sdk-for-go/arm/network"
|
||||||
|
@ -15,6 +16,12 @@ func TestAccAzureRMLoadBalancerNatPool_basic(t *testing.T) {
|
||||||
ri := acctest.RandInt()
|
ri := acctest.RandInt()
|
||||||
natPoolName := fmt.Sprintf("NatPool-%d", ri)
|
natPoolName := fmt.Sprintf("NatPool-%d", ri)
|
||||||
|
|
||||||
|
testAccPreCheck(t)
|
||||||
|
subscriptionID := os.Getenv("ARM_SUBSCRIPTION_ID")
|
||||||
|
natPool_id := fmt.Sprintf(
|
||||||
|
"/subscriptions/%s/resourceGroups/acctestrg-%d/providers/Microsoft.Network/loadBalancers/arm-test-loadbalancer-%d/inboundNatPools/%s",
|
||||||
|
subscriptionID, ri, ri, natPoolName)
|
||||||
|
|
||||||
resource.Test(t, resource.TestCase{
|
resource.Test(t, resource.TestCase{
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
|
@ -25,6 +32,8 @@ func TestAccAzureRMLoadBalancerNatPool_basic(t *testing.T) {
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testCheckAzureRMLoadBalancerExists("azurerm_lb.test", &lb),
|
testCheckAzureRMLoadBalancerExists("azurerm_lb.test", &lb),
|
||||||
testCheckAzureRMLoadBalancerNatPoolExists(natPoolName, &lb),
|
testCheckAzureRMLoadBalancerNatPoolExists(natPoolName, &lb),
|
||||||
|
resource.TestCheckResourceAttr(
|
||||||
|
"azurerm_lb_nat_pool.test", "id", natPool_id),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue