From 0614e5a9e836ec9eab64d8c25d5d2fa14b72d6a8 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 5 May 2023 10:57:25 -0400 Subject: [PATCH] Print previous version too when updating Keep current format to avoid having to update Fedora CoreOS tests as well. Based on: https://github.com/coreos/bootupd/pull/472 Co-authored-by: Colin Walters Closes: https://github.com/coreos/bootupd/issues/445 --- src/bootupd.rs | 3 ++- tests/e2e-update/e2e-update-in-vm.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bootupd.rs b/src/bootupd.rs index 0835fa23..be218b79 100644 --- a/src/bootupd.rs +++ b/src/bootupd.rs @@ -431,7 +431,7 @@ pub(crate) fn client_run_update(c: &mut ipc::ClientToDaemonConnection) -> Result continue; } ComponentUpdateResult::Updated { - previous: _, + previous, interrupted, new, } => { @@ -441,6 +441,7 @@ pub(crate) fn client_run_update(c: &mut ipc::ClientToDaemonConnection) -> Result i.version, ); } + println!("Previous {}: {}", name, previous.version); println!("Updated {}: {}", name, new.version); } } diff --git a/tests/e2e-update/e2e-update-in-vm.sh b/tests/e2e-update/e2e-update-in-vm.sh index 17919f99..5003be6f 100755 --- a/tests/e2e-update/e2e-update-in-vm.sh +++ b/tests/e2e-update/e2e-update-in-vm.sh @@ -68,6 +68,7 @@ tmpefimount=$(mount_tmp_efi) assert_not_has_file ${tmpefimount}/EFI/fedora/test-bootupd.efi bootupctl update | tee out.txt +assert_file_has_content out.txt "Previous EFI: ${TARGET_GRUB_PKG}.*,test-bootupd-payload-1.0" assert_file_has_content out.txt "Updated EFI: ${TARGET_GRUB_PKG}.*,test-bootupd-payload-1.0" assert_file_has_content ${tmpefimount}/EFI/fedora/test-bootupd.efi test-payload