summaryrefslogtreecommitdiff
path: root/filesystem/filesystem_test.go
diff options
context:
space:
mode:
author Alice Wang <aliceywang@google.com> 2023-01-03 16:11:20 +0000
committer Alice Wang <aliceywang@google.com> 2023-01-10 15:38:31 +0000
commit000e3a396ca89155e817841195d44b9aeda1155f (patch)
tree6f249e94f2f684b7bae1fb86ee6ecd7d9b0e23ff /filesystem/filesystem_test.go
parent57b1e4064be7b3a0976da7a5c474ebef9f65312d (diff)
[avb_footer] Add avb_gen_vbmeta_image to generate vbmeta image
This is the reland of the change aosp/2375848. The build of initrd on linux-x86 that has incorrect format (b/264940248) is disabled in this cl. Bug: 260821553 Test: m microdroid_kernel_signed and inspect the output using `avbtool info_image --image <output>` Change-Id: I3ad2419b7132cde4b2fc34ddfa09ec5ba2166819
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r--filesystem/filesystem_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index 9bfcc3d6a..444ffd0aa 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -126,8 +126,34 @@ func TestFileSystemGathersItemsOnlyInSystemPartition(t *testing.T) {
android.AssertDeepEquals(t, "entries should have foo only", []string{"components/foo"}, module.entries)
}
+func TestAvbGenVbmetaImage(t *testing.T) {
+ result := fixture.RunTestWithBp(t, `
+ avb_gen_vbmeta_image {
+ name: "input_hashdesc",
+ src: "input.img",
+ partition_name: "input_partition_name",
+ salt: "2222",
+ }`)
+ cmd := result.ModuleForTests("input_hashdesc", "android_arm64_armv8-a").Rule("avbGenVbmetaImage").RuleParams.Command
+ android.AssertStringDoesContain(t, "Can't find correct --partition_name argument",
+ cmd, "--partition_name input_partition_name")
+ android.AssertStringDoesContain(t, "Can't find --do_not_append_vbmeta_image",
+ cmd, "--do_not_append_vbmeta_image")
+ android.AssertStringDoesContain(t, "Can't find --output_vbmeta_image",
+ cmd, "--output_vbmeta_image ")
+ android.AssertStringDoesContain(t, "Can't find --salt argument",
+ cmd, "--salt 2222")
+}
+
func TestAvbAddHashFooter(t *testing.T) {
result := fixture.RunTestWithBp(t, `
+ avb_gen_vbmeta_image {
+ name: "input_hashdesc",
+ src: "input.img",
+ partition_name: "input",
+ salt: "2222",
+ }
+
avb_add_hash_footer {
name: "myfooter",
src: "input.img",
@@ -145,6 +171,7 @@ func TestAvbAddHashFooter(t *testing.T) {
file: "value_file",
},
],
+ include_descriptors_from_images: ["input_hashdesc"],
}
`)
cmd := result.ModuleForTests("myfooter", "android_arm64_armv8-a").Rule("avbAddHashFooter").RuleParams.Command
@@ -158,4 +185,6 @@ func TestAvbAddHashFooter(t *testing.T) {
cmd, "--prop 'prop1:value1'")
android.AssertStringDoesContain(t, "Can't find --prop_from_file argument",
cmd, "--prop_from_file 'prop2:value_file'")
+ android.AssertStringDoesContain(t, "Can't find --include_descriptors_from_image",
+ cmd, "--include_descriptors_from_image ")
}