From 04505570409003b3b1efd0be9694eeaccd0010bb Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 Jul 2026 13:11:36 +0100 Subject: [PATCH] test: Add a simple test for listing target versions in sysupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’m about to refactor it slightly and it would be nice to have a little test coverage to check against. (cherry picked from commit 8433ed1c7a66ee575621cde027a890017769252c) --- test/units/TEST-72-SYSUPDATE.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/units/TEST-72-SYSUPDATE.sh b/test/units/TEST-72-SYSUPDATE.sh index 63c4136022..8518aa7910 100755 --- a/test/units/TEST-72-SYSUPDATE.sh +++ b/test/units/TEST-72-SYSUPDATE.sh @@ -692,6 +692,10 @@ EOF exit 1 fi + # Check that the target versions are listed correctly. + [[ $( "$SYSUPDATE" --verify=no --json=short list | jq -cr '.all') == '["v9","v8","v7","v6","v5","v3","v2","v1"]' ]] + [[ $( "$SYSUPDATE" --verify=no --offline --json=short list | jq -cr '.all') == '["v9","v8","v7","v6"]' ]] + # Cleanup [[ -b "$blockdev" ]] && losetup --detach "$blockdev" rm "$BACKING_FILE"