From 4dd80a8b9cb613e0b0826a2bc3657f0caf0f60ae Mon Sep 17 00:00:00 2001 From: Kelvin Fan Date: Tue, 2 Feb 2021 13:58:15 -0500 Subject: [PATCH] app/status: Use `AutomaticUpdatesDriver` if updates driven by external driver When automatic updates are driven by an external driver like Zincati, display e.g. `AutomaticUpdatesDriver: Zincati` instead of `AutomaticUpdates: driven by Zincati`, since the latter might suggest it is rpm-ostree's own built-in support for automatic updates. --- src/app/rpmostree-builtin-status.cxx | 4 ++-- tests/vmcheck/test-misc-2.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/rpmostree-builtin-status.cxx b/src/app/rpmostree-builtin-status.cxx index c0e55c51..32d13919 100644 --- a/src/app/rpmostree-builtin-status.cxx +++ b/src/app/rpmostree-builtin-status.cxx @@ -375,10 +375,10 @@ print_daemon_state (RPMOSTreeSysroot *sysroot_proxy, if (update_driver_name && update_driver_sd_unit) { if (opt_verbose) - g_print ("AutomaticUpdates: driven by %s (%s)\n", + g_print ("AutomaticUpdatesDriver: %s (%s)\n", update_driver_name, update_driver_sd_unit); else - g_print ("AutomaticUpdates: driven by %s\n", update_driver_name); + g_print ("AutomaticUpdatesDriver: %s\n", update_driver_name); /* only try to get unit's StatusText if we're on the system bus */ if (bus_type == G_BUS_TYPE_SYSTEM) diff --git a/tests/vmcheck/test-misc-2.sh b/tests/vmcheck/test-misc-2.sh index 9870ce2f..46da3771 100755 --- a/tests/vmcheck/test-misc-2.sh +++ b/tests/vmcheck/test-misc-2.sh @@ -61,9 +61,9 @@ assert_file_has_content agent.txt testing-agent-id vm_cmd journalctl --after-cursor "'$cursor'" -u rpm-ostreed -o json | jq -r '.AGENT_SD_UNIT//""' > agent_sd_unit.txt assert_file_has_content agent_sd_unit.txt sshd.service vm_cmd rpm-ostree status > status.txt -assert_file_has_content status.txt 'driven by TestDriver' +assert_file_has_content status.txt 'AutomaticUpdatesDriver: TestDriver' vm_cmd rpm-ostree status -v > verbose_status.txt -assert_file_has_content verbose_status.txt 'driven by TestDriver (sshd.service)' +assert_file_has_content verbose_status.txt 'AutomaticUpdatesDriver: TestDriver (sshd.service)' assert_file_has_content verbose_status.txt ' DriverState: active' vm_assert_status_jq ".\"update-driver\"[\"driver-name\"] == \"TestDriver\"" \ ".\"update-driver\"[\"driver-sd-unit\"] == \"sshd.service\"" @@ -77,9 +77,9 @@ vm_cmd rpm-ostree deploy \'\' \ --register-driver=OtherTestDriver vm_cmd test -f /run/rpm-ostree/update-driver.gv vm_cmd rpm-ostree status > status.txt -assert_file_has_content status.txt 'driven by OtherTestDriver' +assert_file_has_content status.txt 'AutomaticUpdatesDriver: OtherTestDriver' vm_cmd rpm-ostree status -v > verbose_status.txt -assert_file_has_content verbose_status.txt 'driven by OtherTestDriver (sshd.service)' +assert_file_has_content verbose_status.txt 'AutomaticUpdatesDriver: OtherTestDriver (sshd.service)' vm_assert_status_jq ".\"update-driver\"[\"driver-name\"] == \"OtherTestDriver\"" \ ".\"update-driver\"[\"driver-sd-unit\"] == \"sshd.service\"" echo "ok deploy --register-driver with empty string revision"