blob: 98cb984f9673b17fa57506e9d1954b00afec7b1f [file] [log] [blame] [view]
Joshua Pawlicki4a1d3f32022-10-28 16:43:581# Chromium Updater Test Plan
2
3This is the test plan for
4[Chromium Updater](https://source.chromium.org/chromium/chromium/src/+/main:chrome/updater/).
5
6It should be read in conjunction with the
7[functional specification](functional_spec.md) to assess functional coverage.
8
9## Bots & Test Dimensions
10The updater is covered by CQ and CI bots; the
11[CI console](https://ci.chromium.org/p/chromium/g/chromium.updater/console)
12shows the bots on which updater tests are run.
13
14Except where noted, the updater's behavior is consistent across platforms and
15is tested on macOS and Windows.
16
17The updater may run at system-wide or per-user scope. The `updater_tests`
18binary contains all user-scope tests, and the `updater_tests_system` binary
19contains all system-scope tests. Except where otherwise noted, tests appear in
20both binaries.
21
22On macOS, `updater_tests_system` requires passwordless `sudo` to operate. In
23local tests, this can usually be achieved by running `sudo echo;` before
24running the tests. Updater bots running `updater_tests_system` have specifically
25had passwordless sudo enabled.
26
27On Windows, both UAC-enabled and normal Chromium configurations are tested.
28
29## Test Binaries
30To secure updates, the updater contains pinned public keys and update URLs.
31This presents a challenge for testing, since the corresponding private keys
32cannot be exposed to test infrastructure. The build system produces both a real
33updater binary for distribution, and a "test" binary that is similar but with
34extra test hooks compiled in. All tests use the test binary.
35
36## Old Binaries
37The updater updates itself. Covering this ability with tests presents a unique
38challenge, since multiple versions of the updater have to be available to the
39test. To support such tests, old versions of the updater are available in CIPD
Joanna Wang75ad0142024-06-11 16:01:5840and brought into the tree using `//DEPS` at `//third_party/updater/*/cipd`.
Joshua Pawlicki4a1d3f32022-10-28 16:43:5841
42## Unit Testing
43Much of the functionality of the updater is covered by unit testing. Unit tests
44are defined in files ending in `(module)_test.*` in the source tree.
45
46## Integration Testing
47Integration tests cover the end-to-end behavior of the updater. They typically
48rely on installing the updater, manipulating it, asserting on a result, and then
49uninstalling the updater.
50
51Because the integration tests actually install the updater, they usually don't
52work with (and therefore aren't compiled into) `is_component_build=true` builds,
53since component builds are generally not portable outside of the build output
54directory.
55
56Care must be taken when running the integration tests on a developer system,
57especially in the `is_chrome_branded=true` context, since the tests install and
58uninstall the updater, and attempt to leave the system clean (i.e. without any
59GoogleUpdater installation). This may prevent the developer's copy of Google
60Chrome (or other software) from being kept up to date.
61
62Integration tests for system-scoped updaters frequently have to perform actions
63at high privilege. This is accomplished by using an out-of-process test helper
64binary (`updater_integration_tests_helper`) that runs at high privilege
65(elevated via `sudo` on macOS). The helper binary run a gtest main so that the
66commands it handles can use gtest asserts.
67
68### Installation
S. Ganesh5e8cfff2022-11-23 13:30:5769IntegrationTest.Install tests that the updater can be installed on a clean OS,
70that it is immediately active after installation, and then can be cleanly
71uninstalled.
Joshua Pawlicki4a1d3f32022-10-28 16:43:5872
S. Ganesh1b1e7712022-12-15 23:57:3873IntegrationTest.Handoff tests that the updater can be installed on a clean OS,
74that it can install an app via a "/handoff" command line, and then can be
75cleanly uninstalled.
76
Joshua Pawlicki4a1d3f32022-10-28 16:43:5877Overinstall cases are tested by IntegrationTest.OverinstallWorking and
78IntegrationTest.OverinstallBroken, to ensure that the updater can be installed
79on an unclean OS, and as a post-condition of installation, the system has a
80working and active updater (although it may not be the version just installed).
81
82IntegrationTest.QualifyUpdater tests that the updater will perform its self-
83test and then activate itself after installation/update, if an older working
84instance of the updater is already present.
85
86IntegrationTest.MigrateLegacyUpdater tests that the updater will import data
87from legacy updaters (such as Omaha 3 or Keystone) when activating.
88
89IntegrationTest.RecoveryNoUpdater tests that the recovery component
90implementation can install and activate the updater on a machine where no
91updater exists.
92
93IntegrationTest.OfflineInstall, IntegrationTest.SilentOfflineInstall, and
S. Ganesh5e8cfff2022-11-23 13:30:5794IntegrationTest.LegacySilentOfflineInstall test that the updater can handle
Joshua Pawlicki4a1d3f32022-10-28 16:43:5895handoffs from offline installers. *Windows Only*
96
97### Updates
98IntegrationTest.SelfUpdate tests that this version of the updater can run a
99fake update on itself.
100
101IntegrationTest.SelfUpdateFromOldReal tests that an older version of the updater
102can successfully update to this version of the updater, and that this version
103qualifies itself and activates.
104
105IntegrationTest.UpdateApp tests that the updater can run an update on a
106registered app.
107
108IntegrationTest.SameVersionUpdate tests that the updater can perform a same-
109versioned over-install of an application (such as in an installer context).
110
111IntegrationTest.InstallDataIndex tests that the updater can handle an install
112data index and transmit it to the server as part of the install request.
113
114IntegrationTest.ReportsActive tests that the updater transmits active telemetry
115for apps.
116
Joshua Pawlickicf7affe2022-11-03 19:04:35117IntegrationTest.RotateLog tests that the updater rotates its log file after the
118log file grows to a sufficient size.
119
Joshua Pawlicki4a1d3f32022-10-28 16:43:58120IntegrationTest.ForceInstallApp tests that the updater will install an app,
121when provided group policies that force installation of that app. *Windows Only*
122
123IntegrationTest.MultipleWakesOneNetRequest tests that even if the updater wakes
124often, it will only check for updates once (within the timeline of the test).
125
126IntegrationTest.MultipleUpdateAllsMultipleNetRequests tests that if the updater
127receives multiple commands to immediately check for updates, it does so (in
128contrast to multiple wake commands).
129
130IntegrationTest.LegacyUpdate3Web tests that the updater can be exercised using
131the legacy COM APIs. *Windows Only*
132
133IntegrationTest.UpdateServiceStress tests the IPC mechanisms to build confidence
134that the updater can be started frequently.
135
136### Services
137IntegrationTest.LegacyProcessLauncher tests that the updater's process launcher
138feature correctly launches a process when commanded to. *Windows Only*
139
140IntegrationTest.LegacyAppCommandWeb tests that the updater, when set up with
141an appropriate legacy app command and then commanded to run it, will do so.
142*Windows Only*
143
144IntegrationTest.LegacyPolicyStatus tests that the updater reports its policies
145using the legacy COM APIs. *Windows Only*
146
147IntegrationTest.UnregisterUnownedApp tests that the updater does not try to
148update applications owned by other users or scopes. *macOS Only*
149
150### Uninstallation
151IntegrationTest.SelfUninstallOutdatedUpdater tests that an old version of the
152updater removes itself after a new version of the updater has become active.
153
154IntegrationTest.UninstallCmdLine tests that running the updater's uninstall
155command uninstalls the updater only if the updater has been present for a
156minimum number of startups, in the case that no app has ever been installed.
157*Windows Only*
158
159IntegrationTest.UnregisterUninstalledApp tests that if an app has been
160uninstalled, the updater removes it from further update checks.
161
162IntegrationTest.UninstallIfMaxServerWakesBeforeRegistrationExceeded tests that
163the updater uninstalls itself if it has been present on the machine for a
164while but no other apps have been installed.
165
166IntegrationTest.UninstallUpdaterWhenAllAppsUninstalled tests that the updater
167uninstalls itself when it no longer has other apps to keep up to date.
168
169### Associated Tools
170Associated tools should be covered by unit tests.
171
172## Manual Testing
173No routine manual testing is planned.