From 0e8a1e4a5a118df278ea2e5dff5524a518972188 Mon Sep 17 00:00:00 2001 From: Yuyang Huang Date: Tue, 23 Jul 2024 19:07:18 +0900 Subject: [PATCH] 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 --- tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt index 5662fca209..710f0fb5ca 100644 --- a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt +++ b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt @@ -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