2 * Permission is hereby granted, free of charge, to any person obtaining a
3 * copy of this software and associated documentation files (the "Software"),
4 * to deal in the Software without restriction, including without limitation
5 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
6 * and/or sell copies of the Software, and to permit persons to whom the
7 * Software is furnished to do so, subject to the following conditions:
9 * The above copyright notice and this permission notice shall be included in
10 * all copies or substantial portions of the Software.
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 * DEALINGS IN THE SOFTWARE.
23 import static org.junit.Assert.*;
25 public class CephUnmountedTest {
27 private CephMount mount;
30 public void setup() throws Exception {
31 mount = new CephMount("admin");
34 @Test(expected=CephNotMountedException.class)
35 public void test_unmount() throws Exception {
39 @Test(expected=CephNotMountedException.class)
40 public void test_statfs() throws Exception {
41 CephStatVFS stat = new CephStatVFS();
42 mount.statfs("/a/path", stat);
45 @Test(expected=CephNotMountedException.class)
46 public void test_getcwd() throws Exception {
50 @Test(expected=CephNotMountedException.class)
51 public void test_chdir() throws Exception {
52 mount.chdir("/a/path");
55 @Test(expected=CephNotMountedException.class)
56 public void test_listdir() throws Exception {
57 mount.listdir("/a/path");
60 @Test(expected=CephNotMountedException.class)
61 public void test_unlink() throws Exception {
62 mount.unlink("/a/path");
65 @Test(expected=CephNotMountedException.class)
66 public void test_rename() throws Exception {
67 mount.rename("/a/path", "/another/path");
70 @Test(expected=CephNotMountedException.class)
71 public void test_mkdirs() throws Exception {
72 mount.mkdirs("/a/path", 0);
75 @Test(expected=CephNotMountedException.class)
76 public void test_rmdir() throws Exception {
77 mount.rmdir("/a/path");
80 @Test(expected=CephNotMountedException.class)
81 public void test_stat() throws Exception {
82 CephStat stat = new CephStat();
83 mount.stat("/a/path", stat);
86 @Test(expected=CephNotMountedException.class)
87 public void test_lstat() throws Exception {
88 CephStat stat = new CephStat();
89 mount.lstat("/a/path", stat);
92 @Test(expected=CephNotMountedException.class)
93 public void test_setattr() throws Exception {
94 CephStat stat = new CephStat();
95 mount.setattr("/a/path", stat, 0);
98 @Test(expected=CephNotMountedException.class)
99 public void test_open() throws Exception {
100 mount.open("/a/path", 0, 0);
103 @Test(expected=CephNotMountedException.class)
104 public void test_open_layout() throws Exception {
105 mount.open("/a/path", 0, 0, 0, 0, 0, null);
108 @Test(expected=CephNotMountedException.class)
109 public void test_close() throws Exception {
113 @Test(expected=CephNotMountedException.class)
114 public void test_lseek() throws Exception {
115 mount.lseek(0, 0, CephMount.SEEK_CUR);
118 @Test(expected=CephNotMountedException.class)
119 public void test_read() throws Exception {
120 byte[] buf = new byte[1];
121 mount.read(0, buf, 1, 0);
124 @Test(expected=CephNotMountedException.class)
125 public void test_write() throws Exception {
126 byte[] buf = new byte[1];
127 mount.write(0, buf, 1, 0);
130 @Test(expected=CephNotMountedException.class)
131 public void test_get_stripe_unit() throws Exception {
132 mount.get_file_stripe_unit(0);
135 @Test(expected=CephNotMountedException.class)
136 public void test_get_repl() throws Exception {
137 mount.get_file_replication(0);
140 @Test(expected=CephNotMountedException.class)
141 public void test_get_stripe_unit_gran() throws Exception {
142 mount.get_stripe_unit_granularity();
145 @Test(expected=CephNotMountedException.class)
146 public void test_get_pool_id() throws Exception {
147 mount.get_pool_id("data");
150 @Test(expected=CephNotMountedException.class)
151 public void test_get_pool_replication() throws Exception {
152 mount.get_pool_replication(1);
155 @Test(expected=CephNotMountedException.class)
156 public void test_fchmod() throws Exception {
160 @Test(expected=CephNotMountedException.class)
161 public void test_chmod() throws Exception {
162 mount.chmod("/foo", 0);