tests/kolainst/staged-deploy: parse `rpm-ostree status --json` instead
authorJonathan Lebon <jonathan@jlebon.com>
Mon, 15 Aug 2022 21:50:11 +0000 (17:50 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Mon, 15 Aug 2022 21:50:11 +0000 (17:50 -0400)
Don't parse `rpm-ostree status` output, it's not meant for that. Use
`--json` output instead.

While we're here, fix an obsolete reference to Ansible.

Related: https://github.com/coreos/rpm-ostree/pull/3938

tests/kolainst/destructive/staged-deploy.sh

index af31078a6d61a788f5eb1e35da41cf36ba96cbc2..c923605f5fc6c1a90ef4c200396b312b8311d3de 100755 (executable)
@@ -100,8 +100,7 @@ EOF
     newcommit=$(ostree rev-parse staged-deploy)
     ostree admin upgrade --stage >out.txt
     test -f /run/ostree/staged-deployment
-    # Debating bouncing back out to Ansible for this
-    firstdeploycommit=$(rpm-ostree status |grep 'Commit:' |head -1|sed -e 's,^ *Commit: *,,')
+    firstdeploycommit=$(rpm-ostree status --json | jq -r .deployments[0].checksum)
     assert_streq "${firstdeploycommit}" "${newcommit}"
     # Cleanup
     rpm-ostree cleanup -rp