Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/datasync: Add ErrorCheck #18231

Merged
merged 7 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aws/resource_aws_datasync_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func TestAccAWSDataSyncAgent_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncAgentDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -109,6 +110,7 @@ func TestAccAWSDataSyncAgent_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncAgentDestroy,
Steps: []resource.TestStep{
Expand All @@ -132,6 +134,7 @@ func TestAccAWSDataSyncAgent_AgentName(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncAgentDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -165,6 +168,7 @@ func TestAccAWSDataSyncAgent_Tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncAgentDestroy,
Steps: []resource.TestStep{
Expand Down
4 changes: 4 additions & 0 deletions aws/resource_aws_datasync_location_efs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func TestAccAWSDataSyncLocationEfs_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationEfsDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -119,6 +120,7 @@ func TestAccAWSDataSyncLocationEfs_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationEfsDestroy,
Steps: []resource.TestStep{
Expand All @@ -140,6 +142,7 @@ func TestAccAWSDataSyncLocationEfs_Subdirectory(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationEfsDestroy,
Steps: []resource.TestStep{
Expand All @@ -166,6 +169,7 @@ func TestAccAWSDataSyncLocationEfs_Tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationEfsDestroy,
Steps: []resource.TestStep{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func TestAccAWSDataSyncLocationFsxWindows_basic(t *testing.T) {
testAccPartitionHasServicePreCheck(fsx.EndpointsID, t)
testAccPreCheckAWSDataSync(t)
},
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationFsxWindowsDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -125,6 +126,7 @@ func TestAccAWSDataSyncLocationFsxWindows_disappears(t *testing.T) {
testAccPartitionHasServicePreCheck(fsx.EndpointsID, t)
testAccPreCheckAWSDataSync(t)
},
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationFsxWindowsDestroy,
Steps: []resource.TestStep{
Expand All @@ -150,6 +152,7 @@ func TestAccAWSDataSyncLocationFsxWindows_subdirectory(t *testing.T) {
testAccPartitionHasServicePreCheck(fsx.EndpointsID, t)
testAccPreCheckAWSDataSync(t)
},
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationFsxWindowsDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -181,6 +184,7 @@ func TestAccAWSDataSyncLocationFsxWindows_tags(t *testing.T) {
testAccPartitionHasServicePreCheck(fsx.EndpointsID, t)
testAccPreCheckAWSDataSync(t)
},
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationFsxWindowsDestroy,
Steps: []resource.TestStep{
Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_datasync_location_nfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func TestAccAWSDataSyncLocationNfs_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -119,6 +120,7 @@ func TestAccAWSDataSyncLocationNfs_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy,
Steps: []resource.TestStep{
Expand All @@ -141,6 +143,7 @@ func TestAccAWSDataSyncLocationNfs_AgentARNs_Multple(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -169,6 +172,7 @@ func TestAccAWSDataSyncLocationNfs_Subdirectory(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -196,6 +200,7 @@ func TestAccAWSDataSyncLocationNfs_Tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy,
Steps: []resource.TestStep{
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_datasync_location_s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func TestAccAWSDataSyncLocationS3_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationS3Destroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -121,6 +122,7 @@ func TestAccAWSDataSyncLocationS3_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationS3Destroy,
Steps: []resource.TestStep{
Expand All @@ -143,6 +145,7 @@ func TestAccAWSDataSyncLocationS3_Tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationS3Destroy,
Steps: []resource.TestStep{
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_datasync_location_smb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func TestAccAWSDataSyncLocationSmb_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationSmbDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -121,6 +122,7 @@ func TestAccAWSDataSyncLocationSmb_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationSmbDestroy,
Steps: []resource.TestStep{
Expand All @@ -143,6 +145,7 @@ func TestAccAWSDataSyncLocationSmb_Tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncLocationSmbDestroy,
Steps: []resource.TestStep{
Expand Down
12 changes: 12 additions & 0 deletions aws/resource_aws_datasync_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func TestAccAWSDataSyncTask_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -125,6 +126,7 @@ func TestAccAWSDataSyncTask_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand All @@ -147,6 +149,7 @@ func TestAccAWSDataSyncTask_CloudWatchLogGroupARN(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand All @@ -173,6 +176,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_AtimeMtime(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -211,6 +215,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_BytesPerSecond(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -247,6 +252,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_Gid(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -283,6 +289,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_PosixPermissions(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -319,6 +326,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_PreserveDeletedFiles(t *testing.T

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -355,6 +363,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_PreserveDevices(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -391,6 +400,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_Uid(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -427,6 +437,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_VerifyMode(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -473,6 +484,7 @@ func TestAccAWSDataSyncTask_Tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) },
ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDataSyncTaskDestroy,
Steps: []resource.TestStep{
Expand Down