Lines Matching defs:mnt
47 MountMemMock* mnt = new MountMemMock();
58 EXPECT_EQ(1, mnt->num_nodes());
61 EXPECT_EQ(ENOENT, mnt->Access(Path("/foo"), R_OK | W_OK));
62 EXPECT_EQ(ENOENT, mnt->Open(Path("/foo"), O_RDWR, &result_node));
64 EXPECT_EQ(1, mnt->num_nodes());
67 EXPECT_EQ(0, mnt->Open(Path("/foo"), O_RDWR | O_CREAT, &file));
74 EXPECT_EQ(2, mnt->num_nodes());
76 EXPECT_EQ(0, mnt->Access(Path("/foo"), R_OK | W_OK));
77 EXPECT_EQ(EACCES, mnt->Access(Path("/foo"), X_OK));
80 EXPECT_EQ(0, mnt->Access(Path("/"), R_OK | W_OK));
81 EXPECT_EQ(EACCES, mnt->Access(Path("/"), X_OK));
83 EXPECT_EQ(EISDIR, mnt->Open(Path("/"), O_RDWR, &root));
84 EXPECT_EQ(2, mnt->num_nodes());
87 EXPECT_EQ(0, mnt->Open(Path("/"), O_RDONLY, &root));
88 EXPECT_EQ(2, mnt->num_nodes());
99 mnt->Open(Path("/foo"), O_RDWR | O_CREAT | O_EXCL, &result_node));
101 EXPECT_EQ(2, mnt->num_nodes());
104 EXPECT_EQ(EEXIST, mnt->Mkdir(Path("/foo"), O_RDWR));
105 EXPECT_EQ(2, mnt->num_nodes());
116 EXPECT_EQ(2, mnt->num_nodes());
121 EXPECT_EQ(0, mnt->Open(Path("/foo"), O_RDWR | O_CREAT, &result_node));
123 EXPECT_EQ(2, mnt->num_nodes());
131 EXPECT_EQ(2, mnt->num_nodes());
134 EXPECT_EQ(0, mnt->Unlink(Path("/foo")));
135 EXPECT_EQ(1, mnt->num_nodes());
138 EXPECT_EQ(ENOENT, mnt->Unlink(Path("/foo")));
139 EXPECT_EQ(1, mnt->num_nodes());
142 EXPECT_EQ(0, mnt->Mkdir(Path("/foo"), O_RDWR));
143 EXPECT_EQ(2, mnt->num_nodes());
146 EXPECT_EQ(0, mnt->Open(Path("/foo/bar"), O_RDWR | O_CREAT | O_EXCL, &file));
151 EXPECT_EQ(3, mnt->num_nodes());
154 EXPECT_EQ(ENOTEMPTY, mnt->Rmdir(Path("/foo")));
157 EXPECT_EQ(3, mnt->num_nodes());
160 EXPECT_EQ(0, mnt->Unlink(Path("/foo/bar")));
163 EXPECT_EQ(3, mnt->num_nodes());
168 EXPECT_EQ(2, mnt->num_nodes());
171 EXPECT_EQ(0, mnt->Rmdir(Path("/foo")));
172 EXPECT_EQ(1, mnt->num_nodes());
175 EXPECT_EQ(ENOENT, mnt->Access(Path("/foo"), F_OK));
176 EXPECT_EQ(ENOENT, mnt->Open(Path("/foo"), O_RDWR, &file));
181 MountMemMock* mnt = new MountMemMock();
185 EXPECT_EQ(0, mnt->Mkdir(Path("/dir"), O_RDWR));
186 EXPECT_EQ(0, mnt->Open(Path("/file"), O_RDWR | O_CREAT | O_EXCL, &file));
188 EXPECT_EQ(3, mnt->num_nodes());
191 EXPECT_EQ(0, mnt->Remove(Path("/dir")));
192 EXPECT_EQ(2, mnt->num_nodes());
193 EXPECT_EQ(0, mnt->Remove(Path("/file")));
194 EXPECT_EQ(1, mnt->num_nodes());
197 mnt->Open(Path("/dir/foo"), O_CREAT | O_RDWR, &result_node));
199 EXPECT_EQ(ENOENT, mnt->Open(Path("/file"), O_RDONLY, &result_node));
205 MountDevMock* mnt = new MountDevMock();
206 ASSERT_EQ(ENOENT, mnt->Access(Path("/foo"), F_OK));
210 MountDevMock* mnt = new MountDevMock();
214 ASSERT_EQ(0, mnt->Access(Path("/null"), R_OK | W_OK));
215 ASSERT_EQ(EACCES, mnt->Access(Path("/null"), X_OK));
216 ASSERT_EQ(0, mnt->Open(Path("/null"), O_RDWR, &dev_null));
232 MountDevMock* mnt = new MountDevMock();
236 ASSERT_EQ(0, mnt->Access(Path("/zero"), R_OK | W_OK));
237 ASSERT_EQ(EACCES, mnt->Access(Path("/zero"), X_OK));
238 ASSERT_EQ(0, mnt->Open(Path("/zero"), O_RDWR, &dev_zero));
261 MountDevMock* mnt = new MountDevMock();
265 ASSERT_EQ(0, mnt->Access(Path("/urandom"), R_OK | W_OK));
266 ASSERT_EQ(EACCES, mnt->Access(Path("/urandom"), X_OK));
267 ASSERT_EQ(0, mnt->Open(Path("/urandom"), O_RDWR, &dev_urandom));
307 MountDevMock* mnt = new MountDevMock();
310 ASSERT_EQ(0, mnt->Access(Path("/tty"), R_OK | W_OK));
311 ASSERT_EQ(EACCES, mnt->Access(Path("/tty"), X_OK));
312 ASSERT_EQ(0, mnt->Open(Path("/tty"), O_RDWR, &dev_tty));