]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
java: add test for mount with bad root
authorNoah Watkins <noahwatkins@gmail.com>
Thu, 6 Sep 2012 17:41:51 +0000 (10:41 -0700)
committerNoah Watkins <noahwatkins@gmail.com>
Fri, 19 Oct 2012 16:59:10 +0000 (09:59 -0700)
This adds a unit test that verifies that mounting Ceph with a
non-existent root directory throws FileNotFoundException.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
src/java/test/CephMountTest.java

index 4f5a3e05127c13842e8fd66d63944d03cb800a2e..36d4309d7bffab5f378909dbea274dd60898a67e 100644 (file)
@@ -91,6 +91,16 @@ public class CephMountTest {
     return createFile(makePath(), size);
   }
 
+  @Test(expected=FileNotFoundException.class)
+  public void test_mount_dne() throws Exception {
+    CephMount mount2 = new CephMount("admin");
+    String conf_file = System.getProperty("CEPH_CONF_FILE");
+    if (conf_file != null)
+      mount2.conf_read_file(conf_file);
+    mount2.mount("/wlfkjwlekfjwlejfwe");
+    mount2.shutdown();
+  }
+
   /*
    * Test loading of conf file that doesn't exist.
    *