Update to sh-inline 0.2
authorColin Walters <walters@verbum.org>
Fri, 11 Mar 2022 20:37:15 +0000 (15:37 -0500)
committerColin Walters <walters@verbum.org>
Mon, 14 Mar 2022 13:54:48 +0000 (09:54 -0400)
Syncing up with the latest.

tests/inst/Cargo.toml
tests/inst/src/destructive.rs
tests/inst/src/repobin.rs
tests/inst/src/treegen.rs

index 3735c1d5e125bedecd8eb9f65a60614f04df4bfc..70e56dc585d579d8a1e7ab09f185cf2a6881ebb2 100644 (file)
@@ -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" }
index 98e1c6878a4a804889a1a9ed165dc2da0f7477d4..352ee6d53e6b0b797833ae5fed1cbd33da750639 100644 (file)
@@ -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<M: AsRef<str>>(
 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<M: AsRef<str>>(
             "
             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,
index 582b02909d668dc981caef2db546fa83200d7d29..4048b76a4291a50c23f861248690f2a4b965a6c6 100644 (file)
@@ -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(),
index 2ec4e8492738762c2aaad2edb0569082295acd96..b6a3a70401ce7f8146ccbff72b182fa4e6331ad6 100644 (file)
@@ -140,7 +140,7 @@ pub(crate) fn update_os_tree<P: AsRef<Path>>(
     }
     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")?;