Clear all APF memory in testDropPingReply() in preparing stage

Modified testDropPingReply() to clear the entire APF memory instead of
only the first byte.  This addresses a known firmware issue with
handling programs smaller than 8 bytes.

Bug: 339147921
Test: TH
(cherry picked from https://android-review.googlesource.com/q/commit:e749694eb49fa74236d2388faeafd04c725fb461)
Merged-In: I651dae8c9daac24b195196c03b54e69a757de8a7
Change-Id: I651dae8c9daac24b195196c03b54e69a757de8a7
This commit is contained in:
Yuyang Huang 2024-07-23 19:07:18 +09:00 • committed by Cherrypicker Worker
commit 0e8a1e4a5a

View file

@ -436,12 +436,7 @@ class ApfIntegrationTest {
assumeApfVersionSupportAtLeast(4)
// clear any active APF filter
var gen = ApfV4Generator(
caps.apfVersionSupported,
caps.maximumApfProgramSize,
caps.maximumApfProgramSize
).addPass()
installProgram(gen.generate())
clearApfMemory()
readProgram() // wait for install completion
// Assert that initial ping does not get filtered.
@ -455,7 +450,7 @@ class ApfIntegrationTest {
assertThat(packetReader.expectPingReply()).isEqualTo(data)
// Generate an APF program that drops the next ping
gen = ApfV4Generator(
val gen = ApfV4Generator(
caps.apfVersionSupported,
caps.maximumApfProgramSize,
caps.maximumApfProgramSize