diff --git a/huaweicloud/services/acceptance/acceptance.go b/huaweicloud/services/acceptance/acceptance.go index 030e986644..42e4e64f7d 100644 --- a/huaweicloud/services/acceptance/acceptance.go +++ b/huaweicloud/services/acceptance/acceptance.go @@ -224,7 +224,7 @@ var ( HW_WORKSPACE_APP_SERVER_GROUP_IMAGE_PRODUCT_ID = os.Getenv("HW_WORKSPACE_APP_SERVER_GROUP_IMAGE_PRODUCT_ID") HW_WORKSPACE_APP_SERVER_GROUP_IMAGE_SPEC_CODE = os.Getenv("HW_WORKSPACE_APP_SERVER_GROUP_IMAGE_SPEC_CODE") HW_WORKSPACE_OU_NAME = os.Getenv("HW_WORKSPACE_OU_NAME") - HW_WORKSPACE_APP_FILE_STRORE_OBS_PATH = os.Getenv("HW_WORKSPACE_APP_FILE_STRORE_OBS_PATH") + HW_WORKSPACE_APP_FILE_NAME = os.Getenv("HW_WORKSPACE_APP_FILE_NAME") HW_WORKSPACE_USER_NAMES = os.Getenv("HW_WORKSPACE_USER_NAMES") HW_FGS_AGENCY_NAME = os.Getenv("HW_FGS_AGENCY_NAME") @@ -1581,9 +1581,9 @@ func TestAccPreCheckWorkspaceOUName(t *testing.T) { } // lintignore:AT003 -func TestAccPreCheckWorkspaceFileStorePath(t *testing.T) { - if HW_WORKSPACE_APP_FILE_STRORE_OBS_PATH == "" { - t.Skip("HW_WORKSPACE_APP_FILE_STRORE_OBS_PATH must be set for Workspace service acceptance tests.") +func TestAccPreCheckWorkspaceAppFileName(t *testing.T) { + if HW_WORKSPACE_APP_FILE_NAME == "" { + t.Skip("HW_WORKSPACE_APP_FILE_NAME must be set for Workspace service acceptance tests.") } } diff --git a/huaweicloud/services/acceptance/workspace/resource_huaweicloud_workspace_app_warehouse_app_test.go b/huaweicloud/services/acceptance/workspace/resource_huaweicloud_workspace_app_warehouse_app_test.go index 25d668c096..b8e057b1b7 100644 --- a/huaweicloud/services/acceptance/workspace/resource_huaweicloud_workspace_app_warehouse_app_test.go +++ b/huaweicloud/services/acceptance/workspace/resource_huaweicloud_workspace_app_warehouse_app_test.go @@ -36,10 +36,16 @@ func TestAccAppWarehouseApp_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.TestAccPreCheck(t) - acceptance.TestAccPreCheckWorkspaceFileStorePath(t) + acceptance.TestAccPreCheckWorkspaceAppFileName(t) }, ProviderFactories: acceptance.TestAccProviderFactories, - CheckDestroy: rc.CheckResourceDestroy(), + ExternalProviders: map[string]resource.ExternalProvider{ + "null": { + Source: "hashicorp/null", + VersionConstraint: "3.2.1", + }, + }, + CheckDestroy: rc.CheckResourceDestroy(), Steps: []resource.TestStep{ { Config: testAccWarehouseApp_basic_step1(name), @@ -50,7 +56,7 @@ func TestAccAppWarehouseApp_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "os_type", "Windows"), resource.TestCheckResourceAttr(resourceName, "version", "1.0"), resource.TestCheckResourceAttr(resourceName, "version_name", "terraform"), - resource.TestCheckResourceAttr(resourceName, "file_store_path", acceptance.HW_WORKSPACE_APP_FILE_STRORE_OBS_PATH), + resource.TestCheckResourceAttr(resourceName, "file_store_path", acceptance.HW_WORKSPACE_APP_FILE_NAME), resource.TestCheckResourceAttr(resourceName, "description", "Created by script"), ), }, @@ -78,30 +84,77 @@ func TestAccAppWarehouseApp_basic(t *testing.T) { }) } +func executionFileUploadResourcesConfig() string { + return fmt.Sprintf(` +variable "script_content" { + type = string + default = <