Skip to content

Commit

Permalink
Fix acceptance test linting errors and GovCloud failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed May 5, 2021
1 parent 3bac968 commit a192737
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions aws/resource_aws_transfer_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
)

func init() {
RegisterServiceErrorCheckFunc(transfer.EndpointsID, testAccErrorCheckSkipTransfer)

resource.AddTestSweepers("aws_transfer_server", &resource.Sweeper{
Name: "aws_transfer_server",
F: testSweepTransferServers,
Expand Down Expand Up @@ -64,6 +66,12 @@ func testSweepTransferServers(region string) error {
return nil
}

func testAccErrorCheckSkipTransfer(t *testing.T) resource.ErrorCheckFunc {
return testAccErrorCheckSkipMessagesContaining(t,
"Invalid server type: PUBLIC",
)
}

func TestAccAWSTransferServer_basic(t *testing.T) {
var conf transfer.DescribedServer
resourceName := "aws_transfer_server.test"
Expand Down Expand Up @@ -110,10 +118,10 @@ func TestAccAWSTransferServer_securityPolicy(t *testing.T) {
resourceName := "aws_transfer_server.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) },
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSTransferServerDestroy,
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) },
ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSTransferServerDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSTransferServerSecurityPolicyConfig("TransferSecurityPolicy-2020-06"),
Expand Down Expand Up @@ -260,6 +268,10 @@ func TestAccAWSTransferServer_vpcEndpointId(t *testing.T) {
resourceName := "aws_transfer_server.test"
rName := acctest.RandomWithPrefix("tf-acc-test")

if testAccGetPartition() == "aws-us-gov" {
t.Skip("Transfer Server VPC_ENDPOINT endpoint type is not supported in GovCloud partition")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) },
ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID),
Expand Down

0 comments on commit a192737

Please sign in to comment.