github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/ais/test/s3/e2e_s3_test.go (about)

     1  // Package s3_integration provides tests of compatibility with AWS S3
     2  /*
     3   * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
     4   */
     5  package s3_test
     6  
     7  import (
     8  	"os"
     9  	"os/exec"
    10  	"path/filepath"
    11  	"testing"
    12  
    13  	"github.com/NVIDIA/aistore/api/env"
    14  	"github.com/NVIDIA/aistore/cmn/cos"
    15  	"github.com/NVIDIA/aistore/tools"
    16  	. "github.com/onsi/ginkgo/v2"
    17  	. "github.com/onsi/gomega"
    18  )
    19  
    20  func TestE2ES3(t *testing.T) {
    21  	tools.InitLocalCluster()
    22  	cmd := exec.Command("which", "s3cmd")
    23  	if err := cmd.Run(); err != nil {
    24  		t.Skip("'s3cmd' binary not found")
    25  	}
    26  
    27  	RegisterFailHandler(Fail)
    28  	RunSpecs(t, t.Name())
    29  }
    30  
    31  var _ = Describe("E2E AWS Compatibility Tests", func() {
    32  	var (
    33  		host   string
    34  		params string
    35  	)
    36  
    37  	if value := os.Getenv(env.AIS.UseHTTPS); cos.IsParseBool(value) {
    38  		host = "https://localhost:8080/s3"
    39  		params = "--no-check-certificate"
    40  	} else {
    41  		host = "http://localhost:8080/s3"
    42  		params = "--no-ssl --no-check-certificate"
    43  	}
    44  
    45  	var (
    46  		f = &tools.E2EFramework{
    47  			Vars: map[string]string{"HOST": host, "PARAMS": params},
    48  		}
    49  		files, _ = filepath.Glob("./*.in")
    50  		args     = make([]any, 0, len(files)+1)
    51  	)
    52  	args = append(args, f.RunE2ETest)
    53  	for _, fileName := range files {
    54  		fileName = fileName[:len(fileName)-len(filepath.Ext(fileName))]
    55  		args = append(args, Entry(fileName, fileName))
    56  	}
    57  	DescribeTable("e2e-s3", args...)
    58  })