MCPcopy
hub / github.com/NVIDIA/aistore / CreateBucketWithCleanup

Function CreateBucketWithCleanup

devtools/tutils/client.go:160–168  ·  view source on GitHub ↗

CreateBucketWithCleanup, destroys bucket if exists and creates new. The bucket is destroyed on test completion.

(tb testing.TB, proxyURL string, bck cmn.Bck, props *cmn.BucketPropsToUpdate)

Source from the content-addressed store, hash-verified

158
159// CreateBucketWithCleanup, destroys bucket if exists and creates new. The bucket is destroyed on test completion.
160func CreateBucketWithCleanup(tb testing.TB, proxyURL string, bck cmn.Bck, props *cmn.BucketPropsToUpdate) {
161 DestroyBucket(tb, proxyURL, bck)
162 baseParams := BaseAPIParams(proxyURL)
163 err := api.CreateBucket(baseParams, bck, props)
164 tassert.CheckFatal(tb, err)
165 tb.Cleanup(func() {
166 DestroyBucket(tb, proxyURL, bck)
167 })
168}
169
170func DestroyBucket(tb testing.TB, proxyURL string, bck cmn.Bck) {
171 baseParams := BaseAPIParams(proxyURL)

Callers 15

BenchmarkECEncodeFunction · 0.92
BenchmarkECRebalanceFunction · 0.92
BenchmarkRebalanceFunction · 0.92
createAndFillBucketFunction · 0.92
TestRegressionBucketsFunction · 0.92
TestRenameBucketFunction · 0.92
TestRenameObjectsFunction · 0.92
TestStressDeleteRangeFunction · 0.92
TestDownloadTimeoutFunction · 0.92

Calls 5

CreateBucketFunction · 0.92
CheckFatalFunction · 0.92
BaseAPIParamsFunction · 0.85
CleanupMethod · 0.80
DestroyBucketFunction · 0.70

Tested by 15

BenchmarkECEncodeFunction · 0.74
BenchmarkECRebalanceFunction · 0.74
BenchmarkRebalanceFunction · 0.74
createAndFillBucketFunction · 0.74
TestRegressionBucketsFunction · 0.74
TestRenameBucketFunction · 0.74
TestRenameObjectsFunction · 0.74
TestStressDeleteRangeFunction · 0.74
TestDownloadTimeoutFunction · 0.74