tests/kolainst/staged-deploy: parse rpm-ostree status --json instead

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
This commit is contained in:
Jonathan Lebon 2022-08-15 17:50:11 -04:00
parent 93e47f88f4
commit 84670a0070

View File

@ -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