summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2021-04-07 17:40:26 +0000
committerColin Walters <walters@verbum.org>2021-04-07 18:00:57 +0000
commit2628637a78614559fac48cc113f3ee81038a9539 (patch)
treee0726e9898033c42ef839550866785186eb3d15c
parent642dcd10efabb60763a465eb6babf9bafe7f0d90 (diff)
downloadostree-2628637a78614559fac48cc113f3ee81038a9539.tar.gz
tests/inst: Update rpm-ostree client
-rw-r--r--tests/inst/Cargo.toml3
-rw-r--r--tests/inst/src/destructive.rs11
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/inst/Cargo.toml b/tests/inst/Cargo.toml
index 65252330..99ab4e8e 100644
--- a/tests/inst/Cargo.toml
+++ b/tests/inst/Cargo.toml
@@ -38,8 +38,7 @@ openat = "0.1.19"
openat-ext = "0.1.4"
nix = "0.17.0"
# See discussion in https://github.com/coreos/rpm-ostree/pull/2569#issuecomment-780569188
-# Currently pinned to a hash, but after the next stable release let's switch to tags
-rpmostree-client = { git = "https://github.com/coreos/rpm-ostree", rev = "170095bd60ec8802afeea42d120fb2e88298648f" }
+rpmostree-client = { git = "https://github.com/coreos/rpm-ostree", tag = "v2021.3" }
# This one I might publish to crates.io, not sure yet
with-procspawn-tempdir = { git = "https://github.com/cgwalters/with-procspawn-tempdir" }
diff --git a/tests/inst/src/destructive.rs b/tests/inst/src/destructive.rs
index 26dba6b2..562e1aed 100644
--- a/tests/inst/src/destructive.rs
+++ b/tests/inst/src/destructive.rs
@@ -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)