Skip to content

Commit

Permalink
tests/destructive: Port more to xshell
Browse files Browse the repository at this point in the history
Just keeping up momentum.
  • Loading branch information
cgwalters committed Aug 22, 2023
1 parent ee1e585 commit 91d4e3b
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions tests/inst/src/destructive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,18 +511,16 @@ fn impl_transaction_test<M: AsRef<str>>(
// the interrupt strategy.
match strategy {
InterruptStrategy::Force(ForceInterruptStrategy::Kill9) => {
bash!(
"systemctl kill -s KILL rpm-ostreed || true
systemctl kill -s KILL ostree-finalize-staged || true
systemctl kill -s KILL ostree-finalize-staged-hold || true"
)?;
cmd!(sh, "systemctl kill -s KILL rpm-ostreed").ignore_status().run()?;
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);
}
InterruptStrategy::Force(ForceInterruptStrategy::Reboot) => {
mark.reboot_strategy = Some(strategy);
prepare_reboot(serde_json::to_string(&mark)?)?;
// 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));
// Shouldn't happen
anyhow::bail!("failed to reboot");
Expand All @@ -536,11 +534,9 @@ fn impl_transaction_test<M: AsRef<str>>(
// We either rebooted, or failed to reboot
}
InterruptStrategy::Polite(PoliteInterruptStrategy::Stop) => {
bash!(
"systemctl stop rpm-ostreed || true
systemctl stop ostree-finalize-staged || true
systemctl stop ostree-finalize-staged-hold || true"
)?;
cmd!(sh, "systemctl stop rpm-ostreed").ignore_status().run()?;
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);
}
}
Expand Down Expand Up @@ -637,7 +633,7 @@ pub(crate) fn itest_transactionality() -> Result<()> {
let mut f = std::io::BufWriter::new(std::fs::File::create(&TDATAPATH)?);
serde_json::to_writer(&mut f, &tdata)?;
f.flush()?;
bash!("rpm-ostree status")?;
cmd!(sh, "rpm-ostree status").run()?;
}

let tdata = {
Expand Down

0 comments on commit 91d4e3b

Please sign in to comment.