Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/pcapplusplus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ RUN git clone --depth=1 https://github.com/the-tcpdump-group/libpcap.git libpcap

WORKDIR PcapPlusPlus

COPY build.sh $SRC
COPY *.sh pcapplusplus_enable_tests.diff $SRC
2 changes: 2 additions & 0 deletions projects/pcapplusplus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
#
################################################################################

# TODO: Upstream the patch to PcapPlusPlus repo.
git -C "$SRC/PcapPlusPlus" apply "$SRC/pcapplusplus_enable_tests.diff"
$SRC/PcapPlusPlus/Tests/Fuzzers/ossfuzz.sh
14 changes: 14 additions & 0 deletions projects/pcapplusplus/pcapplusplus_enable_tests.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/Tests/Fuzzers/ossfuzz.sh b/Tests/Fuzzers/ossfuzz.sh
index 6d461ff6..b4c26535 100755
--- a/Tests/Fuzzers/ossfuzz.sh
+++ b/Tests/Fuzzers/ossfuzz.sh
@@ -12,7 +12,7 @@ make -j$(nproc)
# Build PcapPlusPlus linking statically against the built libpcap
cd $SRC/PcapPlusPlus
LIBPCAP_PATH=$SRC/libpcap/
-cmake -DPCAPPP_BUILD_FUZZERS=ON -DPCAPPP_BUILD_TESTS=OFF -DPCAPPP_BUILD_EXAMPLES=OFF -DPCAP_INCLUDE_DIR="${LIBPCAP_PATH}/" -DPCAP_LIBRARY="${LIBPCAP_PATH}/libpcap.a" -S . -B $TARGETS_DIR
+cmake -DPCAPPP_BUILD_FUZZERS=ON -DPCAPPP_BUILD_TESTS=ON -DPCAPPP_BUILD_EXAMPLES=OFF -DPCAP_INCLUDE_DIR="${LIBPCAP_PATH}/" -DPCAP_LIBRARY="${LIBPCAP_PATH}/libpcap.a" -S . -B $TARGETS_DIR
cmake --build $TARGETS_DIR -j

# Copy target and options

29 changes: 29 additions & 0 deletions projects/pcapplusplus/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -eu
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

export ASAN_OPTIONS=detect_stack_use_after_return=0:detect_leaks=0:abort_on_error=0:halt_on_error=0:exitcode=0
ROOT="$SRC/PcapPlusPlus"

echo "=== Packet++Test ==="
cd "$ROOT/Tests/Packet++Test"
# TODO: Skipping failing tests.
./Bin/Packet++Test -x "VrrpCreateAndEditTest;TestMacAddress;TestTcpReassemblyRetran"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have network atm in our environment for running tests. Should we just disable these if these will fail otherwise?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I understood. They are passing without any -n (no networking) flag. I assume they are ok (?).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were right! :) Ran again the ./infra/experimental/chronos/check_tests.sh script adding a --network none to the test docker run and I can confirm that some tests failed. Adding them to the skip list and updating the comment there.


echo "=== Pcap++Test (no networking) ==="
cd "$ROOT/Tests/Pcap++Test"
# TODO: Skipping failing tests.
./Bin/Pcap++Test -n -x "TestMacAddress;TestTcpReassemblyRetran;TestTcpReassemblyMissingData"
Loading