Skip to content

Commit 6795dae

Browse files
committed
tests_pcapplusplus
1 parent 1ff6532 commit 6795dae

File tree

4 files changed

+43
-1
lines changed

4 files changed

+43
-1
lines changed

projects/pcapplusplus/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ RUN git clone --depth=1 https://github.com/the-tcpdump-group/libpcap.git libpcap
2525

2626
WORKDIR PcapPlusPlus
2727

28-
COPY build.sh $SRC
28+
COPY *.sh pcapplusplus_enable_tests.diff $SRC

projects/pcapplusplus/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
#
1717
################################################################################
1818

19+
git -C "$SRC/PcapPlusPlus" apply "$SRC/pcapplusplus_enable_tests.diff"
1920
$SRC/PcapPlusPlus/Tests/Fuzzers/ossfuzz.sh
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/Tests/Fuzzers/ossfuzz.sh b/Tests/Fuzzers/ossfuzz.sh
2+
index 6d461ff6..b4c26535 100755
3+
--- a/Tests/Fuzzers/ossfuzz.sh
4+
+++ b/Tests/Fuzzers/ossfuzz.sh
5+
@@ -12,7 +12,7 @@ make -j$(nproc)
6+
# Build PcapPlusPlus linking statically against the built libpcap
7+
cd $SRC/PcapPlusPlus
8+
LIBPCAP_PATH=$SRC/libpcap/
9+
-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
10+
+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
11+
cmake --build $TARGETS_DIR -j
12+
13+
# Copy target and options
14+

projects/pcapplusplus/run_tests.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash -eu
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
export ASAN_OPTIONS=detect_stack_use_after_return=0:detect_leaks=0:abort_on_error=0:halt_on_error=0:exitcode=0
19+
ROOT="$SRC/PcapPlusPlus"
20+
21+
echo "=== Packet++Test ==="
22+
cd "$ROOT/Tests/Packet++Test"
23+
./Bin/Packet++Test
24+
25+
echo "=== Pcap++Test (no networking) ==="
26+
cd "$ROOT/Tests/Pcap++Test"
27+
./Bin/Pcap++Test -n

0 commit comments

Comments
 (0)