security_pkg_test_util/
storage.rsuse ramdevice_client::{RamdiskClient, RamdiskClientBuilder};
use zx::Vmo;
const RAMDISK_BLOCK_SIZE: u64 = 512;
pub async fn mount_image_as_ramdisk(resource_path: &str) -> RamdiskClient {
let image_buffer = fuchsia_fs::file::read_in_namespace(resource_path).await.unwrap();
let image_size = image_buffer.len();
let image_vmo = Vmo::create(image_size.try_into().unwrap()).unwrap();
image_vmo.write(&image_buffer, 0).unwrap();
let ramdisk_client = RamdiskClientBuilder::new_with_vmo(image_vmo, Some(RAMDISK_BLOCK_SIZE))
.build()
.await
.unwrap();
ramdisk_client
}