async fn create_blobfs_and_boot_args_from_this_package() -> (BlobfsRamdisk, BootArgsFixedHash) {
    let this_pkg = fuchsia_pkg_testing::Package::identity().await.unwrap();

    let static_packages = system_image::StaticPackages::from_entries(vec![(
        "pkg-cache/0".parse().unwrap(),
        *this_pkg.meta_far_merkle_root(),
    )]);
    let mut static_packages_bytes = vec![];
    static_packages.serialize(&mut static_packages_bytes).expect("write static_packages");
    let system_image = fuchsia_pkg_testing::PackageBuilder::new("system_image")
        .add_resource_at("data/static_packages", static_packages_bytes.as_slice())
        .build()
        .await
        .expect("build system_image package");
    let blobfs = BlobfsRamdisk::start().expect("start blobfs");
    let () = system_image.write_to_blobfs_dir(&blobfs.root_dir().unwrap());

    let () = this_pkg.write_to_blobfs_dir(&blobfs.root_dir().unwrap());
    (blobfs, BootArgsFixedHash::new(*system_image.meta_far_merkle_root()))
}
// The test package these tests are in includes the pkg-cache component. This function creates
// a BlobfsRamdisk and copies into it:
//   1. this test package (and therefore everything needed for pkg-cache)
//   2. a system_image package with a data/static_packages file that says the hash of pkg-cache
//      is the hash of this test package
//
// This function also creates a BootArgsFixedHash that reports the hash of the system_image
// package as that of the system_image package this function wrote to the returned BlobfsRamdisk.
The test package these tests are in includes the pkg-cache component. This function creates
a BlobfsRamdisk and copies into it:
1. this test package (and therefore everything needed for pkg-cache)
2. a system_image package with a data/static_packages file that says the hash of pkg-cache
is the hash of this test package

This function also creates a BootArgsFixedHash that reports the hash of the system_image
package as that of the system_image package this function wrote to the returned BlobfsRamdisk.
The test package these tests are in includes the pkg - cache component . This function creates a BlobfsRamdisk and copies into it : 1 . this test package ( and therefore everything needed for pkg - cache ) 2 . a system_image package with a data / static_packages file that says the hash of pkg - cache is the hash of this test package This function also creates a BootArgsFixedHash that reports the hash of the system_image package as that of the system_image package this function wrote to the returned BlobfsRamdisk .
async fn create_blobfs_and_boot_args_from_this_package() -> (BlobfsRamdisk, BootArgsFixedHash) {
    let this_pkg = fuchsia_pkg_testing::Package::identity().await.unwrap();
    let static_packages = system_image::StaticPackages::from_entries(vec![(
        "pkg-cache/0".parse().unwrap(),
        *this_pkg.meta_far_merkle_root(),
    )]);
    let mut static_packages_bytes = vec![];
    static_packages.serialize(&mut static_packages_bytes).expect("write static_packages");
    let system_image = fuchsia_pkg_testing::PackageBuilder::new("system_image")
        .add_resource_at("data/static_packages", static_packages_bytes.as_slice())
        .build()
        .await
        .expect("build system_image package");
    let blobfs = BlobfsRamdisk::start().expect("start blobfs");
    let () = system_image.write_to_blobfs_dir(&blobfs.root_dir().unwrap());
    let () = this_pkg.write_to_blobfs_dir(&blobfs.root_dir().unwrap());
    (blobfs, BootArgsFixedHash::new(*system_image.meta_far_merkle_root()))
}
async fn create_blobfs_and_boot_args_from_this_package ( ) -> ( BlobfsRamdisk , BootArgsFixedHash ) { let this_pkg = fuchsia_pkg_testing :: Package :: identity ( ) . await . unwrap ( ) ; let static_packages = system_image :: StaticPackages :: from_entries ( vec ! [ ( " " parse ( ) unwrap ( ) this_pkg meta_far_merkle_root ( ) ) ] ) ; let mut static_packages_bytes = vec ! [ ] ; static_packages . serialize ( & mut static_packages_bytes ) . expect ( " " ) ; let system_image = fuchsia_pkg_testing :: PackageBuilder :: new ( " " ) . add_resource_at ( " " , static_packages_bytes . as_slice ( ) ) . build ( ) . await . expect ( " " ) ; let blobfs = BlobfsRamdisk :: start ( ) . expect ( " " ) ; let ( ) = system_image . write_to_blobfs_dir ( & blobfs . root_dir ( ) . unwrap ( ) ) ; let ( ) = this_pkg . write_to_blobfs_dir ( & blobfs . root_dir ( ) . unwrap ( ) ) ; ( blobfs , BootArgsFixedHash :: new ( * system_image . meta_far_merkle_root ( ) ) ) }
The test package these tests are in includes the pkg-cache component.
The test package these tests are in includes the pkg - cache component .