2017-08-07 17:35:39 +00:00
|
|
|
package google
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
2018-02-23 23:14:24 +00:00
|
|
|
func TestAccContainerNodePool_import(t *testing.T) {
|
2017-10-12 22:07:29 +00:00
|
|
|
t.Parallel()
|
|
|
|
|
2017-08-07 17:35:39 +00:00
|
|
|
resourceName := "google_container_node_pool.np"
|
|
|
|
cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
|
|
|
|
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
|
|
|
|
conf := testAccContainerNodePool_basic(cluster, np)
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckContainerNodePoolDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
resource.TestStep{
|
|
|
|
Config: conf,
|
|
|
|
},
|
|
|
|
|
|
|
|
resource.TestStep{
|
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|