diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -980,7 +980,11 @@ } res = read(m_fuse_fd, &in, sizeof(in)); - if (res < 0 && errno != EBADF && !m_quit && !m_expect_unmount) { + if (res < 0 && errno == ENODEV && m_expect_unmount) { + /* The kernel unmounted us, as expected. */ + m_quit = true; + } + if (res < 0 && errno != EBADF && !m_quit) { m_quit = true; FAIL() << "read: " << strerror(errno); }