You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ss...@apache.org on 2022/11/14 12:36:53 UTC

[ozone] branch HDDS-6517-Snapshot updated: HDDS-7452. [snapshot] Add unit-testcases for snapshot create validation. (#3946)

This is an automated email from the ASF dual-hosted git repository.

sshenoy pushed a commit to branch HDDS-6517-Snapshot
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/HDDS-6517-Snapshot by this push:
     new d1a834ce09 HDDS-7452. [snapshot] Add unit-testcases for snapshot create validation. (#3946)
d1a834ce09 is described below

commit d1a834ce092f4ce81c145d5fef2ab932d2490700
Author: jyotirmoy-gh <69...@users.noreply.github.com>
AuthorDate: Mon Nov 14 18:06:46 2022 +0530

    HDDS-7452. [snapshot] Add unit-testcases for snapshot create validation. (#3946)
    
    * HDDS-7452. [snapshot] Add unit-testcases for snapshot create validation.
    
    * rename test method to testNonExistentBucket
    
    * remove dead code
    
    Co-authored-by: jsinha <js...@cloudera.com>
---
 .../java/org/apache/hadoop/ozone/om/TestOmSnapshot.java    | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java
index b7ce4a8c3b..8705f9356d 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java
@@ -37,6 +37,7 @@ import org.apache.hadoop.ozone.om.helpers.OzoneFileStatus;
 import org.apache.hadoop.ozone.om.helpers.SnapshotInfo;
 import org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol;
 import org.apache.ozone.test.GenericTestUtils;
+import org.apache.ozone.test.LambdaTestUtils;
 import org.junit.Assert;
 import org.junit.AfterClass;
 import org.junit.Rule;
@@ -412,6 +413,19 @@ public class TestOmSnapshot {
 
   }
 
+  @Test
+  public void testNonExistentBucket()
+          throws Exception {
+    String volume = "vol-" + RandomStringUtils.randomNumeric(5);
+    String bucket = "buc-" + RandomStringUtils.randomNumeric(5);
+    //create volume but not bucket
+    store.createVolume(volume);
+
+    LambdaTestUtils.intercept(OMException.class,
+            "Bucket not found",
+            () -> createSnapshot(volume, bucket));
+  }
+
   private String createSnapshot()
       throws IOException, InterruptedException, TimeoutException {
     return createSnapshot(volumeName, bucketName);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org