diff --git a/flexibleengine/acceptance/acceptance.go b/flexibleengine/acceptance/acceptance.go index 265460d8..c2136235 100644 --- a/flexibleengine/acceptance/acceptance.go +++ b/flexibleengine/acceptance/acceptance.go @@ -15,12 +15,12 @@ import ( ) var ( - OS_DEPRECATED_ENVIRONMENT = os.Getenv("OS_DEPRECATED_ENVIRONMENT") - OS_AVAILABILITY_ZONE = os.Getenv("OS_AVAILABILITY_ZONE") - OS_REGION_NAME = os.Getenv("OS_REGION_NAME") - OS_ACCESS_KEY = os.Getenv("OS_ACCESS_KEY") - OS_SECRET_KEY = os.Getenv("OS_SECRET_KEY") - OS_PROJECT_ID = os.Getenv("OS_PROJECT_ID") + OS_DEPRECATED_ENVIRONMENT = os.Getenv("OS_DEPRECATED_ENVIRONMENT") + OS_AVAILABILITY_ZONE = os.Getenv("OS_AVAILABILITY_ZONE") + OS_REGION_NAME = os.Getenv("OS_REGION_NAME") + OS_ACCESS_KEY = os.Getenv("OS_ACCESS_KEY") + OS_SECRET_KEY = os.Getenv("OS_SECRET_KEY") + OS_PROJECT_ID = os.Getenv("OS_PROJECT_ID") OS_VPC_ID = os.Getenv("OS_VPC_ID") OS_NETWORK_ID = os.Getenv("OS_NETWORK_ID") diff --git a/flexibleengine/acceptance/data_source_flexibleengine_dms_maintainwindow_test.go b/flexibleengine/acceptance/data_source_flexibleengine_dms_maintainwindow_test.go new file mode 100644 index 00000000..bd5e37d9 --- /dev/null +++ b/flexibleengine/acceptance/data_source_flexibleengine_dms_maintainwindow_test.go @@ -0,0 +1,35 @@ +package acceptance + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance" +) + +func TestAccDmsMaintainWindowDataSource_basic(t *testing.T) { + dataSourceName := "data.flexibleengine_dms_maintainwindow.maintainwindow1" + dc := acceptance.InitDataSourceCheck(dataSourceName) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: TestAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccDmsMaintainWindowDataSource_basic, + Check: resource.ComposeTestCheckFunc( + dc.CheckResourceExists(), + resource.TestCheckResourceAttr(dataSourceName, "seq", "1"), + resource.TestCheckResourceAttr(dataSourceName, "begin", "22:00:00"), + ), + }, + }, + }) +} + +var testAccDmsMaintainWindowDataSource_basic = ` +data "flexibleengine_dms_maintainwindow" "maintainwindow1" { + seq = 1 +} +` diff --git a/flexibleengine/provider.go b/flexibleengine/provider.go index 6be2041f..6bdfdc30 100644 --- a/flexibleengine/provider.go +++ b/flexibleengine/provider.go @@ -296,6 +296,7 @@ func Provider() *schema.Provider { "flexibleengine_dms_kafka_instances": dms.DataSourceDmsKafkaInstances(), "flexibleengine_dms_rocketmq_broker": dms.DataSourceDmsRocketMQBroker(), "flexibleengine_dms_rocketmq_instances": dms.DataSourceDmsRocketMQInstances(), + "flexibleengine_dms_maintainwindow": dms.DataSourceDmsMaintainWindow(), "flexibleengine_dws_flavors": dws.DataSourceDwsFlavors(), "flexibleengine_elb_certificate": elb.DataSourceELBCertificateV3(),