fn invoke_cli_register() -> Result<()> {
    // `fail_point`s cause registration to fail on first 3 tries when unit testing.
    fail_point!(
        "register_driver_err",
        REGISTER_DRIVER_FAILURES.get() < 2,
        |_| bail!("register_driver_err")
    );
    fail_point!(
        "register_driver_ok",
        REGISTER_DRIVER_FAILURES.get() >= 3,
        |_| Ok(())
    );

    let mut cmd = std::process::Command::new("rpm-ostree");
    cmd.arg("deploy")
        .arg("")
        .arg(format!("--register-driver={}", DRIVER_NAME))
        .env("RPMOSTREE_CLIENT_ID", "zincati");

    let out = cmd.output().context("failed to run 'rpm-ostree' binary")?;

    if !out.status.success() {
        bail!(
            "rpm-ostree deploy --register-driver failed:\n{}",
            String::from_utf8_lossy(&out.stderr)
        );
    }

    Ok(())
}
/// CLI executor for registering driver.
CLI executor for registering driver.
CLI executor for registering driver .
fn invoke_cli_register() -> Result<()> {
    // `fail_point`s cause registration to fail on first 3 tries when unit testing.
    fail_point!(
        "register_driver_err",
        REGISTER_DRIVER_FAILURES.get() < 2,
        |_| bail!("register_driver_err")
    );
    fail_point!(
        "register_driver_ok",
        REGISTER_DRIVER_FAILURES.get() >= 3,
        |_| Ok(())
    );
    let mut cmd = std::process::Command::new("rpm-ostree");
    cmd.arg("deploy")
        .arg("")
        .arg(format!("--register-driver={}", DRIVER_NAME))
        .env("RPMOSTREE_CLIENT_ID", "zincati");
    let out = cmd.output().context("failed to run 'rpm-ostree' binary")?;
    if !out.status.success() {
        bail!(
            "rpm-ostree deploy --register-driver failed:\n{}",
            String::from_utf8_lossy(&out.stderr)
        );
    }
    Ok(())
}
fn invoke_cli_register ( ) -> Result < ( ) > { // `fail_point`s cause registration to fail on first 3 tries when unit testing. fail_point ! ( " " REGISTER_DRIVER_FAILURES get ( ) 2 bail ( " " ) ) ; fail_point ! ( " " REGISTER_DRIVER_FAILURES get ( ) 3 Ok ( ( ) ) ) ; let mut cmd = std :: process :: Command :: new ( " " ) ; cmd . arg ( " " ) . arg ( " " ) . arg ( format ! ( " " DRIVER_NAME ) ) . env ( " " , " " ) ; let out = cmd . output ( ) . context ( " " ) ? ; if ! out . status . success ( ) { bail ! ( " \n " String from_utf8_lossy ( out stderr ) ) ; } Ok ( ( ) ) }
CLI executor for registering driver.
CLI executor for registering driver .