async fn create_work(queue: Arc<JobQueue>) {
    // get a vector of grpc clients to all containers that are part of this test
    let mut hdls = DOCKER_COMPOSE.get().unwrap().grpc_handles().await.unwrap();

    // for each grpc client, invoke these methods.
    for h in &mut hdls {
        // create the bdev
        h.bdev
            .create(BdevUri {
                uri: "malloc:///disk0?size_mb=64".into(),
            })
            .await
            .unwrap();
        // share it over nvmf
        h.bdev
            .share(BdevShareRequest {
                name: "disk0".into(),
                proto: "nvmf".into(),
            })
            .await
            .unwrap();
    }

    DOCKER_COMPOSE.get().unwrap().logs_all().await.unwrap();

    // get a reference to mayastor (used later)
    let ms = MAYASTOR.get().unwrap();

    // have ms create our nexus to the targets created above to know the IPs of
    // the mayastor instances that run in the container, the handles can be
    // used. This avoids hardcoded IPs and having magic constants.
    ms.spawn(async move {
        nexus_create(
            "nexus0",
            1024 * 1024 * 60,
            None,
            &[
                format!(
                    "nvmf://{}:8420/nqn.2019-05.io.openebs:disk0",
                    hdls[0].endpoint.ip()
                ),
                format!(
                    "nvmf://{}:8420/nqn.2019-05.io.openebs:disk0",
                    hdls[1].endpoint.ip()
                ),
            ],
        )
        .await
        .unwrap();

        let bdev = Bdev::lookup_by_name("nexus0").unwrap();

        // create a job using the bdev we looked up, we are in the context here
        // of the ms instance and not the containers.
        let job = io_driver::Builder::new()
            .core(1)
            .bdev(bdev)
            .qd(32)
            .io_size(512)
            .build()
            .await;

        queue.start(job);
    })
    .await
}
// this functions runs with in the context of the mayastorTest instance
this functions runs with in the context of the mayastorTest instance
this functions runs with in the context of the mayastorTest instance
async fn create_work(queue: Arc<JobQueue>) {
    // get a vector of grpc clients to all containers that are part of this test
    let mut hdls = DOCKER_COMPOSE.get().unwrap().grpc_handles().await.unwrap();
    // for each grpc client, invoke these methods.
    for h in &mut hdls {
        // create the bdev
        h.bdev
            .create(BdevUri {
                uri: "malloc:///disk0?size_mb=64".into(),
            })
            .await
            .unwrap();
        // share it over nvmf
        h.bdev
            .share(BdevShareRequest {
                name: "disk0".into(),
                proto: "nvmf".into(),
            })
            .await
            .unwrap();
    }
    DOCKER_COMPOSE.get().unwrap().logs_all().await.unwrap();
    // get a reference to mayastor (used later)
    let ms = MAYASTOR.get().unwrap();
    // have ms create our nexus to the targets created above to know the IPs of
    // the mayastor instances that run in the container, the handles can be
    // used. This avoids hardcoded IPs and having magic constants.
    ms.spawn(async move {
        nexus_create(
            "nexus0",
            1024 * 1024 * 60,
            None,
            &[
                format!(
                    "nvmf://{}:8420/nqn.2019-05.io.openebs:disk0",
                    hdls[0].endpoint.ip()
                ),
                format!(
                    "nvmf://{}:8420/nqn.2019-05.io.openebs:disk0",
                    hdls[1].endpoint.ip()
                ),
            ],
        )
        .await
        .unwrap();
        let bdev = Bdev::lookup_by_name("nexus0").unwrap();
        // create a job using the bdev we looked up, we are in the context here
        // of the ms instance and not the containers.
        let job = io_driver::Builder::new()
            .core(1)
            .bdev(bdev)
            .qd(32)
            .io_size(512)
            .build()
            .await;
        queue.start(job);
    })
    .await
}
async fn create_work ( queue : Arc < JobQueue > ) { // get a vector of grpc clients to all containers that are part of this test let mut hdls = DOCKER_COMPOSE . get ( ) . unwrap ( ) . grpc_handles ( ) . await . unwrap ( ) ; // for each grpc client, invoke these methods. for h in & mut hdls { // create the bdev h . bdev . create ( BdevUri { uri : " " . into ( ) , } ) . await . unwrap ( ) ; // share it over nvmf h . bdev . share ( BdevShareRequest { name : " " . into ( ) , proto : " " . into ( ) , } ) . await . unwrap ( ) ; } DOCKER_COMPOSE . get ( ) . unwrap ( ) . logs_all ( ) . await . unwrap ( ) ; // get a reference to mayastor (used later) let ms = MAYASTOR . get ( ) . unwrap ( ) ; // have ms create our nexus to the targets created above to know the IPs of // the mayastor instances that run in the container, the handles can be // used. This avoids hardcoded IPs and having magic constants. ms . spawn ( async move { nexus_create ( " " , 1024 * 1024 * 60 , None , & [ format ! ( " " hdls [ 0 ] endpoint ip ( ) ) , format ! ( " " hdls [ 1 ] endpoint ip ( ) ) , ] , ) . await . unwrap ( ) ; let bdev = Bdev :: lookup_by_name ( " " ) . unwrap ( ) ; // create a job using the bdev we looked up, we are in the context here // of the ms instance and not the containers. let job = io_driver :: Builder :: new ( ) . core ( 1 ) . bdev ( bdev ) . qd ( 32 ) . io_size ( 512 ) . build ( ) . await ; queue . start ( job ) ; } ) . await }
this functions runs with in the context of the mayastorTest instance
this functions runs with in the context of the mayastorTest instance
queue
Arc<JobQueue>