-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Resolves #25 - added mb (make bucket) command
- Loading branch information
Showing
12 changed files
with
121 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package e2e | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/service/s3" | ||
"gotest.tools/v3/icmd" | ||
) | ||
|
||
func Test_MakeBucket_success(t *testing.T) { | ||
t.Parallel() | ||
s3client, s5cmd, cleanup := setup(t) | ||
defer cleanup() | ||
|
||
bucketName := "test-bucket" | ||
cmd := s5cmd(fmt.Sprintf("mb s3://%s", bucketName)) | ||
result := icmd.RunCmd(cmd) | ||
|
||
result.Assert(t, icmd.Success) | ||
|
||
_, err := s3client.HeadBucket(&s3.HeadBucketInput{Bucket: aws.String(bucketName)}) | ||
if err != nil { | ||
t.Errorf("unexpected error %v", err) | ||
} | ||
} | ||
|
||
func Test_MakeBucket_failure(t *testing.T) { | ||
t.Parallel() | ||
_, s5cmd, cleanup := setup(t) | ||
defer cleanup() | ||
|
||
bucketName := "invalid/bucket/name" | ||
cmd := s5cmd(fmt.Sprintf("mb s3://%s", bucketName)) | ||
result := icmd.RunCmd(cmd) | ||
|
||
result.Assert(t, icmd.Expected{ExitCode: 127}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters