Skip to content

Commit

Permalink
test(instance): add test on server import (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerome-quere authored Dec 5, 2019
1 parent b65a268 commit 8abd795
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scaleway/resource_instance_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,30 @@ func TestAccScalewayInstanceServerIpv6(t *testing.T) {
})
}

func TestAccScalewayInstanceServerImport(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckScalewayInstanceServerDestroy,
Steps: []resource.TestStep{
{
Config: `
resource "scaleway_instance_server" "server01" {
type = "DEV1-S"
image = "f974feac-abae-4365-b988-8ec7d1cec10d"
state = "stopped"
}
`,
},
{
ResourceName: "scaleway_instance_server.server01",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccCheckScalewayInstanceServerExists(n string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
Expand Down

0 comments on commit 8abd795

Please sign in to comment.