0
Files
android_webview
apps
ash
base
build
build_overrides
buildtools
cc
chrome
chromecast
chromeos
clank
codelabs
components
content
courgette
crypto
dbus
device
docs
accessibility
autofill
design
enterprise
experiments
fuchsia
gpu
images
infra
intl
ios
lacros
linux
login
mac
media
memory
memory-infra
patterns
privacy
privacy_budget
process
security
speed
speed_metrics
standards
telemetry_extension
testing
transcripts
ui
updater
images
DIR_METADATA
OWNERS
cup.md
design_doc.md
dev_manual.md
functional_spec.md
installer_api_mac.md
protocol_3_1.md
test_migration_instructions.md
test_plan.md
user_manual.md
webapps
website
workflow
DIR_METADATA
OWNERS
README.md
accessibility.md
ad_tagging.md
adding_to_third_party.md
android_accessing_cpp_enums_in_java.md
android_accessing_cpp_features_in_java.md
android_accessing_cpp_switches_in_java.md
android_build_instructions.md
android_cast_build_instructions.md
android_debugging_instructions.md
android_dynamic_feature_modules.md
android_emulator.md
android_isolated_splits.md
android_jni_ownership_best_practices.md
android_logging.md
android_native_libraries.md
android_studio.md
angle_in_chromium.md
api_keys.md
asan.md
atom.md
benchmark_performance_regressions.md
bitmap_pipeline.md
branch_gardener.md
building_old_revisions.md
callback.md
ccache_mac.md
chrome_os_logging.md
chrome_settings.md
chrome_untrusted.md
chromedriver_status.md
chromeos_build_instructions.md
chromeos_glossary.md
chromium_browser_vs_google_chrome.md
cipd_and_3pp.md
cl_respect.md
cl_tips.md
clang.md
clang_code_coverage_wrapper.md
clang_format.md
clang_gardening.md
clang_sheriffing.md
clang_static_analyzer.md
clang_tidy.md
clang_tool_refactoring.md
clangd.md
clion.md
closure_compilation.md
cocoa_tips_and_tricks.md
code_review_owners.md
code_reviews.md
commit_checklist.md
component_build.md
configuration.md
contributing.md
cq_fault_attribution.md
cr_respect.md
cr_user_manual.md
cross_platform_ui.md
cygwin_dll_remapping_failure.md
dangling_ptr.md
dangling_ptr_guide.md
dbus_mojo_connection_service.md
debugging_with_crash_keys.md
dependencies.md
deterministic_builds.md
disassemble_code.md
documentation_best_practices.md
documentation_guidelines.md
early-hints.md
eclipse.md
emacs.md
erc_irc.md
flag_expiry.md
flag_guarding_guidelines.md
flag_ownership.md
frame_trees.md
gardener.md
gdbinit.md
get_the_code.md
git_cookbook.md
git_submodules.md
git_tips.md
google_chrome_branded_builds.md
google_play_services.md
graphical_debugging_aid_chromium_views.md
gwp_asan.md
history_manipulation_intervention.md
how_cc_works.md
how_to_add_your_feature_flag.md
how_to_extend_web_test_framework.md
idn.md
initialize_blink_features.md
inlined_stack_traces.md
installation_at_vmware.md
ios_build_instructions.md
ios_infra.md
ios_voiceover.md
kiosk_mode.md
lacros.md
life_of_a_frame.md
lldbinit.md
mac_arm64.md
mac_build_instructions.md
mac_lld.md
modifying_session_history_serialization.md
mojo_and_services.md
mojo_ipc_conversion.md
mojo_testing.md
native_relocations.md
navbar.md
navigation-request-navigation-state.gv
navigation-request-navigation-state.png
navigation.md
navigation_concepts.md
network_traffic_annotations.md
no_sources_assignment_filter.md
optimizing_web_uis.md
origin_trials_integration.md
ozone_overview.md
parsing_test_results.md
pgo.md
piranha_plant.md
process_model_and_site_isolation.md
profiling.md
profiling_content_shell_on_android.md
proxy_auto_config.md
qtcreator.md
release_branch_guidance.md
render-frame-host-lifecycle-state.gv
render-frame-host-lifecycle-state.png
render_document.md
rust.md
seccomp_sandbox_crash_dumping.md
servicification.md
session_history.md
sheriff.md
shutdown.md
special_case_urls.md
static_initializers.md
sublime_ide.md
system_hardening_features.md
tab_helpers.md
testing_webui.md
threading_and_tasks.md
threading_and_tasks_faq.md
threading_and_tasks_testing.md
toolchain_support.md
tour_of_luci_ui.md
tpm_quick_ref.md
translation_screenshots.md
trusted_types_on_webui.md
updating_clang.md
updating_clang_format_binaries.md
use_counter_wiki.md
useful_urls.md
user_data_dir.md
user_data_storage.md
user_handle_mapping.md
vanilla_msysgit_workflow.md
vscode.md
vscode_python.md
webui_build_configuration.md
webui_explainer.md
webui_in_chrome.md
webui_in_components.md
webview_policies.md
win_cross.md
win_order_files.md
windows_build_instructions.md
windows_native_window_occlusion_tracking.md
windows_pwa_integration.md
windows_shortcut_and_taskbar_handling.md
windows_split_dll.md
windows_virtual_desktop_handling.md
wmax_tokens.md
working_remotely_with_android.md
writing_clang_plugins.md
extensions
fuchsia_web
gin
google_apis
google_update
gpu
headless
infra
internal
ios
ios_internal
ipc
media
mojo
native_client
native_client_sdk
net
pdf
ppapi
printing
remoting
rlz
sandbox
services
signing_keys
skia
sql
storage
styleguide
testing
third_party
tools
ui
url
v8
webkit
.clang-format
.clang-tidy
.clangd
.eslintrc.js
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitmodules
.gn
.mailmap
.rustfmt.toml
.vpython3
.yapfignore
ATL_OWNERS
AUTHORS
BUILD.gn
CODE_OF_CONDUCT.md
DEPS
DIR_METADATA
LICENSE
LICENSE.chromium_os
OWNERS
PRESUBMIT.py
PRESUBMIT_test.py
PRESUBMIT_test_mocks.py
README.md
WATCHLISTS
codereview.settings
src/docs/updater/test_plan.md
S. Ganesh 1b1e771923 Fix Handoff from Omaha to O4 fails
The updater scope was not taking the legacy command line format into
account, now fixed by determining the scope using the legacy-compatible
command line.

