ebpf icon indicating copy to clipboard operation
ebpf copied to clipboard

BPFTcFilterTests failing on AL2 x64 and aarch64

Open fntlnz opened this issue 4 years ago • 1 comments

While working on the CMake porting I noticed that the prog_test_run tests ( BPFTcFilterTests ) for AL2 both on ARM and are having failures.

Initially the failures I noticed were related to the BPF filesystem not being mounted, after solving that there was the problem with map names solved in #33 - 5 tests are still failing, I'm not sure yet if it's a problem related to the tests themselves or if it is related to the program. This needs investigation.

Here's a dump of the test output when it fails.

Running main() from /var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/contrib/googletest/googletest/src/gtest_main.cc
[==========] Running 14 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 14 tests from BPFTcFilterTests
[ RUN      ] BPFTcFilterTests.TestAllowArpPacket
/var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/GPL/HostIsolation/TcFilter/BPFTcFilterTests.cpp:150: Failure
Value of: bpf_prog_test_run_xattr(&tattr)
  Actual: true
Expected: false
[  FAILED  ] BPFTcFilterTests.TestAllowArpPacket (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropUnsupportedPackets
/var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/GPL/HostIsolation/TcFilter/BPFTcFilterTests.cpp:189: Failure
Value of: bpf_prog_test_run_xattr(&tattr)
  Actual: true
Expected: false
[  FAILED  ] BPFTcFilterTests.TestDropUnsupportedPackets (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropIPV6Packets
/var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/GPL/HostIsolation/TcFilter/BPFTcFilterTests.cpp:229: Failure
Value of: bpf_prog_test_run_xattr(&tattr)
  Actual: true
Expected: false
[  FAILED  ] BPFTcFilterTests.TestDropIPV6Packets (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropInvalidHeaderLength
[       OK ] BPFTcFilterTests.TestDropInvalidHeaderLength (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropFragmentedPacket
[       OK ] BPFTcFilterTests.TestDropFragmentedPacket (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowUDPPacketDNSPortSource
[       OK ] BPFTcFilterTests.TestAllowUDPPacketDNSPortSource (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowUDPPacketDNSPortDest
[       OK ] BPFTcFilterTests.TestAllowUDPPacketDNSPortDest (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowUDPPacketDHCPClient
[       OK ] BPFTcFilterTests.TestAllowUDPPacketDHCPClient (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowUDPPacketDHCPServer
[       OK ] BPFTcFilterTests.TestAllowUDPPacketDHCPServer (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropUnknownUDPPackets
[       OK ] BPFTcFilterTests.TestDropUnknownUDPPackets (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropUnknownTCPDestination
[       OK ] BPFTcFilterTests.TestDropUnknownTCPDestination (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowTCPAddressInAllowedIPs
/var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/GPL/HostIsolation/TcFilter/BPFTcFilterTests.cpp:517: Failure
Expected equality of these values:
  ret
    Which is: -1
  0
[  FAILED  ] BPFTcFilterTests.TestAllowTCPAddressInAllowedIPs (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropUnknownICMPDestination
[       OK ] BPFTcFilterTests.TestDropUnknownICMPDestination (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowICMPAddressInAllowedIPs
/var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/GPL/HostIsolation/TcFilter/BPFTcFilterTests.cpp:589: Failure
Expected equality of these values:
  ret
    Which is: -1
  0
[  FAILED  ] BPFTcFilterTests.TestAllowICMPAddressInAllowedIPs (0 ms)
[----------] 14 tests from BPFTcFilterTests (2 ms total)

[----------] Global test environment tear-down
[==========] 14 tests from 1 test suite ran. (2 ms total)
[  PASSED  ] 9 tests.
[  FAILED  ] 5 tests, listed below:
[  FAILED  ] BPFTcFilterTests.TestAllowArpPacket
[  FAILED  ] BPFTcFilterTests.TestDropUnsupportedPackets
[  FAILED  ] BPFTcFilterTests.TestDropIPV6Packets
[  FAILED  ] BPFTcFilterTests.TestAllowTCPAddressInAllowedIPs
[  FAILED  ] BPFTcFilterTests.TestAllowICMPAddressInAllowedIPs

 5 FAILED TESTS

fntlnz avatar Nov 08 '21 10:11 fntlnz

Fixed 2 out of 5 broken tests by unpinning the maps before the next execution (was a bug in BPFTcFilterTests).

Still three to go.

Running main() from /var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/contrib/googletest/googletest/src/gtest_main.cc
[==========] Running 14 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 14 tests from BPFTcFilterTests
[ RUN      ] BPFTcFilterTests.TestAllowArpPacket
/var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/GPL/HostIsolation/TcFilter/BPFTcFilterTests.cpp:158: Failure
Value of: bpf_prog_test_run_xattr(&tattr)
  Actual: true
Expected: false
[  FAILED  ] BPFTcFilterTests.TestAllowArpPacket (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropUnsupportedPackets
/var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/GPL/HostIsolation/TcFilter/BPFTcFilterTests.cpp:197: Failure
Value of: bpf_prog_test_run_xattr(&tattr)
  Actual: true
Expected: false
[  FAILED  ] BPFTcFilterTests.TestDropUnsupportedPackets (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropIPV6Packets
/var/lib/jenkins/workspace/pf_multibranch_pipeline_lf_cmake/GPL/HostIsolation/TcFilter/BPFTcFilterTests.cpp:237: Failure
Value of: bpf_prog_test_run_xattr(&tattr)
  Actual: true
Expected: false
[  FAILED  ] BPFTcFilterTests.TestDropIPV6Packets (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropInvalidHeaderLength
[       OK ] BPFTcFilterTests.TestDropInvalidHeaderLength (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropFragmentedPacket
[       OK ] BPFTcFilterTests.TestDropFragmentedPacket (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowUDPPacketDNSPortSource
[       OK ] BPFTcFilterTests.TestAllowUDPPacketDNSPortSource (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowUDPPacketDNSPortDest
[       OK ] BPFTcFilterTests.TestAllowUDPPacketDNSPortDest (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowUDPPacketDHCPClient
[       OK ] BPFTcFilterTests.TestAllowUDPPacketDHCPClient (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowUDPPacketDHCPServer
[       OK ] BPFTcFilterTests.TestAllowUDPPacketDHCPServer (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropUnknownUDPPackets
[       OK ] BPFTcFilterTests.TestDropUnknownUDPPackets (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropUnknownTCPDestination
[       OK ] BPFTcFilterTests.TestDropUnknownTCPDestination (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowTCPAddressInAllowedIPs
[       OK ] BPFTcFilterTests.TestAllowTCPAddressInAllowedIPs (0 ms)
[ RUN      ] BPFTcFilterTests.TestDropUnknownICMPDestination
[       OK ] BPFTcFilterTests.TestDropUnknownICMPDestination (0 ms)
[ RUN      ] BPFTcFilterTests.TestAllowICMPAddressInAllowedIPs
[       OK ] BPFTcFilterTests.TestAllowICMPAddressInAllowedIPs (0 ms)
[----------] 14 tests from BPFTcFilterTests (3 ms total)

[----------] Global test environment tear-down
[==========] 14 tests from 1 test suite ran. (3 ms total)
[  PASSED  ] 11 tests.
[  FAILED  ] 3 tests, listed below:
[  FAILED  ] BPFTcFilterTests.TestAllowArpPacket
[  FAILED  ] BPFTcFilterTests.TestDropUnsupportedPackets
[  FAILED  ] BPFTcFilterTests.TestDropIPV6Packets

 3 FAILED TESTS

Those two tests are fixed by https://github.com/elastic/ebpf/pull/35

fntlnz avatar Nov 08 '21 14:11 fntlnz