blob: 6f757df9729120feb8fbd31164846e83db9199d2 [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
40and brought into the tree using `//DEPS` at `//third_party/updater`.
41
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
69IntegrationTest.InstallUninstall tests that the updater can be installed on a
70clean OS, that it is immediately active after installation, and then can be
71cleanly uninstalled.
72
73Overinstall cases are tested by IntegrationTest.OverinstallWorking and
74IntegrationTest.OverinstallBroken, to ensure that the updater can be installed
75on an unclean OS, and as a post-condition of installation, the system has a
76working and active updater (although it may not be the version just installed).
77
78IntegrationTest.QualifyUpdater tests that the updater will perform its self-
79test and then activate itself after installation/update, if an older working
80instance of the updater is already present.
81
82IntegrationTest.MigrateLegacyUpdater tests that the updater will import data
83from legacy updaters (such as Omaha 3 or Keystone) when activating.
84
85IntegrationTest.RecoveryNoUpdater tests that the recovery component
86implementation can install and activate the updater on a machine where no
87updater exists.
88
89IntegrationTest.OfflineInstall, IntegrationTest.SilentOfflineInstall, and
90IntegrationTest.LegacySilentOfflineInstall test that the updater can handle
91handoffs from offline installers. *Windows Only*
92
93### Updates
94IntegrationTest.SelfUpdate tests that this version of the updater can run a
95fake update on itself.
96
97IntegrationTest.SelfUpdateFromOldReal tests that an older version of the updater
98can successfully update to this version of the updater, and that this version
99qualifies itself and activates.
100
101IntegrationTest.UpdateApp tests that the updater can run an update on a
102registered app.
103
104IntegrationTest.SameVersionUpdate tests that the updater can perform a same-
105versioned over-install of an application (such as in an installer context).
106
107IntegrationTest.InstallDataIndex tests that the updater can handle an install
108data index and transmit it to the server as part of the install request.
109
110IntegrationTest.ReportsActive tests that the updater transmits active telemetry
111for apps.
112
Joshua Pawlickicf7affe2022-11-03 19:04:35113IntegrationTest.RotateLog tests that the updater rotates its log file after the
114log file grows to a sufficient size.
115
Joshua Pawlicki4a1d3f32022-10-28 16:43:58116IntegrationTest.ForceInstallApp tests that the updater will install an app,
117when provided group policies that force installation of that app. *Windows Only*
118
119IntegrationTest.MultipleWakesOneNetRequest tests that even if the updater wakes
120often, it will only check for updates once (within the timeline of the test).
121
122IntegrationTest.MultipleUpdateAllsMultipleNetRequests tests that if the updater
123receives multiple commands to immediately check for updates, it does so (in
124contrast to multiple wake commands).
125
126IntegrationTest.LegacyUpdate3Web tests that the updater can be exercised using
127the legacy COM APIs. *Windows Only*
128
129IntegrationTest.UpdateServiceStress tests the IPC mechanisms to build confidence
130that the updater can be started frequently.
131
132### Services
133IntegrationTest.LegacyProcessLauncher tests that the updater's process launcher
134feature correctly launches a process when commanded to. *Windows Only*
135
136IntegrationTest.LegacyAppCommandWeb tests that the updater, when set up with
137an appropriate legacy app command and then commanded to run it, will do so.
138*Windows Only*
139
140IntegrationTest.LegacyPolicyStatus tests that the updater reports its policies
141using the legacy COM APIs. *Windows Only*
142
143IntegrationTest.UnregisterUnownedApp tests that the updater does not try to
144update applications owned by other users or scopes. *macOS Only*
145
146### Uninstallation
147IntegrationTest.SelfUninstallOutdatedUpdater tests that an old version of the
148updater removes itself after a new version of the updater has become active.
149
150IntegrationTest.UninstallCmdLine tests that running the updater's uninstall
151command uninstalls the updater only if the updater has been present for a
152minimum number of startups, in the case that no app has ever been installed.
153*Windows Only*
154
155IntegrationTest.UnregisterUninstalledApp tests that if an app has been
156uninstalled, the updater removes it from further update checks.
157
158IntegrationTest.UninstallIfMaxServerWakesBeforeRegistrationExceeded tests that
159the updater uninstalls itself if it has been present on the machine for a
160while but no other apps have been installed.
161
162IntegrationTest.UninstallUpdaterWhenAllAppsUninstalled tests that the updater
163uninstalls itself when it no longer has other apps to keep up to date.
164
165### Associated Tools
166Associated tools should be covered by unit tests.
167
168## Manual Testing
169No routine manual testing is planned.