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)
| 158 | |
| 159 | // CreateBucketWithCleanup, destroys bucket if exists and creates new. The bucket is destroyed on test completion. |
| 160 | func 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 | |
| 170 | func DestroyBucket(tb testing.TB, proxyURL string, bck cmn.Bck) { |
| 171 | baseParams := BaseAPIParams(proxyURL) |