Skip to content

Commit

Permalink
tests: Use S3_ADDRESS and S3_SECURE env vars (#574)
Browse files Browse the repository at this point in the history
s3.amazonaws.com and secure flag are hardcoded in tests, use S3_ADDRESS and S3_SECURE flags instead
  • Loading branch information
vadmeste authored and harshavardhana committed Dec 16, 2016
1 parent 44d6114 commit df9218d
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 60 deletions.
44 changes: 22 additions & 22 deletions api_functional_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func TestMakeBucketErrorV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -88,10 +88,10 @@ func TestGetObjectClosedTwiceV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -168,10 +168,10 @@ func TestRemovePartiallyUploadedV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -238,10 +238,10 @@ func TestResumablePutObjectV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -350,10 +350,10 @@ func TestFPutObjectV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -499,10 +499,10 @@ func TestResumableFPutObjectV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -577,10 +577,10 @@ func TestMakeBucketRegionsV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -628,10 +628,10 @@ func TestGetObjectReadSeekFunctionalV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -761,10 +761,10 @@ func TestGetObjectReadAtFunctionalV2(t *testing.T) {

// Instantiate new minio client object.
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -897,10 +897,10 @@ func TestCopyObjectV2(t *testing.T) {

// Instantiate new minio client object
c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -1014,10 +1014,10 @@ func TestFunctionalV2(t *testing.T) {
rand.Seed(time.Now().Unix())

c, err := NewV2(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down
76 changes: 38 additions & 38 deletions api_functional_v4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ func TestMakeBucketError(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -116,10 +116,10 @@ func TestMakeBucketRegions(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -167,10 +167,10 @@ func TestPutObjectReadAt(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -261,10 +261,10 @@ func TestPutObjectWithMetadata(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -357,10 +357,10 @@ func TestListPartiallyUploaded(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -436,10 +436,10 @@ func TestGetOjectSeekEnd(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -531,10 +531,10 @@ func TestGetObjectClosedTwice(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -611,10 +611,10 @@ func TestRemoveMultipleObjects(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)

if err != nil {
Expand Down Expand Up @@ -685,10 +685,10 @@ func TestRemovePartiallyUploaded(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -758,10 +758,10 @@ func TestResumablePutObject(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -874,10 +874,10 @@ func TestResumableFPutObject(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -964,10 +964,10 @@ func TestFPutObjectMultipart(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -1069,10 +1069,10 @@ func TestFPutObject(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -1229,10 +1229,10 @@ func TestGetObjectReadSeekFunctional(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -1362,10 +1362,10 @@ func TestGetObjectReadAtFunctional(t *testing.T) {

// Instantiate new minio client object.
c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -1511,10 +1511,10 @@ func TestPresignedPostPolicy(t *testing.T) {

// Instantiate new minio client object
c, err := NewV4(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -1606,10 +1606,10 @@ func TestCopyObject(t *testing.T) {

// Instantiate new minio client object
c, err := NewV4(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -1772,10 +1772,10 @@ func TestBucketNotification(t *testing.T) {
rand.Seed(time.Now().Unix())

c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down Expand Up @@ -1848,10 +1848,10 @@ func TestFunctional(t *testing.T) {
rand.Seed(time.Now().Unix())

c, err := New(
"s3.amazonaws.com",
os.Getenv("S3_ADDRESS"),
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
true,
mustParseBool(os.Getenv("S3_SECURE")),
)
if err != nil {
t.Fatal("Error:", err)
Expand Down
Loading

0 comments on commit df9218d

Please sign in to comment.