diff --git a/ais/test/scripted_cli_test.go b/ais/test/scripted_cli_test.go index 7737db8b70..0b56d660b7 100644 --- a/ais/test/scripted_cli_test.go +++ b/ais/test/scripted_cli_test.go @@ -120,12 +120,14 @@ func TestPrefetchLatestRemaisUsingScript(t *testing.T) { } func TestCopySyncWithOutOfBandUsingRemaisScript(t *testing.T) { + bck := cliBck tools.CheckSkip(t, &tools.SkipTestArgs{ + Bck: bck, Long: true, RequiresRemoteCluster: true, + CloudBck: true, }) - bck := cliBck var ( bucketName = bck.Cname("") cmd = exec.Command("./scripts/cp-sync-remais-out-of-band.sh", "--bucket", bucketName) diff --git a/tools/common.go b/tools/common.go index 1d7693831c..47edd1e0d2 100644 --- a/tools/common.go +++ b/tools/common.go @@ -111,7 +111,7 @@ func BucketExists(tb testing.TB, proxyURL string, bck cmn.Bck) (bool, error) { return false, err } -func isRemoteBucket(tb testing.TB, proxyURL string, bck cmn.Bck) bool { +func isRemoteAndPresentBucket(tb testing.TB, proxyURL string, bck cmn.Bck) bool { if !bck.IsRemote() { return false } @@ -120,15 +120,6 @@ func isRemoteBucket(tb testing.TB, proxyURL string, bck cmn.Bck) bool { return exists } -func isCloudBucket(tb testing.TB, proxyURL string, bck cmn.Bck) bool { - if !bck.IsCloud() { - return false - } - exists, err := BucketExists(tb, proxyURL, bck) - tassert.CheckFatal(tb, err) - return exists -} - func PutObjRR(bp api.BaseParams, bck cmn.Bck, objName string, objSize int64, cksumType string) error { reader, err := readers.NewRand(objSize, cksumType) if err != nil { diff --git a/tools/skip.go b/tools/skip.go index 274c5e52ae..0c16428765 100644 --- a/tools/skip.go +++ b/tools/skip.go @@ -59,17 +59,26 @@ func CheckSkip(tb testing.TB, args *SkipTestArgs) { tb.Skipf(fmtSkippingShort, tb.Name()) } if args.RemoteBck { + tassert.Fatalf(tb, !args.Bck.IsEmpty(), "bucket is missing in the args") proxyURL := GetPrimaryURL() - if !isRemoteBucket(tb, proxyURL, args.Bck) { - tb.Skipf("%s requires a remote bucket (have %q)", tb.Name(), args.Bck) + if !isRemoteAndPresentBucket(tb, proxyURL, args.Bck) { + tb.Skipf("%s requires a remote in-cluster bucket (have %s)", tb.Name(), args.Bck) } } if args.CloudBck || args.RequiredCloudProvider != "" { - proxyURL := GetPrimaryURL() - if !isCloudBucket(tb, proxyURL, args.Bck) { - tb.Skipf("%s requires a cloud bucket", tb.Name()) + tassert.Fatalf(tb, !args.Bck.IsEmpty(), "bucket is missing in the args") + cname := args.Bck.Cname("") + if !args.Bck.IsCloud() { + tb.Skipf("%s requires cloud bucket (have %s)", tb.Name(), cname) } else if args.RequiredCloudProvider != "" && args.RequiredCloudProvider != args.Bck.Provider { - tb.Skipf("%s requires a cloud bucket with %s provider", tb.Name(), args.RequiredCloudProvider) + tb.Skipf("%s requires cloud bucket with %s provider (have %s)", tb.Name(), args.RequiredCloudProvider, cname) + } else { + proxyURL := GetPrimaryURL() + exists, err := BucketExists(tb, proxyURL, args.Bck) + tassert.CheckFatal(tb, err) + if !exists { + tb.Skipf("%s requires cloud bucket %s to be in-cluster", tb.Name(), cname) + } } }