diff options
author | 2022-11-15 22:31:49 +0900 | |
---|---|---|
committer | 2022-11-18 12:56:12 +0900 | |
commit | bc48548df1dfb467a5cb2567bbac9dbe77ac33d9 (patch) | |
tree | 915d049055127ba055a41c032dcb676eb8cc478e /filesystem/filesystem_test.go | |
parent | d5fd30d94a5b1cc00271fe7876bdd72b9f8932c8 (diff) |
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
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r-- | filesystem/filesystem_test.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index cda06d907..9bfcc3d6a 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -125,3 +125,37 @@ func TestFileSystemGathersItemsOnlyInSystemPartition(t *testing.T) { 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'") +} |