From bc48548df1dfb467a5cb2567bbac9dbe77ac33d9 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 15 Nov 2022 22:31:49 +0900 Subject: 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 --- filesystem/filesystem_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'filesystem/filesystem_test.go') 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'") +} -- cgit v1.2.3-59-g8ed1b