github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/azurerm/import_arm_network_security_rule_test.go (about)

     1  package azurerm
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/terraform/helper/acctest"
     7  	"github.com/hashicorp/terraform/helper/resource"
     8  )
     9  
    10  func TestAccAzureRMNetworkSecurityRule_importBasic(t *testing.T) {
    11  	rInt := acctest.RandInt()
    12  	resourceName := "azurerm_network_security_rule.test"
    13  
    14  	resource.Test(t, resource.TestCase{
    15  		PreCheck:     func() { testAccPreCheck(t) },
    16  		Providers:    testAccProviders,
    17  		CheckDestroy: testCheckAzureRMNetworkSecurityRuleDestroy,
    18  		Steps: []resource.TestStep{
    19  			resource.TestStep{
    20  				Config: testAccAzureRMNetworkSecurityRule_basic(rInt),
    21  			},
    22  
    23  			resource.TestStep{
    24  				ResourceName:            resourceName,
    25  				ImportState:             true,
    26  				ImportStateVerify:       true,
    27  				ImportStateVerifyIgnore: []string{"network_security_group_name"},
    28  			},
    29  		},
    30  	})
    31  }