parent
fba7efb6da
commit
75ae283f23
|
|
@ -28,7 +28,7 @@ tokio = { version = "1.4.0", features = ["full"] }
|
||||||
futures-util = "0.3.1"
|
futures-util = "0.3.1"
|
||||||
base64 = "0.12.0"
|
base64 = "0.12.0"
|
||||||
procspawn = "0.8"
|
procspawn = "0.8"
|
||||||
rand = "0.7.3"
|
rand = "0.8"
|
||||||
strum = "0.18.0"
|
strum = "0.18.0"
|
||||||
strum_macros = "0.18.0"
|
strum_macros = "0.18.0"
|
||||||
openat = "0.1.19"
|
openat = "0.1.19"
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,7 @@ fn impl_transaction_test<M: AsRef<str>>(
|
||||||
let ms = std::cmp::min(cycle_time_ms.saturating_mul(20), 24 * 60 * 60 * 1000);
|
let ms = std::cmp::min(cycle_time_ms.saturating_mul(20), 24 * 60 * 60 * 1000);
|
||||||
time::Duration::from_millis(ms)
|
time::Duration::from_millis(ms)
|
||||||
} else {
|
} else {
|
||||||
time::Duration::from_millis(rng.gen_range(0, cycle_time_ms))
|
time::Duration::from_millis(rng.gen_range(0..cycle_time_ms))
|
||||||
};
|
};
|
||||||
println!(
|
println!(
|
||||||
"force-reboot-time={:?} cycle={:?} status:{:?}",
|
"force-reboot-time={:?} cycle={:?} status:{:?}",
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ pub(crate) async fn http_server<P: AsRef<Path>>(
|
||||||
) -> Result<Response<Body>> {
|
) -> Result<Response<Body>> {
|
||||||
if let Some(random_delay) = opts.random_delay {
|
if let Some(random_delay) = opts.random_delay {
|
||||||
let slices = 100u32;
|
let slices = 100u32;
|
||||||
let n: u32 = rand::thread_rng().gen_range(0, slices);
|
let n: u32 = rand::thread_rng().gen_range(0..slices);
|
||||||
std::thread::sleep((random_delay / slices) * n);
|
std::thread::sleep((random_delay / slices) * n);
|
||||||
}
|
}
|
||||||
if opts.basicauth {
|
if opts.basicauth {
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,9 @@ pub(crate) fn mutate_one_executable_to(
|
||||||
let extra = rand::thread_rng()
|
let extra = rand::thread_rng()
|
||||||
.sample_iter(&rand::distributions::Alphanumeric)
|
.sample_iter(&rand::distributions::Alphanumeric)
|
||||||
.take(10)
|
.take(10)
|
||||||
.collect::<String>();
|
.collect::<Vec<u8>>();
|
||||||
destf
|
destf
|
||||||
.write_all(extra.as_bytes())
|
.write_all(&extra)
|
||||||
.context("Failed to append extra data")?;
|
.context("Failed to append extra data")?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue