Skip to content

Commit

Permalink
test: Add import tests for MariaDB clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
adeatcu-ionos committed Nov 11, 2024
1 parent 667962f commit 9ea1dbf
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions ionoscloud/import_dbaas_mariadb_cluster_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//go:build all || dbaas || mariadb

package ionoscloud

import (
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant"
)

func TestAccDbaasMariaDBClusterImportBasic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
},
ExternalProviders: map[string]resource.ExternalProvider{
"random": {
VersionConstraint: "3.4.3",
Source: "hashicorp/random",
},
"time": {
Source: "hashicorp/time",
VersionConstraint: "0.11.1",
},
},
ProtoV6ProviderFactories: testAccProtoV6ProviderFactoriesInternal(t, &testAccProvider),
CheckDestroy: testAccCheckDBaaSMariaDBClusterDestroyCheck,
Steps: []resource.TestStep{
{
Config: mariaDBClusterConfigBasic,
},
{
ResourceName: constant.DBaaSMariaDBClusterResource + "." + constant.DBaaSClusterTestResource,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"credentials"},
},
},
})
}

0 comments on commit 9ea1dbf

Please sign in to comment.