tests/inst: Update rpm-ostree client

This commit is contained in:
Colin Walters committed 2021-04-07 18:00:57 +00:00
1 parent 642dcd10ef
commit 2628637a78
2 files changed
+9 -5

No files matched your search

+8 -3
View File
@@ -244,6 +244,11 @@ impl CommitStates {
}
}
fn query_status() -> Result<rpmostree_client::Status> {
let client = rpmostree_client::CliClient::new("ostreetest");
rpmostree_client::query_status(&client).map_err(anyhow::Error::msg)
}
/// In the case where we've entered via a reboot, this function
/// checks the state of things, and also generates a new update
/// if everything was successful.
@@ -255,7 +260,7 @@ fn parse_and_validate_reboot_mark<M: AsRef<str>>(
let mut mark: RebootMark = serde_json::from_str(markstr)
.with_context(|| format!("Failed to parse reboot mark {:?}", markstr))?;
// The first failed reboot may be into the original booted commit
let status = rpmostree_client::query_status().map_err(anyhow::Error::msg)?;
let status = query_status()?;
let firstdeploy = &status.deployments[0];
// The first deployment should not be staged
assert!(!firstdeploy.staged.unwrap_or(false));
@@ -315,7 +320,7 @@ fn validate_pending_commit(pending_commit: &str, commitstates: &CommitStates) ->
/// In the case where we did a kill -9 of rpm-ostree, check the state
fn validate_live_interrupted_upgrade(commitstates: &CommitStates) -> Result<UpdateResult> {
let status = rpmostree_client::query_status().map_err(anyhow::Error::msg)?;
let status = query_status()?;
let firstdeploy = &status.deployments[0];
let pending_commit = firstdeploy.checksum.as_str();
let res = if firstdeploy.staged.unwrap_or(false) {
@@ -484,7 +489,7 @@ fn impl_transaction_test<M: AsRef<str>>(
} else {
live_strategy = Some(strategy);
}
let status = rpmostree_client::query_status().map_err(anyhow::Error::msg)?;
let status = query_status()?;
let firstdeploy = &status.deployments[0];
let pending_commit = firstdeploy.checksum.as_str();
validate_pending_commit(pending_commit, &commitstates)