Skip to content

Commit a61ac2c

Browse files
committed
Merge branch 'improvement/ZENKO-5001' into q/2.11
2 parents b5a7c58 + e6668d3 commit a61ac2c

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

tests/zenko_tests/node_tests/backbeat/LifecycleUtility.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,15 @@ class LifecycleUtility extends ReplicationUtility {
175175
}
176176
}
177177

178+
putBucketVersioningConfiguration(status, cb) {
179+
this.s3.putBucketVersioning({
180+
Bucket: this.bucket,
181+
VersioningConfiguration: {
182+
Status: status,
183+
},
184+
}, cb);
185+
}
186+
178187
putBucketLifecycleConfiguration(transitionDate, cb) {
179188
this.s3.putBucketLifecycleConfiguration({
180189
Bucket: this.bucket,

tests/zenko_tests/node_tests/backbeat/tests/lifecycle/transition.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,40 @@ testsToRun.forEach(test => {
233233
], done);
234234
});
235235
});
236+
237+
describe('with versioning suspended', () => {
238+
beforeEach(done => cloudServer.createVersionedBucket(srcBucket, done));
239+
240+
it('should transition an object', done => {
241+
const key = `${prefix}ver-suspended-master`;
242+
cloudServer.setKey(key);
243+
cloud.setKey(`${srcBucket}/${key}`);
244+
let versionId = null;
245+
series([
246+
next => cloudServer.putBucketVersioningConfiguration('Suspended', next),
247+
next => cloudServer.putObject(Buffer.from(key), (err, data) => {
248+
if (data) {
249+
versionId = data.VersionId;
250+
}
251+
next(err);
252+
}),
253+
next => checkTransition(toLoc, cloudServer, cloud, versionId, next),
254+
next => checkRestoration(toLoc, cloudServer, versionId, next),
255+
], done);
256+
});
257+
258+
it('should transition non-versioned object', done => {
259+
const key = `${prefix}ver-suspended-master`;
260+
cloudServer.setKey(key);
261+
cloud.setKey(`${srcBucket}/${key}`);
262+
series([
263+
next => cloudServer.putObject(Buffer.from(key), next),
264+
next => cloudServer.putBucketVersioningConfiguration('Suspended', next),
265+
next => checkTransition(toLoc, cloudServer, cloud, null, next),
266+
next => checkRestoration(toLoc, cloudServer, null, next),
267+
], done);
268+
});
269+
});
236270
}
237271
});
238272
});

0 commit comments

Comments
 (0)