"docs/vscode:/vscode.git/clone" did not exist on "bcf0731aa07c11d92b6261c58f42d9ad07b949c6"
Unverified Commit 67df0065 authored by Yan Ru Pei's avatar Yan Ru Pei Committed by GitHub
Browse files

chore: linux gate lib/memory (#5942)


Signed-off-by: default avatarPeaBrane <yanrpei@gmail.com>
parent 76e0e207
......@@ -17,6 +17,7 @@ pub mod pool;
pub mod prelude;
mod device;
#[cfg(target_os = "linux")]
mod disk;
mod pinned;
mod system;
......@@ -27,6 +28,7 @@ mod tests;
pub use arena::{ArenaAllocator, ArenaBuffer, ArenaError};
pub use device::DeviceStorage;
#[cfg(target_os = "linux")]
pub use disk::DiskStorage;
pub use pinned::PinnedStorage;
pub use system::SystemStorage;
......
......@@ -55,6 +55,7 @@ fn test_system_storage_zero_size() {
));
}
#[cfg(target_os = "linux")]
#[test]
fn test_disk_storage_temp() {
let storage = DiskStorage::new(4096).unwrap();
......@@ -65,6 +66,7 @@ fn test_disk_storage_temp() {
assert!(storage.path().exists());
}
#[cfg(target_os = "linux")]
#[test]
fn test_disk_storage_at_path() {
let temp_dir = tempfile::tempdir().unwrap();
......@@ -98,6 +100,7 @@ fn test_system_storage_unregistered_no_nixl_descriptor() {
assert!(storage.nixl_descriptor().is_none());
}
#[cfg(target_os = "linux")]
#[test]
fn test_disk_storage_unregistered_no_nixl_descriptor() {
let storage = DiskStorage::new(4096).unwrap();
......@@ -197,7 +200,8 @@ mod nixl_tests {
// The current implementation uses mem::zeroed() which is invalid for types with NonNull
// TODO: Fix NixlRegistered::into_storage() implementation
// Disk Storage Tests
// Disk Storage Tests (Linux only)
#[cfg(target_os = "linux")]
#[test]
fn test_disk_storage_registration() {
let storage = DiskStorage::new(4096).unwrap();
......@@ -210,6 +214,7 @@ mod nixl_tests {
assert!(registered.is_registered());
}
#[cfg(target_os = "linux")]
#[test]
fn test_disk_storage_descriptor_consistency() {
let storage = DiskStorage::new(8192).unwrap();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment