2017-04-28 06:44:37 +02:00
|
|
|
package google
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccComputeRoute_importBasic(t *testing.T) {
|
|
|
|
resourceName := "google_compute_network.foobar"
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
2017-04-28 07:37:12 +02:00
|
|
|
CheckDestroy: testAccCheckComputeRouteDestroy,
|
2017-04-28 06:44:37 +02:00
|
|
|
Steps: []resource.TestStep{
|
|
|
|
{
|
|
|
|
Config: testAccComputeRoute_basic,
|
2017-05-04 18:17:25 +02:00
|
|
|
},
|
|
|
|
{
|
2017-04-28 06:44:37 +02:00
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestAccComputeRoute_importDefaultInternetGateway(t *testing.T) {
|
|
|
|
resourceName := "google_compute_network.foobar"
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
2017-04-28 07:37:12 +02:00
|
|
|
CheckDestroy: testAccCheckComputeRouteDestroy,
|
2017-04-28 06:44:37 +02:00
|
|
|
Steps: []resource.TestStep{
|
|
|
|
{
|
|
|
|
Config: testAccComputeRoute_defaultInternetGateway,
|
2017-05-04 18:17:25 +02:00
|
|
|
},
|
|
|
|
{
|
2017-04-28 06:44:37 +02:00
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|