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 <[email protected]>
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 <[email protected]>
---
 .../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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to