Skip to content

Commit 1933f4c

Browse files
committed
chore: remove tests with invalid fds as Rust hates those
Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent c595dd7 commit 1933f4c

File tree

1 file changed

+0
-14
lines changed
  • src/vmm/src/devices/virtio/block/virtio/io

1 file changed

+0
-14
lines changed

src/vmm/src/devices/virtio/block/virtio/io/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,17 +265,7 @@ pub mod tests {
265265

266266
#[test]
267267
fn test_sync() {
268-
// Check invalid file
269268
let mem = create_mem();
270-
let file = unsafe { File::from_raw_fd(-2) };
271-
let mut engine = FileEngine::from_file(file, FileEngineType::Sync).unwrap();
272-
let res = engine.read(0, &mem, GuestAddress(0), 0, ());
273-
assert_err!(res, BlockIoError::Sync(sync_io::SyncIoError::Seek(_e)));
274-
let res = engine.write(0, &mem, GuestAddress(0), 0, ());
275-
assert_err!(res, BlockIoError::Sync(sync_io::SyncIoError::Seek(_e)));
276-
let res = engine.flush(());
277-
assert_err!(res, BlockIoError::Sync(sync_io::SyncIoError::SyncAll(_e)));
278-
279269
// Create backing file.
280270
let file = TempFile::new().unwrap().into_file();
281271
let mut engine = FileEngine::from_file(file, FileEngineType::Sync).unwrap();
@@ -342,10 +332,6 @@ pub mod tests {
342332

343333
#[test]
344334
fn test_async() {
345-
// Check invalid file
346-
let file = unsafe { File::from_raw_fd(-2) };
347-
FileEngine::<()>::from_file(file, FileEngineType::Async).unwrap_err();
348-
349335
// Create backing file.
350336
let file = TempFile::new().unwrap().into_file();
351337
let mut engine = FileEngine::<()>::from_file(file, FileEngineType::Async).unwrap();

0 commit comments

Comments
 (0)