jyotirmoy-gh commented on code in PR #4198:
URL: https://github.com/apache/ozone/pull/4198#discussion_r1085411920
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java:
##########
@@ -278,4 +278,35 @@ public void testCreateSnapshotParameterMissing() throws
Exception {
shell.close();
}
}
+
+ @Test
+ public void testDeleteBucketWithSnapshot() throws Exception {
+ String volume = "vol-" + RandomStringUtils.randomNumeric(5);
+ String bucket = "buc-" + RandomStringUtils.randomNumeric(5);
+ String key = "key-" + RandomStringUtils.randomNumeric(5);
+ String snapshotName = "snap-" + RandomStringUtils.randomNumeric(5);
+
+ String testVolBucket = OM_KEY_PREFIX + volume + OM_KEY_PREFIX + bucket;
+ String testKey = testVolBucket + OM_KEY_PREFIX + key;
+
+ createVolBuckKey(testVolBucket, testKey);
+
+ OzoneFsShell shell = new OzoneFsShell(clientConf);
+ try {
+ int res = ToolRunner.run(shell,
+ new String[]{"-createSnapshot", testVolBucket, snapshotName});
+ // Asserts that create request succeeded
+ assertEquals(0, res);
+
+ res = ToolRunner.run(shell,
+ new String[]{"-rm", "-r", "-skipTrash", testKey});
+ assertEquals(0, res);
+
+ res = ToolRunner.run(shell,
+ new String[]{"-rm", "-r", "-skipTrash", testVolBucket});
+ assertEquals(1, res);
+ } finally {
Review Comment:
I have added checks for bucket and snapshot. The snapshot check is failing
presently due to - https://issues.apache.org/jira/browse/HDDS-7805
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]