smengcl commented on a change in pull request #906:
URL: https://github.com/apache/hadoop-ozone/pull/906#discussion_r425347619
##########
File path:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java
##########
@@ -766,4 +768,103 @@ public void testTempMount() throws Exception {
fileStatusesInDir1[0].getPath().toUri().getPath());
}
+ /**
+ * Helper function. Check Ozone volume existence.
+ * @param volumeStr Name of the volume
+ * @return true if volume exists, false if not
+ */
+ private boolean volumeExist(String volumeStr) throws IOException {
+ try {
+ objectStore.getVolume(volumeStr);
+ } catch (OMException ex) {
+ if (ex.getResult() == VOLUME_NOT_FOUND) {
+ return false;
+ } else {
+ throw ex;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Helper function. Delete a path non-recursively and expect failure.
+ * @param f Path to delete.
+ * @throws IOException
+ */
+ private void deleteNonRecursivelyAndFail(Path f) throws IOException {
+ try {
+ fs.delete(f, false);
+ Assert.fail("Should have thrown PathIsNotEmptyDirectoryException!");
+ } catch (PathIsNotEmptyDirectoryException ignored) {
+ }
+ }
+
+ @Test
+ public void testDeleteVolumeAndBucket() throws IOException {
Review comment:
Good idea
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]