mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-20 11:48:24 -06:00
* Terraform ProfitBricks Builder * make fmt * Merge remote-tracking branch 'upstream/master' into terraform-provider-profitbricks # Conflicts: # command/internal_plugin_list.go * Addressing PR remarks * Removed importers * Added ProfitBricks Data Sources * Added documentation * Updated to REST v3: - nat parameter for Nics - availabilityZone for Volumes Minor code clean up * Minor code clean up * Fixed typo in volume documentation * make fmt * Addressing requested changes * Added a step in load balancer tests in CheckDestroy where we are making sure that the test doesn't leave dangling resources in ProfitBricks * Changed expected image name * Fixed data center test Code clean up
49 lines
1.1 KiB
Go
49 lines
1.1 KiB
Go
package profitbricks
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
"testing"
|
|
)
|
|
|
|
func TestAccDataSourceDatacenter_matching(t *testing.T) {
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() {
|
|
testAccPreCheck(t)
|
|
},
|
|
Providers: testAccProviders,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
|
|
Config: testAccDataSourceProfitBricksDataCenter_matching,
|
|
},
|
|
{
|
|
|
|
Config: testAccDataSourceProfitBricksDataCenter_matchingWithDataSource,
|
|
Check: resource.ComposeTestCheckFunc(
|
|
resource.TestCheckResourceAttr("data.profitbricks_datacenter.foobar", "name", "test_name"),
|
|
resource.TestCheckResourceAttr("data.profitbricks_datacenter.foobar", "location", "us/las"),
|
|
),
|
|
},
|
|
},
|
|
})
|
|
|
|
}
|
|
|
|
const testAccDataSourceProfitBricksDataCenter_matching = `
|
|
resource "profitbricks_datacenter" "foobar" {
|
|
name = "test_name"
|
|
location = "us/las"
|
|
}
|
|
`
|
|
|
|
const testAccDataSourceProfitBricksDataCenter_matchingWithDataSource = `
|
|
resource "profitbricks_datacenter" "foobar" {
|
|
name = "test_name"
|
|
location = "us/las"
|
|
}
|
|
|
|
data "profitbricks_datacenter" "foobar" {
|
|
name = "${profitbricks_datacenter.foobar.name}"
|
|
location = "us/las"
|
|
}`
|