From afdc84b97bb6571a3ff6a4e6bc2c320efb8afaf9 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 11 Mar 2022 15:37:15 -0500 Subject: [PATCH] Update to sh-inline 0.2 Syncing up with the latest. --- tests/inst/Cargo.toml | 2 +- tests/inst/src/destructive.rs | 24 ++++++++++++------------ tests/inst/src/repobin.rs | 12 ++++++------ tests/inst/src/treegen.rs | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/inst/Cargo.toml b/tests/inst/Cargo.toml index 3735c1d5..70e56dc5 100644 --- a/tests/inst/Cargo.toml +++ b/tests/inst/Cargo.toml @@ -14,7 +14,7 @@ structopt = "0.3" serde = "1.0.111" serde_derive = "1.0.111" serde_json = "1.0" -sh-inline = "0.1.0" +sh-inline = "0.2.0" anyhow = "1.0" tempfile = "3.1.0" ostree-ext = { version = "0.6.0" } diff --git a/tests/inst/src/destructive.rs b/tests/inst/src/destructive.rs index 98e1c687..352ee6d5 100644 --- a/tests/inst/src/destructive.rs +++ b/tests/inst/src/destructive.rs @@ -152,7 +152,7 @@ fn generate_update(commit: &str) -> Result<()> { // but traversing all the objects is expensive. So here we only prune 1/5 of the time. if rand::thread_rng().gen_ratio(1, 5) { bash!( - "ostree --repo={srvrepo} prune --refs-only --depth=1", + "ostree --repo=${srvrepo} prune --refs-only --depth=1", srvrepo = SRVREPO )?; } @@ -166,10 +166,10 @@ fn generate_update(commit: &str) -> Result<()> { fn generate_srv_repo(commit: &str) -> Result<()> { bash!( r#" - ostree --repo={srvrepo} init --mode=archive - ostree --repo={srvrepo} config set archive.zlib-level 1 - ostree --repo={srvrepo} pull-local /sysroot/ostree/repo {commit} - ostree --repo={srvrepo} refs --create={testref} {commit} + ostree --repo=${srvrepo} init --mode=archive + ostree --repo=${srvrepo} config set archive.zlib-level 1 + ostree --repo=${srvrepo} pull-local /sysroot/ostree/repo ${commit} + ostree --repo=${srvrepo} refs --create=${testref} ${commit} "#, srvrepo = SRVREPO, commit = commit, @@ -310,7 +310,7 @@ fn parse_and_validate_reboot_mark>( fn validate_pending_commit(pending_commit: &str, commitstates: &CommitStates) -> Result<()> { if pending_commit != commitstates.target { bash!("rpm-ostree status -v")?; - bash!("ostree show {pending_commit}", pending_commit)?; + bash!("ostree show ${pending_commit}", pending_commit)?; anyhow::bail!( "Expected target commit={} but pending={} ({:?})", commitstates.target, @@ -463,11 +463,11 @@ fn impl_transaction_test>( " systemctl stop rpm-ostreed systemctl stop ostree-finalize-staged - ostree reset testrepo:{testref} {booted_commit} + ostree reset testrepo:${testref} ${booted_commit} rpm-ostree cleanup -pbrm ", testref, - booted_commit, + booted_commit ) .with_context(|| { format!( @@ -571,7 +571,7 @@ pub(crate) fn itest_transactionality() -> Result<()> { let url = format!("http://{}", addr); bash!( "ostree remote delete --if-exists testrepo - ostree remote add --set=gpg-verify=false testrepo {url}", + ostree remote add --set=gpg-verify=false testrepo ${url}", url )?; @@ -589,9 +589,9 @@ pub(crate) fn itest_transactionality() -> Result<()> { let testref = TESTREF; bash!( " - ostree admin set-origin testrepo {url} {testref} - ostree refs --create testrepo:{testref} {commit} - ostree refs --create={origref} {commit} + ostree admin set-origin testrepo ${url} ${testref} + ostree refs --create testrepo:${testref} ${commit} + ostree refs --create=${origref} ${commit} ", url, origref, diff --git a/tests/inst/src/repobin.rs b/tests/inst/src/repobin.rs index 582b0290..4048b76a 100644 --- a/tests/inst/src/repobin.rs +++ b/tests/inst/src/repobin.rs @@ -72,14 +72,14 @@ pub(crate) fn itest_pull_basicauth() -> Result<()> { let osroot = Path::new("osroot"); crate::treegen::mkroot(&osroot)?; bash!( - r#"ostree --repo={serverrepo} init --mode=archive - ostree --repo={serverrepo} commit -b os --tree=dir={osroot} >/dev/null + r#"ostree --repo=${serverrepo} init --mode=archive + ostree --repo=${serverrepo} commit -b os --tree=dir=${osroot} >/dev/null mkdir client cd client ostree --repo=repo init --mode=archive - ostree --repo=repo remote add --set=gpg-verify=false origin-unauth {baseuri} - ostree --repo=repo remote add --set=gpg-verify=false origin-badauth {unauthuri} - ostree --repo=repo remote add --set=gpg-verify=false origin-goodauth {authuri} + ostree --repo=repo remote add --set=gpg-verify=false origin-unauth ${baseuri} + ostree --repo=repo remote add --set=gpg-verify=false origin-badauth ${unauthuri} + ostree --repo=repo remote add --set=gpg-verify=false origin-goodauth ${authuri} "#, osroot = osroot, serverrepo = serverrepo, @@ -90,7 +90,7 @@ pub(crate) fn itest_pull_basicauth() -> Result<()> { for rem in &["unauth", "badauth"] { cmd_fails_with( bash_command!( - r#"ostree --repo=client/repo pull origin-{rem} os >/dev/null"#, + r#"ostree --repo=client/repo pull origin-${rem} os >/dev/null"#, rem = *rem ) .unwrap(), diff --git a/tests/inst/src/treegen.rs b/tests/inst/src/treegen.rs index 2ec4e849..b6a3a704 100644 --- a/tests/inst/src/treegen.rs +++ b/tests/inst/src/treegen.rs @@ -140,7 +140,7 @@ pub(crate) fn update_os_tree>( } assert!(mutated > 0); println!("Mutated ELF files: {}", mutated); - bash!("ostree --repo={repo} commit --consume -b {ostref} --base={ostref} --tree=dir={tempdir} --owner-uid 0 --owner-gid 0 --selinux-policy-from-base --link-checkout-speedup --no-bindings --no-xattrs", + bash!("ostree --repo=${repo} commit --consume -b ${ostref} --base=${ostref} --tree=dir=${tempdir} --owner-uid 0 --owner-gid 0 --selinux-policy-from-base --link-checkout-speedup --no-bindings --no-xattrs", repo = repo_path, ostref = ostref, tempdir = tempdir.path()).context("Failed to commit updated content")?;