summaryrefslogtreecommitdiff
path: root/filesystem/filesystem_test.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2022-11-18 06:19:31 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-11-18 06:19:31 +0000
commit6f235d9b3947f9a34ddf36d4632764f2327b415b (patch)
tree22acd02a546a454ca29f9ac5e465c64c85c22b71 /filesystem/filesystem_test.go
parent9e8ab16faea5c2aa2544b37f48674036e853f05e (diff)
parentbc48548df1dfb467a5cb2567bbac9dbe77ac33d9 (diff)
Merge "Add props property to add_avb_hash_footer"
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r--filesystem/filesystem_test.go34
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'")
+}