@@ -4,6 +4,7 @@ package oci
44
55import (
66 "fmt"
7+ "strconv"
78 "strings"
89 "testing"
910 "time"
@@ -145,6 +146,8 @@ func TestDatabaseDbHomeResource_createFromCloudVmCluster(t *testing.T) {
145146 Representation {repType : Required , create : `${oci_database_cloud_vm_cluster.test_cloud_vm_cluster.id}` },
146147 dbHomeRepresentationSourceVmClusterNew )
147148
149+ var resId string
150+
148151 resource .Test (t , resource.TestCase {
149152 PreCheck : func () { testAccPreCheck (t ) },
150153 Providers : map [string ]terraform.ResourceProvider {
@@ -160,6 +163,16 @@ func TestDatabaseDbHomeResource_createFromCloudVmCluster(t *testing.T) {
160163 Check : resource .ComposeAggregateTestCheckFunc (
161164 resource .TestCheckResourceAttr (resourceName , "source" , "VM_CLUSTER_NEW" ),
162165 resource .TestCheckResourceAttrSet (resourceName , "vm_cluster_id" ),
166+
167+ func (s * terraform.State ) (err error ) {
168+ resId , err = fromInstanceState (s , resourceName , "id" )
169+ if isEnableExportCompartment , _ := strconv .ParseBool (getEnvSettingWithDefault ("enable_export_compartment" , "true" )); isEnableExportCompartment {
170+ if errExport := testExportCompartmentWithResourceName (& resId , & compartmentId , resourceName ); errExport != nil {
171+ return errExport
172+ }
173+ }
174+ return err
175+ },
163176 ),
164177 },
165178 // verify resource import
0 commit comments