diff --git a/src/agent/src/random.rs b/src/agent/src/random.rs index f97f0f0334b4..6e1e87c3d447 100644 --- a/src/agent/src/random.rs +++ b/src/agent/src/random.rs @@ -12,7 +12,13 @@ use std::os::unix::io::{AsRawFd, FromRawFd}; use tracing::instrument; pub const RNGDEV: &str = "/dev/random"; +#[cfg(target_arch = "powerpc64")] +pub const RNDADDTOENTCNT: libc::c_uint = 0x80045201; +#[cfg(target_arch = "powerpc64")] +pub const RNDRESEEDCRNG: libc::c_int = 0x20005207; +#[cfg(not(target_arch = "powerpc64"))] pub const RNDADDTOENTCNT: libc::c_int = 0x40045201; +#[cfg(not(target_arch = "powerpc64"))] pub const RNDRESEEDCRNG: libc::c_int = 0x5207; // Handle the differing ioctl(2) request types for different targets diff --git a/src/agent/src/rpc.rs b/src/agent/src/rpc.rs index 57690cdfb4bb..cb2f60564bee 100644 --- a/src/agent/src/rpc.rs +++ b/src/agent/src/rpc.rs @@ -2694,8 +2694,16 @@ OtherField:other fs::write(mount_dir.path().join("file.dat"), "foobar").unwrap(); stats = get_volume_capacity_stats(mount_dir.path().to_str().unwrap()).unwrap(); - assert_eq!(stats.used, 4 * 1024); - assert_eq!(stats.available, available - 4 * 1024); + let size = get_block_size(mount_dir.path().to_str().unwrap()).unwrap(); + + assert_eq!(stats.used, size); + assert_eq!(stats.available, available - size); + } + + fn get_block_size(path: &str) -> Result { + let stat = statfs::statfs(path)?; + let block_size = stat.block_size() as u64; + Ok(block_size) } #[tokio::test]