Add props property to add_avb_hash_footer
It is used to provide name:value properties to the footer. Value can be
from a text in *.bp file or a binary file referenced via the `file`
prop. e.g.
```
avb_add_hash_footer {
...
props: [
{
name: "string_prop",
value: "string_value",
},
{
name: "binary_prop",
file: "a_binary_file_name",
},
],
}
```
This CL also adds a test for the module type which has been missing.
Bug: 256148237
Test: m nothing
Change-Id: Idf55b308c8ce760387c01a847846b42d1aebe4ea
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index cda06d9..9bfcc3d 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -125,3 +125,37 @@
module := result.ModuleForTests("myfilesystem", "android_common").Module().(*systemImage)
android.AssertDeepEquals(t, "entries should have foo only", []string{"components/foo"}, module.entries)
}
+
+func TestAvbAddHashFooter(t *testing.T) {
+ result := fixture.RunTestWithBp(t, `
+ avb_add_hash_footer {
+ name: "myfooter",
+ src: "input.img",
+ filename: "output.img",
+ partition_name: "mypartition",
+ private_key: "mykey",
+ salt: "1111",
+ props: [
+ {
+ name: "prop1",
+ value: "value1",
+ },
+ {
+ name: "prop2",
+ file: "value_file",
+ },
+ ],
+ }
+ `)
+ cmd := result.ModuleForTests("myfooter", "android_arm64_armv8-a").Rule("avbAddHashFooter").RuleParams.Command
+ android.AssertStringDoesContain(t, "Can't find correct --partition_name argument",
+ cmd, "--partition_name mypartition")
+ android.AssertStringDoesContain(t, "Can't find correct --key argument",
+ cmd, "--key mykey")
+ android.AssertStringDoesContain(t, "Can't find --salt argument",
+ cmd, "--salt 1111")
+ android.AssertStringDoesContain(t, "Can't find --prop argument",
+ cmd, "--prop 'prop1:value1'")
+ android.AssertStringDoesContain(t, "Can't find --prop_from_file argument",
+ cmd, "--prop_from_file 'prop2:value_file'")
+}