From ad3482b2d1491472eac2bb77731d313457521bd9 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Thu, 6 Sep 2012 10:41:51 -0700 Subject: [PATCH] java: add test for mount with bad root This adds a unit test that verifies that mounting Ceph with a non-existent root directory throws FileNotFoundException. Signed-off-by: Noah Watkins --- src/java/test/CephMountTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/java/test/CephMountTest.java b/src/java/test/CephMountTest.java index 4f5a3e05127c1..36d4309d7bffa 100644 --- a/src/java/test/CephMountTest.java +++ b/src/java/test/CephMountTest.java @@ -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. * -- 2.39.5