tests: streamline module names to unit_tests

This better aligns with the rest of the code and makes it clearer
that these tests can run "as is" in a normal hosted environments
without the special test environment.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster
2025-11-18 07:24:05 +01:00
committed by Bo Chen
parent c990f1bdaa
commit d1680b9ff9
53 changed files with 59 additions and 59 deletions

View File

@@ -392,7 +392,7 @@ impl Snapshottable for VirtioPciCommonConfig {
}
#[cfg(test)]
mod tests {
mod unit_tests {
use vm_memory::GuestMemoryAtomic;
use vmm_sys_util::eventfd::EventFd;

View File

@@ -670,14 +670,14 @@ where
}
#[cfg(test)]
mod tests {
mod unit_tests {
use std::io::{Error as IoError, Result as IoResult};
use libc::EFD_NONBLOCK;
use virtio_queue::QueueOwnedT;
use vmm_sys_util::eventfd::EventFd;
use super::super::super::tests::TestContext;
use super::super::super::unit_tests::TestContext;
use super::super::defs as csm_defs;
use super::*;

View File

@@ -142,7 +142,7 @@ impl TxBuf {
}
#[cfg(test)]
mod tests {
mod unit_tests {
use std::io::{Error as IoError, ErrorKind, Result as IoResult};
use super::*;

View File

@@ -514,10 +514,10 @@ impl<B> Transportable for Vsock<B> where B: VsockBackend + Sync + 'static {}
impl<B> Migratable for Vsock<B> where B: VsockBackend + Sync + 'static {}
#[cfg(test)]
mod tests {
mod unit_tests {
use libc::EFD_NONBLOCK;
use super::super::tests::{NoopVirtioInterrupt, TestContext};
use super::super::unit_tests::{NoopVirtioInterrupt, TestContext};
use super::super::*;
use super::*;
use crate::ActivateError;

View File

@@ -161,7 +161,7 @@ pub trait VsockChannel {
pub trait VsockBackend: VsockChannel + VsockEpollListener + Send {}
#[cfg(any(test, fuzzing))]
pub mod tests {
pub mod unit_tests {
use std::os::unix::io::AsRawFd;
use std::path::PathBuf;
use std::sync::{Arc, RwLock};

View File

@@ -418,13 +418,13 @@ impl VsockPacket {
#[cfg(test)]
#[allow(clippy::undocumented_unsafe_blocks)]
mod tests {
mod unit_tests {
use virtio_bindings::virtio_ring::VRING_DESC_F_WRITE;
use virtio_queue::QueueOwnedT;
use vm_memory::GuestAddress;
use vm_virtio::queue::testing::VirtqDesc as GuestQDesc;
use super::super::tests::TestContext;
use super::super::unit_tests::TestContext;
use super::*;
use crate::GuestMemoryMmap;
use crate::vsock::defs::MAX_PKT_BUF_SIZE;

View File

@@ -867,7 +867,7 @@ impl VsockMuxer {
}
#[cfg(test)]
mod tests {
mod unit_tests {
use std::cmp::min;
use std::io::Write;
use std::path::{Path, PathBuf};
@@ -875,7 +875,7 @@ mod tests {
use virtio_queue::QueueOwnedT;
use super::super::super::csm::defs as csm_defs;
use super::super::super::tests::TestContext as VsockTestContext;
use super::super::super::unit_tests::TestContext as VsockTestContext;
use super::*;
impl PartiallyReadCommand {