diff --git a/huaweicloud/services/acceptance/acceptance.go b/huaweicloud/services/acceptance/acceptance.go index 70935f34b60..91ba41d300b 100644 --- a/huaweicloud/services/acceptance/acceptance.go +++ b/huaweicloud/services/acceptance/acceptance.go @@ -111,7 +111,8 @@ 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 = os.Getenv("HW_RMS_TARGET_ID") + HW_RMS_TARGET_ID_FOR_FGS = os.Getenv("HW_RMS_TARGET_ID") + HW_RMS_TARGET_ID_FOR_RFS = os.Getenv("HW_RMS_TARGET_ID_FOR_RFS") 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. @@ -1129,9 +1130,16 @@ func TestAccPreCheckRAMSharedPrincipalsQueryFields(t *testing.T) { } // lintignore:AT003 -func TestAccPreCheckRMSTargetID(t *testing.T) { - if HW_RMS_TARGET_ID == "" { - t.Skip("HW_RMS_TARGET_ID must be set for the acceptance tests.") +func TestAccPreCheckRMSTargetIDForFGS(t *testing.T) { + if HW_RMS_TARGET_ID_FOR_FGS == "" { + t.Skip("HW_RMS_TARGET_ID_FOR_FGS must be set for the acceptance tests.") + } +} + +// lintignore:AT003 +func TestAccPreCheckRMSTargetIDForRFS(t *testing.T) { + if HW_RMS_TARGET_ID_FOR_RFS == "" { + t.Skip("HW_RMS_TARGET_ID_FOR_RFS must be set for the acceptance tests.") } } diff --git a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_remediation_execution_statuses_test.go b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_remediation_execution_statuses_test.go index 75c83b5bbd1..72b6beca1ff 100644 --- a/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_remediation_execution_statuses_test.go +++ b/huaweicloud/services/acceptance/rms/data_source_huaweicloud_rms_remediation_execution_statuses_test.go @@ -17,7 +17,7 @@ func TestAccDataSourceRemediationExecutionStatuses_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.TestAccPreCheck(t) - acceptance.TestAccPreCheckRMSTargetID(t) + acceptance.TestAccPreCheckRMSTargetIDForFGS(t) }, ProviderFactories: acceptance.TestAccProviderFactories, Steps: []resource.TestStep{ diff --git a/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_configuration_test.go b/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_configuration_test.go index e6ab5a5ade7..9078d45d4e7 100644 --- a/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_configuration_test.go +++ b/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_configuration_test.go @@ -43,7 +43,7 @@ func TestAccResourceRmsRemediationConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.TestAccPreCheck(t) - acceptance.TestAccPreCheckRMSTargetID(t) + acceptance.TestAccPreCheckRMSTargetIDForRFS(t) }, ProviderFactories: acceptance.TestAccProviderFactories, CheckDestroy: rc.CheckResourceDestroy(), @@ -53,7 +53,7 @@ func TestAccResourceRmsRemediationConfiguration_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( rc.CheckResourceExists(), resource.TestCheckResourceAttr(resourceName, "target_type", "rfs"), - resource.TestCheckResourceAttr(resourceName, "target_id", acceptance.HW_RMS_TARGET_ID), + resource.TestCheckResourceAttr(resourceName, "target_id", acceptance.HW_RMS_TARGET_ID_FOR_RFS), resource.TestCheckResourceAttr(resourceName, "resource_parameter.0.resource_id", "file_prefix"), resource.TestCheckResourceAttr(resourceName, "static_parameter.0.var_key", "bucket_name"), resource.TestCheckResourceAttr(resourceName, "auth_type", "agency"), @@ -68,7 +68,7 @@ func TestAccResourceRmsRemediationConfiguration_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( rc.CheckResourceExists(), resource.TestCheckResourceAttr(resourceName, "target_type", "rfs"), - resource.TestCheckResourceAttr(resourceName, "target_id", acceptance.HW_RMS_TARGET_ID), + resource.TestCheckResourceAttr(resourceName, "target_id", acceptance.HW_RMS_TARGET_ID_FOR_RFS), resource.TestCheckResourceAttr(resourceName, "resource_parameter.0.resource_id", "file_prefix"), resource.TestCheckResourceAttr(resourceName, "static_parameter.0.var_key", "bucket_name"), resource.TestCheckResourceAttr(resourceName, "static_parameter.1.var_key", "compress_type"), @@ -110,7 +110,7 @@ resource "huaweicloud_rms_remediation_configuration" "test" { auth_value = "test_RFS_CTS" maximum_attempts = 5 retry_attempt_seconds = 3600 -}`, testResourceRmsRemediationConfiguration_base(), acceptance.HW_RMS_TARGET_ID) +}`, testResourceRmsRemediationConfiguration_base(), acceptance.HW_RMS_TARGET_ID_FOR_RFS) } func testResourceRmsRemediationConfiguration_update() string { @@ -139,7 +139,7 @@ resource "huaweicloud_rms_remediation_configuration" "test" { auth_value = "test_RFS_CTS" maximum_attempts = 6 retry_attempt_seconds = 60 -}`, testResourceRmsRemediationConfiguration_base(), acceptance.HW_RMS_TARGET_ID) +}`, testResourceRmsRemediationConfiguration_base(), acceptance.HW_RMS_TARGET_ID_FOR_RFS) } func testResourceRmsRemediationConfiguration_base() string { diff --git a/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_exception_test.go b/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_exception_test.go index 25adc053091..f6bffa29125 100644 --- a/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_exception_test.go +++ b/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_exception_test.go @@ -36,7 +36,7 @@ func TestAccResourceRemediationException_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.TestAccPreCheck(t) - acceptance.TestAccPreCheckRMSTargetID(t) + acceptance.TestAccPreCheckRMSTargetIDForFGS(t) }, ProviderFactories: acceptance.TestAccProviderFactories, CheckDestroy: rc.CheckResourceDestroy(), @@ -164,5 +164,5 @@ resource "huaweicloud_rms_remediation_configuration" "test" { provisioner "local-exec" { command = "sleep 10" } -}`, name, acceptance.HW_REGION_NAME, acceptance.HW_RMS_TARGET_ID) +}`, name, acceptance.HW_REGION_NAME, acceptance.HW_RMS_TARGET_ID_FOR_FGS) } diff --git a/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_execution_test.go b/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_execution_test.go index 844f4f7edeb..94c9c6e1151 100644 --- a/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_execution_test.go +++ b/huaweicloud/services/acceptance/rms/resource_huaweicloud_rms_remediation_execution_test.go @@ -15,7 +15,7 @@ func TestAccResourceRemediationExecution_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.TestAccPreCheck(t) - acceptance.TestAccPreCheckRMSTargetID(t) + acceptance.TestAccPreCheckRMSTargetIDForFGS(t) }, ProviderFactories: acceptance.TestAccProviderFactories, CheckDestroy: nil, @@ -33,7 +33,7 @@ func TestAccResourceRemediationExecution_specifyResources(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.TestAccPreCheck(t) - acceptance.TestAccPreCheckRMSTargetID(t) + acceptance.TestAccPreCheckRMSTargetIDForFGS(t) }, ProviderFactories: acceptance.TestAccProviderFactories, CheckDestroy: nil, @@ -142,5 +142,5 @@ resource "huaweicloud_rms_remediation_configuration" "test" { provisioner "local-exec" { command = "sleep 15" } -}`, name, acceptance.HW_REGION_NAME, acceptance.HW_RMS_TARGET_ID) +}`, name, acceptance.HW_REGION_NAME, acceptance.HW_RMS_TARGET_ID_FOR_FGS) }