Added integration tests.

Bug: 1379746
Change-Id: I42386daf3276156ab34e6ac17094b0b6439a8898
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4111693
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Commit-Queue: S Ganesh <ganesh@chromium.org>
Auto-Submit: S Ganesh <ganesh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1084071}
2022-12-15 23:57:38 +00:00

7.7 KiB

Chromium Updater Test Plan

This is the test plan for Chromium Updater.

It should be read in conjunction with the functional specification to assess functional coverage.

Bots & Test Dimensions

The updater is covered by CQ and CI bots; the CI console shows the bots on which updater tests are run.

Except where noted, the updater's behavior is consistent across platforms and is tested on macOS and Windows.

The updater may run at system-wide or per-user scope. The updater_tests binary contains all user-scope tests, and the updater_tests_system binary contains all system-scope tests. Except where otherwise noted, tests appear in both binaries.

On macOS, updater_tests_system requires passwordless sudo to operate. In local tests, this can usually be achieved by running sudo echo; before running the tests. Updater bots running updater_tests_system have specifically had passwordless sudo enabled.

On Windows, both UAC-enabled and normal Chromium configurations are tested.

Test Binaries

To secure updates, the updater contains pinned public keys and update URLs. This presents a challenge for testing, since the corresponding private keys cannot be exposed to test infrastructure. The build system produces both a real updater binary for distribution, and a "test" binary that is similar but with extra test hooks compiled in. All tests use the test binary.

Old Binaries

The updater updates itself. Covering this ability with tests presents a unique challenge, since multiple versions of the updater have to be available to the test. To support such tests, old versions of the updater are available in CIPD and brought into the tree using //DEPS at //third_party/updater.

Unit Testing

Much of the functionality of the updater is covered by unit testing. Unit tests are defined in files ending in (module)_test.* in the source tree.

Integration Testing

Integration tests cover the end-to-end behavior of the updater. They typically rely on installing the updater, manipulating it, asserting on a result, and then uninstalling the updater.

Because the integration tests actually install the updater, they usually don't work with (and therefore aren't compiled into) is_component_build=true builds, since component builds are generally not portable outside of the build output directory.

