• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Testing support for dexpreopt config.
16//
17// The bootImageConfig/bootImageVariant structs returned by genBootImageConfigs are used in many
18// places in the build and are currently mutated in a number of those locations. This provides
19// comprehensive tests of the fields in those structs to ensure that they have been initialized
20// correctly and where relevant, mutated correctly.
21//
22// This is used in TestBootImageConfig to verify that the
23
24package java
25
26import (
27	"fmt"
28	"strings"
29	"testing"
30
31	"android/soong/android"
32	"android/soong/dexpreopt"
33)
34
35// PrepareForBootImageConfigTest is the minimal set of preparers that are needed to be able to use
36// the Check*BootImageConfig methods define here.
37var PrepareForBootImageConfigTest = android.GroupFixturePreparers(
38	android.PrepareForTestWithArchMutator,
39	android.PrepareForTestAccessingMakeVars,
40	PrepareForTestWithDexpreopt,
41	FixtureConfigureBootJars("com.android.art:core1", "com.android.art:core2", "platform:framework"),
42	dexpreopt.FixtureSetTestOnlyArtBootImageJars("com.android.art:core1", "com.android.art:core2", "platform:extra1"),
43	android.FixtureAddTextFile("extra1/Android.bp", `
44		java_library {
45			name: "extra1",
46			srcs: ["extra1.java"],
47			installable: true,
48		}
49	`),
50	android.FixtureAddFile("extra1/extra1.java", nil),
51)
52
53var PrepareApexBootJarConfigs = FixtureConfigureApexBootJars(
54	"com.android.foo:framework-foo", "com.android.bar:framework-bar")
55
56var PrepareApexBootJarConfigsAndModules = android.GroupFixturePreparers(
57	PrepareApexBootJarConfigs,
58	PrepareApexBootJarModule("com.android.foo", "framework-foo"),
59	PrepareApexBootJarModule("com.android.bar", "framework-bar"),
60)
61
62var ApexBootJarFragmentsForPlatformBootclasspath = fmt.Sprintf(`
63	{
64		apex: "%[1]s",
65		module: "%[1]s-bootclasspath-fragment",
66	},
67	{
68		apex: "%[2]s",
69		module: "%[2]s-bootclasspath-fragment",
70	},
71`, "com.android.foo", "com.android.bar")
72
73var ApexBootJarDexJarPaths = []string{
74	"out/soong/.intermediates/packages/modules/com.android.bar/framework-bar/android_common_apex10000/aligned/framework-bar.jar",
75	"out/soong/.intermediates/packages/modules/com.android.foo/framework-foo/android_common_apex10000/aligned/framework-foo.jar",
76}
77
78func PrepareApexBootJarModule(apexName string, moduleName string) android.FixturePreparer {
79	moduleSourceDir := fmt.Sprintf("packages/modules/%s", apexName)
80	fragmentName := apexName + "-bootclasspath-fragment"
81	imageNameProp := ""
82	if apexName == "com.android.art" {
83		fragmentName = "art-bootclasspath-fragment"
84		imageNameProp = `image_name: "art",`
85	}
86
87	return android.GroupFixturePreparers(
88		android.FixtureAddTextFile(moduleSourceDir+"/Android.bp", fmt.Sprintf(`
89			apex {
90				name: "%[1]s",
91				key: "%[1]s.key",
92				bootclasspath_fragments: [
93					"%[3]s",
94				],
95				updatable: false,
96			}
97
98			apex_key {
99				name: "%[1]s.key",
100				public_key: "%[1]s.avbpubkey",
101				private_key: "%[1]s.pem",
102			}
103
104			bootclasspath_fragment {
105				name: "%[3]s",
106				%[4]s
107				contents: ["%[2]s"],
108				apex_available: ["%[1]s"],
109				hidden_api: {
110					split_packages: ["*"],
111				},
112			}
113
114			java_library {
115				name: "%[2]s",
116				srcs: ["%[2]s.java"],
117				system_modules: "none",
118				sdk_version: "none",
119				compile_dex: true,
120				apex_available: ["%[1]s"],
121			}
122		`, apexName, moduleName, fragmentName, imageNameProp)),
123		android.FixtureMergeMockFs(android.MockFS{
124			fmt.Sprintf("%s/apex_manifest.json", moduleSourceDir):          nil,
125			fmt.Sprintf("%s/%s.avbpubkey", moduleSourceDir, apexName):      nil,
126			fmt.Sprintf("%s/%s.pem", moduleSourceDir, apexName):            nil,
127			fmt.Sprintf("system/sepolicy/apex/%s-file_contexts", apexName): nil,
128			fmt.Sprintf("%s/%s.java", moduleSourceDir, moduleName):         nil,
129		}),
130	)
131}
132
133// normalizedInstall represents a android.RuleBuilderInstall that has been normalized to remove
134// test specific parts of the From path.
135type normalizedInstall struct {
136	from string
137	to   string
138}
139
140// normalizeInstalls converts a slice of android.RuleBuilderInstall into a slice of
141// normalizedInstall to allow them to be compared using android.AssertDeepEquals.
142func normalizeInstalls(installs android.RuleBuilderInstalls) []normalizedInstall {
143	var normalized []normalizedInstall
144	for _, install := range installs {
145		normalized = append(normalized, normalizedInstall{
146			from: install.From.RelativeToTop().String(),
147			to:   install.To,
148		})
149	}
150	return normalized
151}
152
153// assertInstallsEqual normalized the android.RuleBuilderInstalls and compares against the expected
154// normalizedInstalls.
155func assertInstallsEqual(t *testing.T, message string, expected []normalizedInstall, actual android.RuleBuilderInstalls) {
156	t.Helper()
157	normalizedActual := normalizeInstalls(actual)
158	android.AssertDeepEquals(t, message, expected, normalizedActual)
159}
160
161// expectedConfig encapsulates the expected properties that will be set in a bootImageConfig
162//
163// Each field <x> in here is compared against the corresponding field <x> in bootImageConfig.
164type expectedConfig struct {
165	name                     string
166	stem                     string
167	dir                      string
168	symbolsDir               string
169	installDir               string
170	profileInstallPathInApex string
171	modules                  android.ConfiguredJarList
172	dexPaths                 []string
173	dexPathsDeps             []string
174	zip                      string
175	variants                 []*expectedVariant
176
177	// Mutated fields
178	profileInstalls            []normalizedInstall
179	profileLicenseMetadataFile string
180}
181
182// expectedVariant encapsulates the expected properties that will be set in a bootImageVariant
183//
184// Each field <x> in here is compared against the corresponding field <x> in bootImageVariant
185// except for archType which is compared against the target.Arch.ArchType field in bootImageVariant.
186type expectedVariant struct {
187	archType          android.ArchType
188	dexLocations      []string
189	dexLocationsDeps  []string
190	imagePathOnHost   string
191	imagePathOnDevice string
192	imagesDeps        []string
193	baseImages        []string
194	baseImagesDeps    []string
195
196	// Mutated fields
197	installs            []normalizedInstall
198	vdexInstalls        []normalizedInstall
199	unstrippedInstalls  []normalizedInstall
200	licenseMetadataFile string
201}
202
203// CheckArtBootImageConfig checks the status of the fields of the bootImageConfig and
204// bootImageVariant structures that are returned from artBootImageConfig.
205//
206// This is before any fields are mutated.
207func CheckArtBootImageConfig(t *testing.T, result *android.TestResult) {
208	checkArtBootImageConfig(t, result, false, "")
209}
210
211// getArtImageConfig gets the ART bootImageConfig that was created during the test.
212func getArtImageConfig(result *android.TestResult) *bootImageConfig {
213	pathCtx := &android.TestPathContext{TestResult: result}
214	imageConfig := genBootImageConfigs(pathCtx)["art"]
215	return imageConfig
216}
217
218// checkArtBootImageConfig checks the ART boot image.
219//
220// mutated is true if this is called after fields in the image have been mutated by the ART
221// bootclasspath_fragment and false otherwise.
222func checkArtBootImageConfig(t *testing.T, result *android.TestResult, mutated bool, expectedLicenseMetadataFile string) {
223	imageConfig := getArtImageConfig(result)
224
225	expected := &expectedConfig{
226		name:                     "art",
227		stem:                     "boot",
228		dir:                      "out/soong/dexpreopt_arm64/dex_artjars",
229		symbolsDir:               "out/soong/dexpreopt_arm64/dex_artjars_unstripped",
230		installDir:               "apex/art_boot_images/javalib",
231		profileInstallPathInApex: "etc/boot-image.prof",
232		modules:                  android.CreateTestConfiguredJarList([]string{"com.android.art:core1", "com.android.art:core2", "platform:extra1"}),
233		dexPaths:                 []string{"out/soong/dexpreopt_arm64/dex_artjars_input/core1.jar", "out/soong/dexpreopt_arm64/dex_artjars_input/core2.jar", "out/soong/dexpreopt_arm64/dex_artjars_input/extra1.jar"},
234		dexPathsDeps:             []string{"out/soong/dexpreopt_arm64/dex_artjars_input/core1.jar", "out/soong/dexpreopt_arm64/dex_artjars_input/core2.jar", "out/soong/dexpreopt_arm64/dex_artjars_input/extra1.jar"},
235		zip:                      "out/soong/dexpreopt_arm64/dex_artjars/art.zip",
236		variants: []*expectedVariant{
237			{
238				archType:          android.Arm64,
239				dexLocations:      []string{"/apex/com.android.art/javalib/core1.jar", "/apex/com.android.art/javalib/core2.jar", "/system/framework/extra1.jar"},
240				dexLocationsDeps:  []string{"/apex/com.android.art/javalib/core1.jar", "/apex/com.android.art/javalib/core2.jar", "/system/framework/extra1.jar"},
241				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art",
242				imagePathOnDevice: "/apex/art_boot_images/javalib/arm64/boot.art",
243				imagesDeps: []string{
244					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art",
245					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.oat",
246					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.vdex",
247					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.art",
248					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.oat",
249					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.vdex",
250					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.art",
251					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.oat",
252					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.vdex",
253				},
254				installs: []normalizedInstall{
255					{
256						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art",
257						to:   "/apex/art_boot_images/javalib/arm64/boot.art",
258					},
259					{
260						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.oat",
261						to:   "/apex/art_boot_images/javalib/arm64/boot.oat",
262					},
263					{
264						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.art",
265						to:   "/apex/art_boot_images/javalib/arm64/boot-core2.art",
266					},
267					{
268						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.oat",
269						to:   "/apex/art_boot_images/javalib/arm64/boot-core2.oat",
270					},
271					{
272						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.art",
273						to:   "/apex/art_boot_images/javalib/arm64/boot-extra1.art",
274					},
275					{
276						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.oat",
277						to:   "/apex/art_boot_images/javalib/arm64/boot-extra1.oat",
278					},
279				},
280				vdexInstalls: []normalizedInstall{
281					{
282						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.vdex",
283						to:   "/apex/art_boot_images/javalib/arm64/boot.vdex",
284					},
285					{
286						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.vdex",
287						to:   "/apex/art_boot_images/javalib/arm64/boot-core2.vdex",
288					},
289					{
290						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.vdex",
291						to:   "/apex/art_boot_images/javalib/arm64/boot-extra1.vdex",
292					},
293				},
294				unstrippedInstalls: []normalizedInstall{
295					{
296						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot.oat",
297						to:   "/apex/art_boot_images/javalib/arm64/boot.oat",
298					},
299					{
300						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot-core2.oat",
301						to:   "/apex/art_boot_images/javalib/arm64/boot-core2.oat",
302					},
303					{
304						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot-extra1.oat",
305						to:   "/apex/art_boot_images/javalib/arm64/boot-extra1.oat",
306					},
307				},
308				licenseMetadataFile: expectedLicenseMetadataFile,
309			},
310			{
311				archType:          android.Arm,
312				dexLocations:      []string{"/apex/com.android.art/javalib/core1.jar", "/apex/com.android.art/javalib/core2.jar", "/system/framework/extra1.jar"},
313				dexLocationsDeps:  []string{"/apex/com.android.art/javalib/core1.jar", "/apex/com.android.art/javalib/core2.jar", "/system/framework/extra1.jar"},
314				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art",
315				imagePathOnDevice: "/apex/art_boot_images/javalib/arm/boot.art",
316				imagesDeps: []string{
317					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art",
318					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat",
319					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.vdex",
320					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.art",
321					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.oat",
322					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.vdex",
323					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.art",
324					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.oat",
325					"out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.vdex",
326				},
327				installs: []normalizedInstall{
328					{
329						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art",
330						to:   "/apex/art_boot_images/javalib/arm/boot.art",
331					},
332					{
333						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat",
334						to:   "/apex/art_boot_images/javalib/arm/boot.oat",
335					},
336					{
337						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.art",
338						to:   "/apex/art_boot_images/javalib/arm/boot-core2.art",
339					},
340					{
341						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.oat",
342						to:   "/apex/art_boot_images/javalib/arm/boot-core2.oat",
343					},
344					{
345						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.art",
346						to:   "/apex/art_boot_images/javalib/arm/boot-extra1.art",
347					},
348					{
349						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.oat",
350						to:   "/apex/art_boot_images/javalib/arm/boot-extra1.oat",
351					},
352				},
353				vdexInstalls: []normalizedInstall{
354					{
355						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.vdex",
356						to:   "/apex/art_boot_images/javalib/arm/boot.vdex",
357					},
358					{
359						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.vdex",
360						to:   "/apex/art_boot_images/javalib/arm/boot-core2.vdex",
361					},
362					{
363						from: "out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.vdex",
364						to:   "/apex/art_boot_images/javalib/arm/boot-extra1.vdex",
365					},
366				},
367				unstrippedInstalls: []normalizedInstall{
368					{
369						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot.oat",
370						to:   "/apex/art_boot_images/javalib/arm/boot.oat",
371					},
372					{
373						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot-core2.oat",
374						to:   "/apex/art_boot_images/javalib/arm/boot-core2.oat",
375					},
376					{
377						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot-extra1.oat",
378						to:   "/apex/art_boot_images/javalib/arm/boot-extra1.oat",
379					},
380				},
381				licenseMetadataFile: expectedLicenseMetadataFile,
382			},
383			{
384				archType:          android.X86_64,
385				dexLocations:      []string{"host/linux-x86/apex/com.android.art/javalib/core1.jar", "host/linux-x86/apex/com.android.art/javalib/core2.jar", "host/linux-x86/system/framework/extra1.jar"},
386				dexLocationsDeps:  []string{"host/linux-x86/apex/com.android.art/javalib/core1.jar", "host/linux-x86/apex/com.android.art/javalib/core2.jar", "host/linux-x86/system/framework/extra1.jar"},
387				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.art",
388				imagePathOnDevice: "/apex/art_boot_images/javalib/x86_64/boot.art",
389				imagesDeps: []string{
390					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.art",
391					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.oat",
392					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.vdex",
393					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.art",
394					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.oat",
395					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.vdex",
396					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.art",
397					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.oat",
398					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.vdex",
399				},
400				installs: []normalizedInstall{
401					{
402						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.art",
403						to:   "/apex/art_boot_images/javalib/x86_64/boot.art",
404					}, {
405						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.oat",
406						to:   "/apex/art_boot_images/javalib/x86_64/boot.oat",
407					},
408					{
409						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.art",
410						to:   "/apex/art_boot_images/javalib/x86_64/boot-core2.art",
411					}, {
412						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.oat",
413						to:   "/apex/art_boot_images/javalib/x86_64/boot-core2.oat",
414					},
415					{
416						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.art",
417						to:   "/apex/art_boot_images/javalib/x86_64/boot-extra1.art",
418					}, {
419						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.oat",
420						to:   "/apex/art_boot_images/javalib/x86_64/boot-extra1.oat",
421					},
422				},
423				vdexInstalls: []normalizedInstall{
424					{
425						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.vdex",
426						to:   "/apex/art_boot_images/javalib/x86_64/boot.vdex",
427					},
428					{
429						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.vdex",
430						to:   "/apex/art_boot_images/javalib/x86_64/boot-core2.vdex",
431					},
432					{
433						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.vdex",
434						to:   "/apex/art_boot_images/javalib/x86_64/boot-extra1.vdex",
435					},
436				},
437				unstrippedInstalls: []normalizedInstall{
438					{
439						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.oat",
440						to:   "/apex/art_boot_images/javalib/x86_64/boot.oat",
441					},
442					{
443						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.oat",
444						to:   "/apex/art_boot_images/javalib/x86_64/boot-core2.oat",
445					},
446					{
447						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.oat",
448						to:   "/apex/art_boot_images/javalib/x86_64/boot-extra1.oat",
449					},
450				},
451				licenseMetadataFile: expectedLicenseMetadataFile,
452			},
453			{
454				archType:          android.X86,
455				dexLocations:      []string{"host/linux-x86/apex/com.android.art/javalib/core1.jar", "host/linux-x86/apex/com.android.art/javalib/core2.jar", "host/linux-x86/system/framework/extra1.jar"},
456				dexLocationsDeps:  []string{"host/linux-x86/apex/com.android.art/javalib/core1.jar", "host/linux-x86/apex/com.android.art/javalib/core2.jar", "host/linux-x86/system/framework/extra1.jar"},
457				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.art",
458				imagePathOnDevice: "/apex/art_boot_images/javalib/x86/boot.art",
459				imagesDeps: []string{
460					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.art",
461					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.oat",
462					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.vdex",
463					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.art",
464					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.oat",
465					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.vdex",
466					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.art",
467					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.oat",
468					"out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.vdex",
469				},
470				installs: []normalizedInstall{
471					{
472						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.art",
473						to:   "/apex/art_boot_images/javalib/x86/boot.art",
474					}, {
475						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.oat",
476						to:   "/apex/art_boot_images/javalib/x86/boot.oat",
477					},
478					{
479						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.art",
480						to:   "/apex/art_boot_images/javalib/x86/boot-core2.art",
481					}, {
482						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.oat",
483						to:   "/apex/art_boot_images/javalib/x86/boot-core2.oat",
484					},
485					{
486						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.art",
487						to:   "/apex/art_boot_images/javalib/x86/boot-extra1.art",
488					}, {
489						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.oat",
490						to:   "/apex/art_boot_images/javalib/x86/boot-extra1.oat",
491					},
492				},
493				vdexInstalls: []normalizedInstall{
494					{
495						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.vdex",
496						to:   "/apex/art_boot_images/javalib/x86/boot.vdex",
497					},
498					{
499						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.vdex",
500						to:   "/apex/art_boot_images/javalib/x86/boot-core2.vdex",
501					},
502					{
503						from: "out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.vdex",
504						to:   "/apex/art_boot_images/javalib/x86/boot-extra1.vdex",
505					},
506				},
507				unstrippedInstalls: []normalizedInstall{
508					{
509						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86/boot.oat",
510						to:   "/apex/art_boot_images/javalib/x86/boot.oat",
511					},
512					{
513						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.oat",
514						to:   "/apex/art_boot_images/javalib/x86/boot-core2.oat",
515					},
516					{
517						from: "out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.oat",
518						to:   "/apex/art_boot_images/javalib/x86/boot-extra1.oat",
519					},
520				},
521				licenseMetadataFile: expectedLicenseMetadataFile,
522			},
523		},
524	}
525
526	checkBootImageConfig(t, result, imageConfig, mutated, expected)
527}
528
529// getFrameworkImageConfig gets the framework bootImageConfig that was created during the test.
530func getFrameworkImageConfig(result *android.TestResult) *bootImageConfig {
531	pathCtx := &android.TestPathContext{TestResult: result}
532	imageConfig := defaultBootImageConfig(pathCtx)
533	return imageConfig
534}
535
536// CheckFrameworkBootImageConfig checks the status of the fields of the bootImageConfig and
537// bootImageVariant structures that are returned from defaultBootImageConfig.
538//
539// This is before any fields are mutated.
540func CheckFrameworkBootImageConfig(t *testing.T, result *android.TestResult) {
541	checkFrameworkBootImageConfig(t, result, false, "")
542}
543
544// checkFrameworkBootImageConfig checks the framework boot image.
545//
546// mutated is true if this is called after fields in the image have been mutated by the
547// platform_bootclasspath and false otherwise.
548func checkFrameworkBootImageConfig(t *testing.T, result *android.TestResult, mutated bool, expectedLicenseMetadataFile string) {
549	imageConfig := getFrameworkImageConfig(result)
550
551	expected := &expectedConfig{
552		name:                     "boot",
553		stem:                     "boot",
554		dir:                      "out/soong/dexpreopt_arm64/dex_bootjars",
555		symbolsDir:               "out/soong/dexpreopt_arm64/dex_bootjars_unstripped",
556		installDir:               "system/framework",
557		profileInstallPathInApex: "",
558		modules: android.CreateTestConfiguredJarList([]string{
559			"com.android.art:core1",
560			"com.android.art:core2",
561			"platform:framework",
562		}),
563		dexPaths: []string{
564			"out/soong/dexpreopt_arm64/dex_bootjars_input/core1.jar",
565			"out/soong/dexpreopt_arm64/dex_bootjars_input/core2.jar",
566			"out/soong/dexpreopt_arm64/dex_bootjars_input/framework.jar",
567		},
568		dexPathsDeps: []string{
569			"out/soong/dexpreopt_arm64/dex_bootjars_input/core1.jar",
570			"out/soong/dexpreopt_arm64/dex_bootjars_input/core2.jar",
571			"out/soong/dexpreopt_arm64/dex_bootjars_input/framework.jar",
572		},
573		zip: "out/soong/dexpreopt_arm64/dex_bootjars/boot.zip",
574		variants: []*expectedVariant{
575			{
576				archType: android.Arm64,
577				dexLocations: []string{
578					"/apex/com.android.art/javalib/core1.jar",
579					"/apex/com.android.art/javalib/core2.jar",
580					"/system/framework/framework.jar",
581				},
582				dexLocationsDeps: []string{
583					"/apex/com.android.art/javalib/core1.jar",
584					"/apex/com.android.art/javalib/core2.jar",
585					"/system/framework/framework.jar",
586				},
587				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.art",
588				imagePathOnDevice: "/system/framework/arm64/boot.art",
589				imagesDeps: []string{
590					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.art",
591					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.oat",
592					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.vdex",
593					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.art",
594					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.oat",
595					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.vdex",
596					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.art",
597					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.oat",
598					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.vdex",
599				},
600				installs: []normalizedInstall{
601					{
602						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.art",
603						to:   "/system/framework/arm64/boot.art",
604					},
605					{
606						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.oat",
607						to:   "/system/framework/arm64/boot.oat",
608					},
609					{
610						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.art",
611						to:   "/system/framework/arm64/boot-core2.art",
612					},
613					{
614						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.oat",
615						to:   "/system/framework/arm64/boot-core2.oat",
616					},
617					{
618						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.art",
619						to:   "/system/framework/arm64/boot-framework.art",
620					},
621					{
622						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.oat",
623						to:   "/system/framework/arm64/boot-framework.oat",
624					},
625				},
626				vdexInstalls: []normalizedInstall{
627					{
628						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.vdex",
629						to:   "/system/framework/arm64/boot.vdex",
630					},
631					{
632						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.vdex",
633						to:   "/system/framework/arm64/boot-core2.vdex",
634					},
635					{
636						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.vdex",
637						to:   "/system/framework/arm64/boot-framework.vdex",
638					},
639				},
640				unstrippedInstalls: []normalizedInstall{
641					{
642						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm64/boot.oat",
643						to:   "/system/framework/arm64/boot.oat",
644					},
645					{
646						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm64/boot-core2.oat",
647						to:   "/system/framework/arm64/boot-core2.oat",
648					},
649					{
650						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm64/boot-framework.oat",
651						to:   "/system/framework/arm64/boot-framework.oat",
652					},
653				},
654				licenseMetadataFile: expectedLicenseMetadataFile,
655			},
656			{
657				archType: android.Arm,
658				dexLocations: []string{
659					"/apex/com.android.art/javalib/core1.jar",
660					"/apex/com.android.art/javalib/core2.jar",
661					"/system/framework/framework.jar",
662				},
663				dexLocationsDeps: []string{
664					"/apex/com.android.art/javalib/core1.jar",
665					"/apex/com.android.art/javalib/core2.jar",
666					"/system/framework/framework.jar",
667				},
668				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.art",
669				imagePathOnDevice: "/system/framework/arm/boot.art",
670				imagesDeps: []string{
671					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.art",
672					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.oat",
673					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.vdex",
674					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.art",
675					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.oat",
676					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.vdex",
677					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.art",
678					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.oat",
679					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.vdex",
680				},
681				installs: []normalizedInstall{
682					{
683						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.art",
684						to:   "/system/framework/arm/boot.art",
685					},
686					{
687						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.oat",
688						to:   "/system/framework/arm/boot.oat",
689					},
690					{
691						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.art",
692						to:   "/system/framework/arm/boot-core2.art",
693					},
694					{
695						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.oat",
696						to:   "/system/framework/arm/boot-core2.oat",
697					},
698					{
699						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.art",
700						to:   "/system/framework/arm/boot-framework.art",
701					},
702					{
703						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.oat",
704						to:   "/system/framework/arm/boot-framework.oat",
705					},
706				},
707				vdexInstalls: []normalizedInstall{
708					{
709						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.vdex",
710						to:   "/system/framework/arm/boot.vdex",
711					},
712					{
713						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.vdex",
714						to:   "/system/framework/arm/boot-core2.vdex",
715					},
716					{
717						from: "out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.vdex",
718						to:   "/system/framework/arm/boot-framework.vdex",
719					},
720				},
721				unstrippedInstalls: []normalizedInstall{
722					{
723						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm/boot.oat",
724						to:   "/system/framework/arm/boot.oat",
725					},
726					{
727						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm/boot-core2.oat",
728						to:   "/system/framework/arm/boot-core2.oat",
729					},
730					{
731						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm/boot-framework.oat",
732						to:   "/system/framework/arm/boot-framework.oat",
733					},
734				},
735				licenseMetadataFile: expectedLicenseMetadataFile,
736			},
737			{
738				archType: android.X86_64,
739				dexLocations: []string{
740					"host/linux-x86/apex/com.android.art/javalib/core1.jar",
741					"host/linux-x86/apex/com.android.art/javalib/core2.jar",
742					"host/linux-x86/system/framework/framework.jar",
743				},
744				dexLocationsDeps: []string{
745					"host/linux-x86/apex/com.android.art/javalib/core1.jar",
746					"host/linux-x86/apex/com.android.art/javalib/core2.jar",
747					"host/linux-x86/system/framework/framework.jar",
748				},
749				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.art",
750				imagePathOnDevice: "/system/framework/x86_64/boot.art",
751				imagesDeps: []string{
752					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.art",
753					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.oat",
754					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.vdex",
755					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.art",
756					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.oat",
757					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.vdex",
758					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.art",
759					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.oat",
760					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.vdex",
761				},
762				installs: []normalizedInstall{
763					{
764						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.art",
765						to:   "/system/framework/x86_64/boot.art",
766					},
767					{
768						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.oat",
769						to:   "/system/framework/x86_64/boot.oat",
770					},
771					{
772						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.art",
773						to:   "/system/framework/x86_64/boot-core2.art",
774					},
775					{
776						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.oat",
777						to:   "/system/framework/x86_64/boot-core2.oat",
778					},
779					{
780						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.art",
781						to:   "/system/framework/x86_64/boot-framework.art",
782					},
783					{
784						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.oat",
785						to:   "/system/framework/x86_64/boot-framework.oat",
786					},
787				},
788				vdexInstalls: []normalizedInstall{
789					{
790						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.vdex",
791						to:   "/system/framework/x86_64/boot.vdex",
792					},
793					{
794						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.vdex",
795						to:   "/system/framework/x86_64/boot-core2.vdex",
796					},
797					{
798						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.vdex",
799						to:   "/system/framework/x86_64/boot-framework.vdex",
800					},
801				},
802				unstrippedInstalls: []normalizedInstall{
803					{
804						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86_64/boot.oat",
805						to:   "/system/framework/x86_64/boot.oat",
806					},
807					{
808						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86_64/boot-core2.oat",
809						to:   "/system/framework/x86_64/boot-core2.oat",
810					},
811					{
812						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86_64/boot-framework.oat",
813						to:   "/system/framework/x86_64/boot-framework.oat",
814					},
815				},
816				licenseMetadataFile: expectedLicenseMetadataFile,
817			},
818			{
819				archType: android.X86,
820				dexLocations: []string{
821					"host/linux-x86/apex/com.android.art/javalib/core1.jar",
822					"host/linux-x86/apex/com.android.art/javalib/core2.jar",
823					"host/linux-x86/system/framework/framework.jar",
824				},
825				dexLocationsDeps: []string{
826					"host/linux-x86/apex/com.android.art/javalib/core1.jar",
827					"host/linux-x86/apex/com.android.art/javalib/core2.jar",
828					"host/linux-x86/system/framework/framework.jar",
829				},
830				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.art",
831				imagePathOnDevice: "/system/framework/x86/boot.art",
832				imagesDeps: []string{
833					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.art",
834					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.oat",
835					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.vdex",
836					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.art",
837					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.oat",
838					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.vdex",
839					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.art",
840					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.oat",
841					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.vdex",
842				},
843				installs: []normalizedInstall{
844					{
845						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.art",
846						to:   "/system/framework/x86/boot.art",
847					},
848					{
849						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.oat",
850						to:   "/system/framework/x86/boot.oat",
851					},
852					{
853						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.art",
854						to:   "/system/framework/x86/boot-core2.art",
855					},
856					{
857						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.oat",
858						to:   "/system/framework/x86/boot-core2.oat",
859					},
860					{
861						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.art",
862						to:   "/system/framework/x86/boot-framework.art",
863					},
864					{
865						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.oat",
866						to:   "/system/framework/x86/boot-framework.oat",
867					},
868				},
869				vdexInstalls: []normalizedInstall{
870					{
871						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.vdex",
872						to:   "/system/framework/x86/boot.vdex",
873					},
874					{
875						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.vdex",
876						to:   "/system/framework/x86/boot-core2.vdex",
877					},
878					{
879						from: "out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.vdex",
880						to:   "/system/framework/x86/boot-framework.vdex",
881					},
882				},
883				unstrippedInstalls: []normalizedInstall{
884					{
885						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86/boot.oat",
886						to:   "/system/framework/x86/boot.oat",
887					},
888					{
889						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86/boot-core2.oat",
890						to:   "/system/framework/x86/boot-core2.oat",
891					},
892					{
893						from: "out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86/boot-framework.oat",
894						to:   "/system/framework/x86/boot-framework.oat",
895					},
896				},
897				licenseMetadataFile: expectedLicenseMetadataFile,
898			},
899		},
900		profileInstalls: []normalizedInstall{
901			{from: "out/soong/.intermediates/default/java/dex_bootjars/android_common/boot/boot.prof", to: "/system/etc/boot-image.prof"},
902			{from: "out/soong/dexpreopt_arm64/dex_bootjars/boot.bprof", to: "/system/etc/boot-image.bprof"},
903		},
904		profileLicenseMetadataFile: expectedLicenseMetadataFile,
905	}
906
907	checkBootImageConfig(t, result, imageConfig, mutated, expected)
908}
909
910// getMainlineImageConfig gets the framework bootImageConfig that was created during the test.
911func getMainlineImageConfig(result *android.TestResult) *bootImageConfig {
912	pathCtx := &android.TestPathContext{TestResult: result}
913	imageConfig := mainlineBootImageConfig(pathCtx)
914	return imageConfig
915}
916
917// CheckMainlineBootImageConfig checks the status of the fields of the bootImageConfig and
918// bootImageVariant structures that are returned from mainlineBootImageConfig.
919//
920// This is before any fields are mutated.
921func CheckMainlineBootImageConfig(t *testing.T, result *android.TestResult) {
922	expectedLicenseMetadataFile := ""
923	imageConfig := getMainlineImageConfig(result)
924
925	expected := &expectedConfig{
926		name:                     "mainline",
927		stem:                     "boot",
928		dir:                      "out/soong/dexpreopt_arm64/dex_mainlinejars",
929		symbolsDir:               "out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped",
930		installDir:               "system/framework",
931		profileInstallPathInApex: "",
932		modules: android.CreateTestConfiguredJarList([]string{
933			"com.android.foo:framework-foo",
934			"com.android.bar:framework-bar",
935		}),
936		dexPaths: []string{
937			"out/soong/dexpreopt_arm64/dex_mainlinejars_input/framework-foo.jar",
938			"out/soong/dexpreopt_arm64/dex_mainlinejars_input/framework-bar.jar",
939		},
940		dexPathsDeps: []string{
941			"out/soong/dexpreopt_arm64/dex_bootjars_input/core1.jar",
942			"out/soong/dexpreopt_arm64/dex_bootjars_input/core2.jar",
943			"out/soong/dexpreopt_arm64/dex_bootjars_input/framework.jar",
944			"out/soong/dexpreopt_arm64/dex_mainlinejars_input/framework-foo.jar",
945			"out/soong/dexpreopt_arm64/dex_mainlinejars_input/framework-bar.jar",
946		},
947		zip: "out/soong/dexpreopt_arm64/dex_mainlinejars/mainline.zip",
948		variants: []*expectedVariant{
949			{
950				archType: android.Arm64,
951				dexLocations: []string{
952					"/apex/com.android.foo/javalib/framework-foo.jar",
953					"/apex/com.android.bar/javalib/framework-bar.jar",
954				},
955				dexLocationsDeps: []string{
956					"/apex/com.android.art/javalib/core1.jar",
957					"/apex/com.android.art/javalib/core2.jar",
958					"/system/framework/framework.jar",
959					"/apex/com.android.foo/javalib/framework-foo.jar",
960					"/apex/com.android.bar/javalib/framework-bar.jar",
961				},
962				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.art",
963				imagePathOnDevice: "/system/framework/arm64/boot-framework-foo.art",
964				imagesDeps: []string{
965					"out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.art",
966					"out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.oat",
967					"out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.vdex",
968				},
969				baseImages: []string{
970					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.art",
971				},
972				baseImagesDeps: []string{
973					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.art",
974					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.oat",
975					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.vdex",
976					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.art",
977					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.oat",
978					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.vdex",
979					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.art",
980					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.oat",
981					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.vdex",
982				},
983				installs: []normalizedInstall{
984					{
985						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.art",
986						to:   "/system/framework/arm64/boot-framework-foo.art",
987					},
988					{
989						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.oat",
990						to:   "/system/framework/arm64/boot-framework-foo.oat",
991					},
992				},
993				vdexInstalls: []normalizedInstall{
994					{
995						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.vdex",
996						to:   "/system/framework/arm64/boot-framework-foo.vdex",
997					},
998				},
999				unstrippedInstalls: []normalizedInstall{
1000					{
1001						from: "out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped/android/system/framework/arm64/boot-framework-foo.oat",
1002						to:   "/system/framework/arm64/boot-framework-foo.oat",
1003					},
1004				},
1005				licenseMetadataFile: expectedLicenseMetadataFile,
1006			},
1007			{
1008				archType: android.Arm,
1009				dexLocations: []string{
1010					"/apex/com.android.foo/javalib/framework-foo.jar",
1011					"/apex/com.android.bar/javalib/framework-bar.jar",
1012				},
1013				dexLocationsDeps: []string{
1014					"/apex/com.android.art/javalib/core1.jar",
1015					"/apex/com.android.art/javalib/core2.jar",
1016					"/system/framework/framework.jar",
1017					"/apex/com.android.foo/javalib/framework-foo.jar",
1018					"/apex/com.android.bar/javalib/framework-bar.jar",
1019				},
1020				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.art",
1021				imagePathOnDevice: "/system/framework/arm/boot-framework-foo.art",
1022				imagesDeps: []string{
1023					"out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.art",
1024					"out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.oat",
1025					"out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.vdex",
1026				},
1027				baseImages: []string{
1028					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.art",
1029				},
1030				baseImagesDeps: []string{
1031					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.art",
1032					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.oat",
1033					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.vdex",
1034					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.art",
1035					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.oat",
1036					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.vdex",
1037					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.art",
1038					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.oat",
1039					"out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.vdex",
1040				},
1041				installs: []normalizedInstall{
1042					{
1043						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.art",
1044						to:   "/system/framework/arm/boot-framework-foo.art",
1045					},
1046					{
1047						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.oat",
1048						to:   "/system/framework/arm/boot-framework-foo.oat",
1049					},
1050				},
1051				vdexInstalls: []normalizedInstall{
1052					{
1053						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.vdex",
1054						to:   "/system/framework/arm/boot-framework-foo.vdex",
1055					},
1056				},
1057				unstrippedInstalls: []normalizedInstall{
1058					{
1059						from: "out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped/android/system/framework/arm/boot-framework-foo.oat",
1060						to:   "/system/framework/arm/boot-framework-foo.oat",
1061					},
1062				},
1063				licenseMetadataFile: expectedLicenseMetadataFile,
1064			},
1065			{
1066				archType: android.X86_64,
1067				dexLocations: []string{
1068					"host/linux-x86/apex/com.android.foo/javalib/framework-foo.jar",
1069					"host/linux-x86/apex/com.android.bar/javalib/framework-bar.jar",
1070				},
1071				dexLocationsDeps: []string{
1072					"host/linux-x86/apex/com.android.art/javalib/core1.jar",
1073					"host/linux-x86/apex/com.android.art/javalib/core2.jar",
1074					"host/linux-x86/system/framework/framework.jar",
1075					"host/linux-x86/apex/com.android.foo/javalib/framework-foo.jar",
1076					"host/linux-x86/apex/com.android.bar/javalib/framework-bar.jar",
1077				},
1078				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.art",
1079				imagePathOnDevice: "/system/framework/x86_64/boot-framework-foo.art",
1080				imagesDeps: []string{
1081					"out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.art",
1082					"out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.oat",
1083					"out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.vdex",
1084				},
1085				baseImages: []string{
1086					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.art",
1087				},
1088				baseImagesDeps: []string{
1089					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.art",
1090					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.oat",
1091					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.vdex",
1092					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.art",
1093					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.oat",
1094					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.vdex",
1095					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.art",
1096					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.oat",
1097					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.vdex",
1098				},
1099				installs: []normalizedInstall{
1100					{
1101						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.art",
1102						to:   "/system/framework/x86_64/boot-framework-foo.art",
1103					},
1104					{
1105						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.oat",
1106						to:   "/system/framework/x86_64/boot-framework-foo.oat",
1107					},
1108				},
1109				vdexInstalls: []normalizedInstall{
1110					{
1111						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.vdex",
1112						to:   "/system/framework/x86_64/boot-framework-foo.vdex",
1113					},
1114				},
1115				unstrippedInstalls: []normalizedInstall{
1116					{
1117						from: "out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped/linux_glibc/system/framework/x86_64/boot-framework-foo.oat",
1118						to:   "/system/framework/x86_64/boot-framework-foo.oat",
1119					},
1120				},
1121				licenseMetadataFile: expectedLicenseMetadataFile,
1122			},
1123			{
1124				archType: android.X86,
1125				dexLocations: []string{
1126					"host/linux-x86/apex/com.android.foo/javalib/framework-foo.jar",
1127					"host/linux-x86/apex/com.android.bar/javalib/framework-bar.jar",
1128				},
1129				dexLocationsDeps: []string{
1130					"host/linux-x86/apex/com.android.art/javalib/core1.jar",
1131					"host/linux-x86/apex/com.android.art/javalib/core2.jar",
1132					"host/linux-x86/system/framework/framework.jar",
1133					"host/linux-x86/apex/com.android.foo/javalib/framework-foo.jar",
1134					"host/linux-x86/apex/com.android.bar/javalib/framework-bar.jar",
1135				},
1136				imagePathOnHost:   "out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.art",
1137				imagePathOnDevice: "/system/framework/x86/boot-framework-foo.art",
1138				imagesDeps: []string{
1139					"out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.art",
1140					"out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.oat",
1141					"out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.vdex",
1142				},
1143				baseImages: []string{
1144					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.art",
1145				},
1146				baseImagesDeps: []string{
1147					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.art",
1148					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.oat",
1149					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.vdex",
1150					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.art",
1151					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.oat",
1152					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.vdex",
1153					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.art",
1154					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.oat",
1155					"out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.vdex",
1156				},
1157				installs: []normalizedInstall{
1158					{
1159						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.art",
1160						to:   "/system/framework/x86/boot-framework-foo.art",
1161					},
1162					{
1163						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.oat",
1164						to:   "/system/framework/x86/boot-framework-foo.oat",
1165					},
1166				},
1167				vdexInstalls: []normalizedInstall{
1168					{
1169						from: "out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.vdex",
1170						to:   "/system/framework/x86/boot-framework-foo.vdex",
1171					},
1172				},
1173				unstrippedInstalls: []normalizedInstall{
1174					{
1175						from: "out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped/linux_glibc/system/framework/x86/boot-framework-foo.oat",
1176						to:   "/system/framework/x86/boot-framework-foo.oat",
1177					},
1178				},
1179				licenseMetadataFile: expectedLicenseMetadataFile,
1180			},
1181		},
1182		profileInstalls:            []normalizedInstall{},
1183		profileLicenseMetadataFile: expectedLicenseMetadataFile,
1184	}
1185
1186	checkBootImageConfig(t, result, imageConfig, false, expected)
1187}
1188
1189// clearMutatedFields clears fields in the expectedConfig that correspond to fields in the
1190// bootImageConfig/bootImageVariant structs which are mutated outside the call to
1191// genBootImageConfigs.
1192//
1193// This allows the resulting expectedConfig struct to be compared against the values of those boot
1194// image structs immediately the call to genBootImageConfigs. If this is not called then the
1195// expectedConfig struct will expect the boot image structs to have been mutated by the ART
1196// bootclasspath_fragment and the platform_bootclasspath.
1197func clearMutatedFields(expected *expectedConfig) {
1198	expected.profileInstalls = nil
1199	expected.profileLicenseMetadataFile = ""
1200	for _, variant := range expected.variants {
1201		variant.installs = nil
1202		variant.vdexInstalls = nil
1203		variant.unstrippedInstalls = nil
1204		variant.licenseMetadataFile = ""
1205	}
1206}
1207
1208// checkBootImageConfig checks a boot image against the expected contents.
1209//
1210// If mutated is false then this will clear any mutated fields in the expected contents back to the
1211// zero value so that they will match the unmodified values in the boot image.
1212//
1213// It runs the checks in an image specific subtest of the current test.
1214func checkBootImageConfig(t *testing.T, result *android.TestResult, imageConfig *bootImageConfig, mutated bool, expected *expectedConfig) {
1215	if !mutated {
1216		clearMutatedFields(expected)
1217	}
1218
1219	t.Run(imageConfig.name, func(t *testing.T) {
1220		nestedCheckBootImageConfig(t, result, imageConfig, mutated, expected)
1221	})
1222}
1223
1224// nestedCheckBootImageConfig does the work of comparing the image against the expected values and
1225// is run in an image specific subtest.
1226func nestedCheckBootImageConfig(t *testing.T, result *android.TestResult, imageConfig *bootImageConfig, mutated bool, expected *expectedConfig) {
1227	android.AssertStringEquals(t, "name", expected.name, imageConfig.name)
1228	android.AssertStringEquals(t, "stem", expected.stem, imageConfig.stem)
1229	android.AssertPathRelativeToTopEquals(t, "dir", expected.dir, imageConfig.dir)
1230	android.AssertPathRelativeToTopEquals(t, "symbolsDir", expected.symbolsDir, imageConfig.symbolsDir)
1231	android.AssertStringEquals(t, "installDir", expected.installDir, imageConfig.installDir)
1232	android.AssertDeepEquals(t, "modules", expected.modules, imageConfig.modules)
1233	android.AssertPathsRelativeToTopEquals(t, "dexPaths", expected.dexPaths, imageConfig.dexPaths.Paths())
1234	android.AssertPathsRelativeToTopEquals(t, "dexPathsDeps", expected.dexPathsDeps, imageConfig.dexPathsDeps.Paths())
1235	// dexPathsByModule is just a different representation of the other information in the config.
1236	android.AssertPathRelativeToTopEquals(t, "zip", expected.zip, imageConfig.zip)
1237
1238	if !mutated {
1239		dexBootJarModule := result.ModuleForTests("dex_bootjars", "android_common")
1240		profileInstallInfo, _ := android.SingletonModuleProvider(result, dexBootJarModule.Module(), profileInstallInfoProvider)
1241		assertInstallsEqual(t, "profileInstalls", expected.profileInstalls, profileInstallInfo.profileInstalls)
1242		android.AssertStringEquals(t, "profileLicenseMetadataFile", expected.profileLicenseMetadataFile, profileInstallInfo.profileLicenseMetadataFile.RelativeToTop().String())
1243	}
1244
1245	android.AssertIntEquals(t, "variant count", 4, len(imageConfig.variants))
1246	for i, variant := range imageConfig.variants {
1247		expectedVariant := expected.variants[i]
1248		t.Run(variant.target.Arch.ArchType.String(), func(t *testing.T) {
1249			android.AssertDeepEquals(t, "archType", expectedVariant.archType, variant.target.Arch.ArchType)
1250			android.AssertDeepEquals(t, "dexLocations", expectedVariant.dexLocations, variant.dexLocations)
1251			android.AssertDeepEquals(t, "dexLocationsDeps", expectedVariant.dexLocationsDeps, variant.dexLocationsDeps)
1252			android.AssertPathRelativeToTopEquals(t, "imagePathOnHost", expectedVariant.imagePathOnHost, variant.imagePathOnHost)
1253			android.AssertStringEquals(t, "imagePathOnDevice", expectedVariant.imagePathOnDevice, variant.imagePathOnDevice)
1254			android.AssertPathsRelativeToTopEquals(t, "imagesDeps", expectedVariant.imagesDeps, variant.imagesDeps.Paths())
1255			android.AssertPathsRelativeToTopEquals(t, "baseImages", expectedVariant.baseImages, variant.baseImages.Paths())
1256			android.AssertPathsRelativeToTopEquals(t, "baseImagesDeps", expectedVariant.baseImagesDeps, variant.baseImagesDeps)
1257			assertInstallsEqual(t, "installs", expectedVariant.installs, variant.installs)
1258			assertInstallsEqual(t, "vdexInstalls", expectedVariant.vdexInstalls, variant.vdexInstalls)
1259			assertInstallsEqual(t, "unstrippedInstalls", expectedVariant.unstrippedInstalls, variant.unstrippedInstalls)
1260			android.AssertStringEquals(t, "licenseMetadataFile", expectedVariant.licenseMetadataFile, variant.licenseMetadataFile.RelativeToTop().String())
1261		})
1262	}
1263}
1264
1265// CheckMutatedArtBootImageConfig checks the mutated fields in the bootImageConfig/Variant for ART.
1266func CheckMutatedArtBootImageConfig(t *testing.T, result *android.TestResult, expectedLicenseMetadataFile string) {
1267	checkArtBootImageConfig(t, result, true, expectedLicenseMetadataFile)
1268
1269	// Check the dexpreopt make vars. Do it in here as it depends on the expected license metadata
1270	// file at the moment and it
1271	checkDexpreoptMakeVars(t, result, expectedLicenseMetadataFile)
1272}
1273
1274// CheckMutatedFrameworkBootImageConfig checks the mutated fields in the bootImageConfig/Variant for framework.
1275func CheckMutatedFrameworkBootImageConfig(t *testing.T, result *android.TestResult, expectedLicenseMetadataFile string) {
1276	checkFrameworkBootImageConfig(t, result, true, expectedLicenseMetadataFile)
1277}
1278
1279// checkDexpreoptMakeVars checks the DEXPREOPT_ prefixed make vars produced by dexpreoptBootJars
1280// singleton.
1281func checkDexpreoptMakeVars(t *testing.T, result *android.TestResult, expectedLicenseMetadataFile string) {
1282	vars := result.MakeVarsForTesting(func(variable android.MakeVarVariable) bool {
1283		return strings.HasPrefix(variable.Name(), "DEXPREOPT_")
1284	})
1285
1286	out := &strings.Builder{}
1287	for _, v := range vars {
1288		fmt.Fprintf(out, "%s=%s\n", v.Name(), android.StringRelativeToTop(result.Config, v.Value()))
1289	}
1290	format := `
1291DEXPREOPT_BOOTCLASSPATH_DEX_FILES=out/soong/dexpreopt_arm64/dex_bootjars_input/core1.jar out/soong/dexpreopt_arm64/dex_bootjars_input/core2.jar out/soong/dexpreopt_arm64/dex_bootjars_input/framework.jar
1292DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS=/apex/com.android.art/javalib/core1.jar /apex/com.android.art/javalib/core2.jar /system/framework/framework.jar
1293DEXPREOPT_BOOT_JARS_MODULES=com.android.art:core1:com.android.art:core2:platform:framework
1294DEXPREOPT_GEN=out/host/linux-x86/bin/dexpreopt_gen
1295DEXPREOPT_IMAGE_BUILT_INSTALLED_art_arm=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art:/apex/art_boot_images/javalib/arm/boot.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat:/apex/art_boot_images/javalib/arm/boot.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.art:/apex/art_boot_images/javalib/arm/boot-core2.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.oat:/apex/art_boot_images/javalib/arm/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.art:/apex/art_boot_images/javalib/arm/boot-extra1.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.oat:/apex/art_boot_images/javalib/arm/boot-extra1.oat
1296DEXPREOPT_IMAGE_BUILT_INSTALLED_art_arm64=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art:/apex/art_boot_images/javalib/arm64/boot.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.oat:/apex/art_boot_images/javalib/arm64/boot.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.art:/apex/art_boot_images/javalib/arm64/boot-core2.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.oat:/apex/art_boot_images/javalib/arm64/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.art:/apex/art_boot_images/javalib/arm64/boot-extra1.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.oat:/apex/art_boot_images/javalib/arm64/boot-extra1.oat
1297DEXPREOPT_IMAGE_BUILT_INSTALLED_art_host_x86=out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.art:/apex/art_boot_images/javalib/x86/boot.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.oat:/apex/art_boot_images/javalib/x86/boot.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.art:/apex/art_boot_images/javalib/x86/boot-core2.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.oat:/apex/art_boot_images/javalib/x86/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.art:/apex/art_boot_images/javalib/x86/boot-extra1.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.oat:/apex/art_boot_images/javalib/x86/boot-extra1.oat
1298DEXPREOPT_IMAGE_BUILT_INSTALLED_art_host_x86_64=out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.art:/apex/art_boot_images/javalib/x86_64/boot.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.oat:/apex/art_boot_images/javalib/x86_64/boot.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.art:/apex/art_boot_images/javalib/x86_64/boot-core2.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.oat:/apex/art_boot_images/javalib/x86_64/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.art:/apex/art_boot_images/javalib/x86_64/boot-extra1.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.oat:/apex/art_boot_images/javalib/x86_64/boot-extra1.oat
1299DEXPREOPT_IMAGE_BUILT_INSTALLED_boot_arm=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.art:/system/framework/arm/boot.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.oat:/system/framework/arm/boot.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.art:/system/framework/arm/boot-core2.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.oat:/system/framework/arm/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.art:/system/framework/arm/boot-framework.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.oat:/system/framework/arm/boot-framework.oat
1300DEXPREOPT_IMAGE_BUILT_INSTALLED_boot_arm64=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.art:/system/framework/arm64/boot.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.oat:/system/framework/arm64/boot.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.art:/system/framework/arm64/boot-core2.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.oat:/system/framework/arm64/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.art:/system/framework/arm64/boot-framework.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.oat:/system/framework/arm64/boot-framework.oat
1301DEXPREOPT_IMAGE_BUILT_INSTALLED_boot_host_x86=out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.art:/system/framework/x86/boot.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.oat:/system/framework/x86/boot.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.art:/system/framework/x86/boot-core2.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.oat:/system/framework/x86/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.art:/system/framework/x86/boot-framework.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.oat:/system/framework/x86/boot-framework.oat
1302DEXPREOPT_IMAGE_BUILT_INSTALLED_boot_host_x86_64=out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.art:/system/framework/x86_64/boot.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.oat:/system/framework/x86_64/boot.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.art:/system/framework/x86_64/boot-core2.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.oat:/system/framework/x86_64/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.art:/system/framework/x86_64/boot-framework.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.oat:/system/framework/x86_64/boot-framework.oat
1303DEXPREOPT_IMAGE_BUILT_INSTALLED_mainline_arm=out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.art:/system/framework/arm/boot-framework-foo.art out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.oat:/system/framework/arm/boot-framework-foo.oat
1304DEXPREOPT_IMAGE_BUILT_INSTALLED_mainline_arm64=out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.art:/system/framework/arm64/boot-framework-foo.art out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.oat:/system/framework/arm64/boot-framework-foo.oat
1305DEXPREOPT_IMAGE_BUILT_INSTALLED_mainline_host_x86=out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.art:/system/framework/x86/boot-framework-foo.art out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.oat:/system/framework/x86/boot-framework-foo.oat
1306DEXPREOPT_IMAGE_BUILT_INSTALLED_mainline_host_x86_64=out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.art:/system/framework/x86_64/boot-framework-foo.art out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.oat:/system/framework/x86_64/boot-framework-foo.oat
1307DEXPREOPT_IMAGE_DEPS_art_arm=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.vdex out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.vdex out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.vdex
1308DEXPREOPT_IMAGE_DEPS_art_arm64=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.vdex out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.vdex out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.art out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.oat out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.vdex
1309DEXPREOPT_IMAGE_DEPS_art_host_x86=out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.vdex out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.vdex out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.vdex
1310DEXPREOPT_IMAGE_DEPS_art_host_x86_64=out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.vdex out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.vdex out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.art out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.oat out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.vdex
1311DEXPREOPT_IMAGE_DEPS_boot_arm=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.vdex out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.vdex out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.vdex
1312DEXPREOPT_IMAGE_DEPS_boot_arm64=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.vdex out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.vdex out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.art out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.oat out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.vdex
1313DEXPREOPT_IMAGE_DEPS_boot_host_x86=out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.vdex out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.vdex out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.vdex
1314DEXPREOPT_IMAGE_DEPS_boot_host_x86_64=out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.vdex out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.vdex out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.art out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.oat out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.vdex
1315DEXPREOPT_IMAGE_DEPS_mainline_arm=out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.art out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.oat out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.vdex
1316DEXPREOPT_IMAGE_DEPS_mainline_arm64=out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.art out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.oat out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.vdex
1317DEXPREOPT_IMAGE_DEPS_mainline_host_x86=out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.art out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.oat out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.vdex
1318DEXPREOPT_IMAGE_DEPS_mainline_host_x86_64=out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.art out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.oat out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.vdex
1319DEXPREOPT_IMAGE_LICENSE_METADATA_art_arm=%[1]s
1320DEXPREOPT_IMAGE_LICENSE_METADATA_art_arm64=%[1]s
1321DEXPREOPT_IMAGE_LICENSE_METADATA_art_host_x86=%[1]s
1322DEXPREOPT_IMAGE_LICENSE_METADATA_art_host_x86_64=%[1]s
1323DEXPREOPT_IMAGE_LICENSE_METADATA_boot_arm=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1324DEXPREOPT_IMAGE_LICENSE_METADATA_boot_arm64=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1325DEXPREOPT_IMAGE_LICENSE_METADATA_boot_host_x86=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1326DEXPREOPT_IMAGE_LICENSE_METADATA_boot_host_x86_64=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1327DEXPREOPT_IMAGE_LICENSE_METADATA_mainline_arm=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1328DEXPREOPT_IMAGE_LICENSE_METADATA_mainline_arm64=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1329DEXPREOPT_IMAGE_LICENSE_METADATA_mainline_host_x86=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1330DEXPREOPT_IMAGE_LICENSE_METADATA_mainline_host_x86_64=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1331DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICEart=/apex/art_boot_images/javalib/boot.art
1332DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICEboot=/system/framework/boot.art
1333DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICEmainline=/system/framework/boot.art:/system/framework/boot-framework-foo.art
1334DEXPREOPT_IMAGE_LOCATIONS_ON_HOSTart=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/boot.art
1335DEXPREOPT_IMAGE_LOCATIONS_ON_HOSTboot=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/boot.art
1336DEXPREOPT_IMAGE_LOCATIONS_ON_HOSTmainline=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/boot.art:out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/boot-framework-foo.art
1337DEXPREOPT_IMAGE_NAMES=art boot mainline
1338DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED=out/soong/.intermediates/default/java/dex_bootjars/android_common/boot/boot.prof:/system/etc/boot-image.prof out/soong/dexpreopt_arm64/dex_bootjars/boot.bprof:/system/etc/boot-image.bprof
1339DEXPREOPT_IMAGE_PROFILE_LICENSE_METADATA=out/soong/.intermediates/default/java/dex_bootjars/android_common/meta_lic
1340DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_art_arm=out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot.oat:/apex/art_boot_images/javalib/arm/boot.oat out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot-core2.oat:/apex/art_boot_images/javalib/arm/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot-extra1.oat:/apex/art_boot_images/javalib/arm/boot-extra1.oat
1341DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_art_arm64=out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot.oat:/apex/art_boot_images/javalib/arm64/boot.oat out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot-core2.oat:/apex/art_boot_images/javalib/arm64/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot-extra1.oat:/apex/art_boot_images/javalib/arm64/boot-extra1.oat
1342DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_art_host_x86=out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86/boot.oat:/apex/art_boot_images/javalib/x86/boot.oat out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.oat:/apex/art_boot_images/javalib/x86/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.oat:/apex/art_boot_images/javalib/x86/boot-extra1.oat
1343DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_art_host_x86_64=out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.oat:/apex/art_boot_images/javalib/x86_64/boot.oat out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.oat:/apex/art_boot_images/javalib/x86_64/boot-core2.oat out/soong/dexpreopt_arm64/dex_artjars_unstripped/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.oat:/apex/art_boot_images/javalib/x86_64/boot-extra1.oat
1344DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_boot_arm=out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm/boot.oat:/system/framework/arm/boot.oat out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm/boot-core2.oat:/system/framework/arm/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm/boot-framework.oat:/system/framework/arm/boot-framework.oat
1345DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_boot_arm64=out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm64/boot.oat:/system/framework/arm64/boot.oat out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm64/boot-core2.oat:/system/framework/arm64/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars_unstripped/android/system/framework/arm64/boot-framework.oat:/system/framework/arm64/boot-framework.oat
1346DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_boot_host_x86=out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86/boot.oat:/system/framework/x86/boot.oat out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86/boot-core2.oat:/system/framework/x86/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86/boot-framework.oat:/system/framework/x86/boot-framework.oat
1347DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_boot_host_x86_64=out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86_64/boot.oat:/system/framework/x86_64/boot.oat out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86_64/boot-core2.oat:/system/framework/x86_64/boot-core2.oat out/soong/dexpreopt_arm64/dex_bootjars_unstripped/linux_glibc/system/framework/x86_64/boot-framework.oat:/system/framework/x86_64/boot-framework.oat
1348DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_mainline_arm=out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped/android/system/framework/arm/boot-framework-foo.oat:/system/framework/arm/boot-framework-foo.oat
1349DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_mainline_arm64=out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped/android/system/framework/arm64/boot-framework-foo.oat:/system/framework/arm64/boot-framework-foo.oat
1350DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_mainline_host_x86=out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped/linux_glibc/system/framework/x86/boot-framework-foo.oat:/system/framework/x86/boot-framework-foo.oat
1351DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_mainline_host_x86_64=out/soong/dexpreopt_arm64/dex_mainlinejars_unstripped/linux_glibc/system/framework/x86_64/boot-framework-foo.oat:/system/framework/x86_64/boot-framework-foo.oat
1352DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_art_arm=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.vdex:/apex/art_boot_images/javalib/arm/boot.vdex out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core2.vdex:/apex/art_boot_images/javalib/arm/boot-core2.vdex out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-extra1.vdex:/apex/art_boot_images/javalib/arm/boot-extra1.vdex
1353DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_art_arm64=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.vdex:/apex/art_boot_images/javalib/arm64/boot.vdex out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core2.vdex:/apex/art_boot_images/javalib/arm64/boot-core2.vdex out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-extra1.vdex:/apex/art_boot_images/javalib/arm64/boot-extra1.vdex
1354DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_art_host_x86=out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.vdex:/apex/art_boot_images/javalib/x86/boot.vdex out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-core2.vdex:/apex/art_boot_images/javalib/x86/boot-core2.vdex out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot-extra1.vdex:/apex/art_boot_images/javalib/x86/boot-extra1.vdex
1355DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_art_host_x86_64=out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.vdex:/apex/art_boot_images/javalib/x86_64/boot.vdex out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-core2.vdex:/apex/art_boot_images/javalib/x86_64/boot-core2.vdex out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot-extra1.vdex:/apex/art_boot_images/javalib/x86_64/boot-extra1.vdex
1356DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_boot_arm=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.vdex:/system/framework/arm/boot.vdex out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-core2.vdex:/system/framework/arm/boot-core2.vdex out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot-framework.vdex:/system/framework/arm/boot-framework.vdex
1357DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_boot_arm64=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.vdex:/system/framework/arm64/boot.vdex out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-core2.vdex:/system/framework/arm64/boot-core2.vdex out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot-framework.vdex:/system/framework/arm64/boot-framework.vdex
1358DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_boot_host_x86=out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.vdex:/system/framework/x86/boot.vdex out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-core2.vdex:/system/framework/x86/boot-core2.vdex out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot-framework.vdex:/system/framework/x86/boot-framework.vdex
1359DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_boot_host_x86_64=out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.vdex:/system/framework/x86_64/boot.vdex out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-core2.vdex:/system/framework/x86_64/boot-core2.vdex out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot-framework.vdex:/system/framework/x86_64/boot-framework.vdex
1360DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_mainline_arm=out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.vdex:/system/framework/arm/boot-framework-foo.vdex
1361DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_mainline_arm64=out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.vdex:/system/framework/arm64/boot-framework-foo.vdex
1362DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_mainline_host_x86=out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.vdex:/system/framework/x86/boot-framework-foo.vdex
1363DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_mainline_host_x86_64=out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.vdex:/system/framework/x86_64/boot-framework-foo.vdex
1364DEXPREOPT_IMAGE_ZIP_art=out/soong/dexpreopt_arm64/dex_artjars/art.zip
1365DEXPREOPT_IMAGE_ZIP_boot=out/soong/dexpreopt_arm64/dex_bootjars/boot.zip
1366DEXPREOPT_IMAGE_ZIP_mainline=out/soong/dexpreopt_arm64/dex_mainlinejars/mainline.zip
1367DEXPREOPT_IMAGE_art_arm=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art
1368DEXPREOPT_IMAGE_art_arm64=out/soong/dexpreopt_arm64/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art
1369DEXPREOPT_IMAGE_art_host_x86=out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86/boot.art
1370DEXPREOPT_IMAGE_art_host_x86_64=out/soong/dexpreopt_arm64/dex_artjars/linux_glibc/apex/art_boot_images/javalib/x86_64/boot.art
1371DEXPREOPT_IMAGE_boot_arm=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm/boot.art
1372DEXPREOPT_IMAGE_boot_arm64=out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.art
1373DEXPREOPT_IMAGE_boot_host_x86=out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86/boot.art
1374DEXPREOPT_IMAGE_boot_host_x86_64=out/soong/dexpreopt_arm64/dex_bootjars/linux_glibc/system/framework/x86_64/boot.art
1375DEXPREOPT_IMAGE_mainline_arm=out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm/boot-framework-foo.art
1376DEXPREOPT_IMAGE_mainline_arm64=out/soong/dexpreopt_arm64/dex_mainlinejars/android/system/framework/arm64/boot-framework-foo.art
1377DEXPREOPT_IMAGE_mainline_host_x86=out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86/boot-framework-foo.art
1378DEXPREOPT_IMAGE_mainline_host_x86_64=out/soong/dexpreopt_arm64/dex_mainlinejars/linux_glibc/system/framework/x86_64/boot-framework-foo.art
1379`
1380	expected := strings.TrimSpace(fmt.Sprintf(format, expectedLicenseMetadataFile))
1381	actual := strings.TrimSpace(out.String())
1382	android.AssertStringEquals(t, "vars", expected, actual)
1383}
1384