diff --git a/huaweicloud/services/acceptance/acceptance.go b/huaweicloud/services/acceptance/acceptance.go index 1eb04e8d1c..7d90a63bf1 100644 --- a/huaweicloud/services/acceptance/acceptance.go +++ b/huaweicloud/services/acceptance/acceptance.go @@ -111,10 +111,11 @@ var ( HW_RAM_SHARE_INVITATION_ID = os.Getenv("HW_RAM_SHARE_INVITATION_ID") HW_RAM_SHARE_ID = os.Getenv("HW_RAM_SHARE_ID") - HW_RMS_TARGET_ID_FOR_FGS = os.Getenv("HW_RMS_TARGET_ID_FOR_FGS") - HW_RMS_TARGET_ID_FOR_RFS = os.Getenv("HW_RMS_TARGET_ID_FOR_RFS") - HW_RMS_EXCLUDED_ACCOUNT_1 = os.Getenv("HW_RMS_EXCLUDED_ACCOUNT_1") - HW_RMS_EXCLUDED_ACCOUNT_2 = os.Getenv("HW_RMS_EXCLUDED_ACCOUNT_2") + HW_RMS_TARGET_ID_FOR_FGS = os.Getenv("HW_RMS_TARGET_ID_FOR_FGS") + HW_RMS_TARGET_ID_FOR_RFS = os.Getenv("HW_RMS_TARGET_ID_FOR_RFS") + HW_RMS_EXCLUDED_ACCOUNT_1 = os.Getenv("HW_RMS_EXCLUDED_ACCOUNT_1") + HW_RMS_EXCLUDED_ACCOUNT_2 = os.Getenv("HW_RMS_EXCLUDED_ACCOUNT_2") + HW_RMS_RESOURCE_RECORDER_CLOSED = os.Getenv("HW_RMS_RESOURCE_RECORDER_CLOSED") HW_CDN_DOMAIN_NAME = os.Getenv("HW_CDN_DOMAIN_NAME") // `HW_CDN_CERT_DOMAIN_NAME` Configure the domain name environment variable of the certificate type. @@ -1155,6 +1156,13 @@ func TestAccPreCheckRMSExcludedAccounts(t *testing.T) { } } +// lintignore:AT003 +func TestAccPreCheckRMSResourceRecorder(t *testing.T) { + if HW_RMS_RESOURCE_RECORDER_CLOSED == "" { + t.Skip("HW_RMS_RESOURCE_RECORDER_CLOSED must be set for the acceptance tests.") + } +} + // lintignore:AT003 func TestAccPreCheckDms(t *testing.T) { if HW_DMS_ENVIRONMENT == "" { diff --git a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_organizational_assignment_packages_test.go b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_organizational_assignment_packages_test.go index 1f49fcc69e..b285ba2090 100644 --- a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_organizational_assignment_packages_test.go +++ b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_organizational_assignment_packages_test.go @@ -21,6 +21,7 @@ func TestAccDataSourceRmsOrganizationalAssignmentPackages_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.TestAccPreCheck(t) + acceptance.TestAccPreCheckOrganizationsOpen(t) }, ProviderFactories: acceptance.TestAccProviderFactories, Steps: []resource.TestStep{ diff --git a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_advanced_query_test.go b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_advanced_query_test.go index 702ef88ba3..99366b81a3 100644 --- a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_advanced_query_test.go +++ b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_advanced_query_test.go @@ -23,7 +23,7 @@ func TestAccDataSourceAggregatorAdvancedQuery_basic(t *testing.T) { ExternalProviders: map[string]resource.ExternalProvider{ "null": { Source: "hashicorp/null", - VersionConstraint: "3.2.1", + VersionConstraint: "3.2.3", }, }, Steps: []resource.TestStep{ diff --git a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_discovered_resources_test.go b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_discovered_resources_test.go index cdbed5ffbf..f8e172fb8c 100644 --- a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_discovered_resources_test.go +++ b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_discovered_resources_test.go @@ -29,7 +29,7 @@ func TestAccDataSourceAggregatorDiscoveredResources_basic(t *testing.T) { ExternalProviders: map[string]resource.ExternalProvider{ "null": { Source: "hashicorp/null", - VersionConstraint: "3.2.1", + VersionConstraint: "3.2.3", }, }, Steps: []resource.TestStep{ diff --git a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_policy_assignments_test.go b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_policy_assignments_test.go index 91dc159a86..d3f068cc27 100644 --- a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_policy_assignments_test.go +++ b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_policy_assignments_test.go @@ -27,7 +27,7 @@ func TestAccDataSourceAggregatorPolicyAssignments_basic(t *testing.T) { ExternalProviders: map[string]resource.ExternalProvider{ "null": { Source: "hashicorp/null", - VersionConstraint: "3.2.1", + VersionConstraint: "3.2.3", }, }, Steps: []resource.TestStep{ diff --git a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_policy_states_test.go b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_policy_states_test.go index 7cc041ba77..4d550b7d79 100644 --- a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_policy_states_test.go +++ b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_resource_aggregator_policy_states_test.go @@ -30,7 +30,7 @@ func TestAccDataSourceAggregatorPolicyStates_basic(t *testing.T) { ExternalProviders: map[string]resource.ExternalProvider{ "null": { Source: "hashicorp/null", - VersionConstraint: "3.2.1", + VersionConstraint: "3.2.3", }, }, Steps: []resource.TestStep{ diff --git a/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_resource_recorder_test.go b/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_resource_recorder_test.go index 0ed0fc8ab0..2d51ccc040 100644 --- a/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_resource_recorder_test.go +++ b/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_resource_recorder_test.go @@ -55,7 +55,12 @@ func TestAccRecorder_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acceptance.TestAccPreCheck(t) }, + PreCheck: func() { + acceptance.TestAccPreCheck(t) + // Some test cases in RMS require the resource recorder to be enabled. + // Skip this test case during batch execution to ensure other test cases execute smoothly. + acceptance.TestAccPreCheckRMSResourceRecorder(t) + }, ProviderFactories: acceptance.TestAccProviderFactories, CheckDestroy: rc.CheckResourceDestroy(), Steps: []resource.TestStep{ @@ -65,7 +70,7 @@ func TestAccRecorder_basic(t *testing.T) { rc.CheckResourceExists(), resource.TestCheckResourceAttr(rName, "agency_name", "rms_tracker_agency"), resource.TestCheckResourceAttr(rName, "selector.0.all_supported", "false"), - resource.TestCheckResourceAttr(rName, "selector.0.resource_types.#", "5"), + resource.TestCheckResourceAttr(rName, "selector.0.resource_types.#", "8"), resource.TestCheckResourceAttrSet(rName, "obs_channel.0.region"), resource.TestCheckResourceAttrPair(rName, "obs_channel.0.bucket", "huaweicloud_obs_bucket.test", "bucket"), @@ -144,7 +149,11 @@ resource "huaweicloud_rms_resource_recorder" "test" { selector { all_supported = false - resource_types = ["vpc.vpcs", "rds.instances", "dms.kafkas", "dms.rabbitmqs", "dms.queues"] + + resource_types = [ + "vpc.vpcs", "rds.instances", "dms.kafkas", "dms.rabbitmqs", "dms.queues", + "config.trackers", "config.policyAssignments", "config.conformancePacks", + ] } obs_channel { diff --git a/huaweicloud/services/rms/data_source_huaweicloud_rms_assignment_packages.go b/huaweicloud/services/rms/data_source_huaweicloud_rms_assignment_packages.go index 7cf237dc8b..21943147d0 100644 --- a/huaweicloud/services/rms/data_source_huaweicloud_rms_assignment_packages.go +++ b/huaweicloud/services/rms/data_source_huaweicloud_rms_assignment_packages.go @@ -197,7 +197,7 @@ func (w *AssignmentPackagesDSWrapper) listConformancePacksToSchema(body *gjson.R func(varStr gjson.Result) any { return map[string]any{ "var_key": varStr.Get("var_key").Value(), - "var_value": varStr.Get("var_value").Value(), + "var_value": utils.JsonToString(varStr.Get("var_value").Value()), } }, ),