mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-03 05:18:24 +03:00
tests/destructive: Port more to xshell
Just keeping up momentum.
This commit is contained in:
parent
ee1e585ee9
commit
578c87e7ef
@ -511,18 +511,22 @@ fn impl_transaction_test<M: AsRef<str>>(
|
|||||||
// the interrupt strategy.
|
// the interrupt strategy.
|
||||||
match strategy {
|
match strategy {
|
||||||
InterruptStrategy::Force(ForceInterruptStrategy::Kill9) => {
|
InterruptStrategy::Force(ForceInterruptStrategy::Kill9) => {
|
||||||
bash!(
|
cmd!(sh, "systemctl kill -s KILL rpm-ostreed")
|
||||||
"systemctl kill -s KILL rpm-ostreed || true
|
.ignore_status()
|
||||||
systemctl kill -s KILL ostree-finalize-staged || true
|
.run()?;
|
||||||
systemctl kill -s KILL ostree-finalize-staged-hold || true"
|
cmd!(sh, "systemctl kill -s KILL ostree-finalize-staged")
|
||||||
)?;
|
.ignore_status()
|
||||||
|
.run()?;
|
||||||
|
cmd!(sh, "systemctl kill -s KILL ostree-finalize-staged-hold")
|
||||||
|
.ignore_status()
|
||||||
|
.run()?;
|
||||||
live_strategy = Some(strategy);
|
live_strategy = Some(strategy);
|
||||||
}
|
}
|
||||||
InterruptStrategy::Force(ForceInterruptStrategy::Reboot) => {
|
InterruptStrategy::Force(ForceInterruptStrategy::Reboot) => {
|
||||||
mark.reboot_strategy = Some(strategy);
|
mark.reboot_strategy = Some(strategy);
|
||||||
prepare_reboot(serde_json::to_string(&mark)?)?;
|
prepare_reboot(serde_json::to_string(&mark)?)?;
|
||||||
// This is a forced reboot - no syncing of the filesystem.
|
// This is a forced reboot - no syncing of the filesystem.
|
||||||
bash!("reboot -ff")?;
|
cmd!(sh, "reboot -ff").run()?;
|
||||||
std::thread::sleep(time::Duration::from_secs(60));
|
std::thread::sleep(time::Duration::from_secs(60));
|
||||||
// Shouldn't happen
|
// Shouldn't happen
|
||||||
anyhow::bail!("failed to reboot");
|
anyhow::bail!("failed to reboot");
|
||||||
@ -536,11 +540,15 @@ fn impl_transaction_test<M: AsRef<str>>(
|
|||||||
// We either rebooted, or failed to reboot
|
// We either rebooted, or failed to reboot
|
||||||
}
|
}
|
||||||
InterruptStrategy::Polite(PoliteInterruptStrategy::Stop) => {
|
InterruptStrategy::Polite(PoliteInterruptStrategy::Stop) => {
|
||||||
bash!(
|
cmd!(sh, "systemctl stop rpm-ostreed")
|
||||||
"systemctl stop rpm-ostreed || true
|
.ignore_status()
|
||||||
systemctl stop ostree-finalize-staged || true
|
.run()?;
|
||||||
systemctl stop ostree-finalize-staged-hold || true"
|
cmd!(sh, "systemctl stop ostree-finalize-staged")
|
||||||
)?;
|
.ignore_status()
|
||||||
|
.run()?;
|
||||||
|
cmd!(sh, "systemctl stop ostree-finalize-staged-hold")
|
||||||
|
.ignore_status()
|
||||||
|
.run()?;
|
||||||
live_strategy = Some(strategy);
|
live_strategy = Some(strategy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -637,7 +645,7 @@ pub(crate) fn itest_transactionality() -> Result<()> {
|
|||||||
let mut f = std::io::BufWriter::new(std::fs::File::create(&TDATAPATH)?);
|
let mut f = std::io::BufWriter::new(std::fs::File::create(&TDATAPATH)?);
|
||||||
serde_json::to_writer(&mut f, &tdata)?;
|
serde_json::to_writer(&mut f, &tdata)?;
|
||||||
f.flush()?;
|
f.flush()?;
|
||||||
bash!("rpm-ostree status")?;
|
cmd!(sh, "rpm-ostree status").run()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let tdata = {
|
let tdata = {
|
||||||
|
Loading…
Reference in New Issue
Block a user