From f4980bf1b5f5d6e4f18cb53714766b9a3e392275 Mon Sep 17 00:00:00 2001 From: Andreas Kyrris Date: Mon, 17 Oct 2016 15:10:17 +0100 Subject: [PATCH] Update test for azurerm_lb_rule id. --- .../azurerm/resource_arm_loadbalancer_rule_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/builtin/providers/azurerm/resource_arm_loadbalancer_rule_test.go b/builtin/providers/azurerm/resource_arm_loadbalancer_rule_test.go index ba6a02016..a692f76c9 100644 --- a/builtin/providers/azurerm/resource_arm_loadbalancer_rule_test.go +++ b/builtin/providers/azurerm/resource_arm_loadbalancer_rule_test.go @@ -2,6 +2,7 @@ package azurerm import ( "fmt" + "os" "testing" "github.com/Azure/azure-sdk-for-go/arm/network" @@ -63,6 +64,12 @@ func TestAccAzureRMLoadBalancerRule_basic(t *testing.T) { ri := acctest.RandInt() lbRuleName := fmt.Sprintf("LbRule-%s", acctest.RandStringFromCharSet(8, acctest.CharSetAlpha)) + testAccPreCheck(t) + subscriptionID := os.Getenv("ARM_SUBSCRIPTION_ID") + lbRule_id := fmt.Sprintf( + "/subscriptions/%s/resourceGroups/acctestrg-%d/providers/Microsoft.Network/loadBalancers/arm-test-loadbalancer-%d/loadBalancingRules/%s", + subscriptionID, ri, ri, lbRuleName) + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -73,6 +80,8 @@ func TestAccAzureRMLoadBalancerRule_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMLoadBalancerExists("azurerm_lb.test", &lb), testCheckAzureRMLoadBalancerRuleExists(lbRuleName, &lb), + resource.TestCheckResourceAttr( + "azurerm_lb_rule.test", "id", lbRule_id), ), }, },