2017-02-02 14:26:14 +01:00
|
|
|
package profitbricks
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccDataSourceImage_basic(t *testing.T) {
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() {
|
|
|
|
testAccPreCheck(t)
|
|
|
|
},
|
|
|
|
Providers: testAccProviders,
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
{
|
|
|
|
|
|
|
|
Config: testAccDataSourceProfitBricksImage_basic,
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
resource.TestCheckResourceAttr("data.profitbricks_image.img", "location", "us/las"),
|
2017-05-03 21:29:03 +02:00
|
|
|
resource.TestCheckResourceAttr("data.profitbricks_image.img", "name", "Ubuntu-16.04-LTS-server-2017-05-01"),
|
2017-02-02 14:26:14 +01:00
|
|
|
resource.TestCheckResourceAttr("data.profitbricks_image.img", "type", "HDD"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const testAccDataSourceProfitBricksImage_basic = `
|
|
|
|
data "profitbricks_image" "img" {
|
|
|
|
name = "Ubuntu"
|
|
|
|
type = "HDD"
|
|
|
|
version = "16"
|
|
|
|
location = "us/las"
|
|
|
|
}
|
|
|
|
`
|