Update test for azurerm_lb_rule id.

This commit is contained in:
Andreas Kyrris 2016-10-17 15:10:17 +01:00
parent c1d4397673
commit f4980bf1b5
1 changed files with 9 additions and 0 deletions

View File

@ -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"
@ -63,6 +64,12 @@ func TestAccAzureRMLoadBalancerRule_basic(t *testing.T) {
ri := acctest.RandInt() ri := acctest.RandInt()
lbRuleName := fmt.Sprintf("LbRule-%s", acctest.RandStringFromCharSet(8, acctest.CharSetAlpha)) 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{ resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders, Providers: testAccProviders,
@ -73,6 +80,8 @@ func TestAccAzureRMLoadBalancerRule_basic(t *testing.T) {
Check: resource.ComposeTestCheckFunc( Check: resource.ComposeTestCheckFunc(
testCheckAzureRMLoadBalancerExists("azurerm_lb.test", &lb), testCheckAzureRMLoadBalancerExists("azurerm_lb.test", &lb),
testCheckAzureRMLoadBalancerRuleExists(lbRuleName, &lb), testCheckAzureRMLoadBalancerRuleExists(lbRuleName, &lb),
resource.TestCheckResourceAttr(
"azurerm_lb_rule.test", "id", lbRule_id),
), ),
}, },
}, },