Care must be taken when running the integration tests on a developer system, especially in the is_chrome_branded=true context, since the tests install and uninstall the updater, and attempt to leave the system clean (i.e. without any GoogleUpdater installation). This may prevent the developer's copy of Google Chrome (or other software) from being kept up to date.

Integration tests for system-scoped updaters frequently have to perform actions at high privilege. This is accomplished by using an out-of-process test helper binary (updater_integration_tests_helper) that runs at high privilege (elevated via sudo on macOS). The helper binary run a gtest main so that the commands it handles can use gtest asserts.

Installation

IntegrationTest.Install tests that the updater can be installed on a clean OS, that it is immediately active after installation, and then can be cleanly uninstalled.

IntegrationTest.Handoff tests that the updater can be installed on a clean OS, that it can install an app via a "/handoff" command line, and then can be cleanly uninstalled.

Overinstall cases are tested by IntegrationTest.OverinstallWorking and IntegrationTest.OverinstallBroken, to ensure that the updater can be installed on an unclean OS, and as a post-condition of installation, the system has a working and active updater (although it may not be the version just installed).

IntegrationTest.QualifyUpdater tests that the updater will perform its self- test and then activate itself after installation/update, if an older working instance of the updater is already present.

IntegrationTest.MigrateLegacyUpdater tests that the updater will import data from legacy updaters (such as Omaha 3 or Keystone) when activating.

IntegrationTest.RecoveryNoUpdater tests that the recovery component implementation can install and activate the updater on a machine where no updater exists.

IntegrationTest.OfflineInstall, IntegrationTest.SilentOfflineInstall, and IntegrationTest.LegacySilentOfflineInstall test that the updater can handle handoffs from offline installers. Windows Only

Updates

IntegrationTest.SelfUpdate tests that this version of the updater can run a fake update on itself.

IntegrationTest.SelfUpdateFromOldReal tests that an older version of the updater can successfully update to this version of the updater, and that this version qualifies itself and activates.

IntegrationTest.UpdateApp tests that the updater can run an update on a registered app.

IntegrationTest.SameVersionUpdate tests that the updater can perform a same- versioned over-install of an application (such as in an installer context).

IntegrationTest.InstallDataIndex tests that the updater can handle an install data index and transmit it to the server as part of the install request.

IntegrationTest.ReportsActive tests that the updater transmits active telemetry for apps.

IntegrationTest.RotateLog tests that the updater rotates its log file after the log file grows to a sufficient size.

IntegrationTest.ForceInstallApp tests that the updater will install an app, when provided group policies that force installation of that app. Windows Only

IntegrationTest.MultipleWakesOneNetRequest tests that even if the updater wakes often, it will only check for updates once (within the timeline of the test).

IntegrationTest.MultipleUpdateAllsMultipleNetRequests tests that if the updater receives multiple commands to immediately check for updates, it does so (in contrast to multiple wake commands).

IntegrationTest.LegacyUpdate3Web tests that the updater can be exercised using the legacy COM APIs. Windows Only

IntegrationTest.UpdateServiceStress tests the IPC mechanisms to build confidence that the updater can be started frequently.

Services

IntegrationTest.LegacyProcessLauncher tests that the updater's process launcher feature correctly launches a process when commanded to. Windows Only

IntegrationTest.LegacyAppCommandWeb tests that the updater, when set up with an appropriate legacy app command and then commanded to run it, will do so. Windows Only

IntegrationTest.LegacyPolicyStatus tests that the updater reports its policies using the legacy COM APIs. Windows Only

IntegrationTest.UnregisterUnownedApp tests that the updater does not try to update applications owned by other users or scopes. macOS Only

Uninstallation

IntegrationTest.SelfUninstallOutdatedUpdater tests that an old version of the updater removes itself after a new version of the updater has become active.

IntegrationTest.UninstallCmdLine tests that running the updater's uninstall command uninstalls the updater only if the updater has been present for a minimum number of startups, in the case that no app has ever been installed. Windows Only

IntegrationTest.UnregisterUninstalledApp tests that if an app has been uninstalled, the updater removes it from further update checks.

IntegrationTest.UninstallIfMaxServerWakesBeforeRegistrationExceeded tests that the updater uninstalls itself if it has been present on the machine for a while but no other apps have been installed.

IntegrationTest.UninstallUpdaterWhenAllAppsUninstalled tests that the updater uninstalls itself when it no longer has other apps to keep up to date.

Associated Tools

Associated tools should be covered by unit tests.

Manual Testing

No routine manual testing is planned.