Add edge case test for invalid program length in apf_run().
This commit updates the testPrefilledMemorySlotsV4() test to include an edge case where an invalid program length is passed to apf_run() due to a firmware program update. Bug: 395545572 Test: TH Change-Id: I678615139ab6b115cd851ffa8336459988c50ef6
This commit is contained in:
parent
0c809da5c8
commit
9ed841724c
1 changed files with 7 additions and 0 deletions
|
|
@ -591,6 +591,13 @@ class ApfIntegrationTest {
|
|||
|
||||
val program = gen.generate()
|
||||
assertThat(program.size).isLessThan(counterRegion)
|
||||
val randomProgram = ByteArray(1) { 0 } +
|
||||
ByteArray(counterRegion - 1).also { Random.nextBytes(it) }
|
||||
// There are known firmware bugs where they calculate the number of non-zero bytes within
|
||||
// the program to determine the program length. Modify the test to first install a longer
|
||||
// program before installing a program that do the program length check. This should help us
|
||||
// catch these types of firmware bugs in CTS. (b/395545572)
|
||||
installAndVerifyProgram(randomProgram)
|
||||
installAndVerifyProgram(program)
|
||||
|
||||
// Trigger the program by sending a ping and waiting on the reply.
|
||||
|
|
|
|||
Loading…
Reference in a new issue