Skip to content

Commit

Permalink
Add integ test for tcpdump
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Dec 6, 2023
1 parent fab0c9c commit 5c1b32e
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ jobs:
- uses: actions/checkout@v3
- name: Run integration build
run: |
./tests/ci/integration/run_haproxy_integration.sh
./tests/ci/integration/run_haproxy_integration.sh
tcpdump:
runs-on: ubuntu-latest
steps:
- name: Install OS Dependencies
run: |
sudo apt-get -y --no-install-recommends install cmake gcc ninja-build golang make libpcap-dev
- uses: actions/checkout@v3
- name: Run integration build
run: |
./tests/ci/integration/run_tcpdump_integration.sh
56 changes: 56 additions & 0 deletions tests/ci/integration/run_tcpdump_integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash -exu
#
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC
#

source tests/ci/common_posix_setup.sh

# Set up environment.

# SYS_ROOT
# |
# - SRC_ROOT(aws-lc)
# |
# - SCRATCH_FOLDER
# |
# - tcpdump
# - tcpdump-install
# - AWS_LC_BUILD_FOLDER
# - AWS_LC_INSTALL_FOLDER

# Assumes script is executed from the root of aws-lc directory
SCRATCH_FOLDER=${SYS_ROOT}/"TCPDUMP_SCRATCH"
TCPDUMP_SRC_FOLDER="${SCRATCH_FOLDER}/tcpdump"
TCPDUMP_INSTALL_FOLDER="${SCRATCH_FOLDER}/tcpdump-install"
AWS_LC_BUILD_FOLDER="${SCRATCH_FOLDER}/aws-lc-build"
AWS_LC_INSTALL_FOLDER="${SCRATCH_FOLDER}/aws-lc-install"

mkdir -p "${SCRATCH_FOLDER}"
rm -rf "${SCRATCH_FOLDER:?}"/*

pushd "${SCRATCH_FOLDER}"

function tcpdump_build() {
autoreconf -fi
./configure --prefix="${TCPDUMP_INSTALL_FOLDER}" --with-openssl="${AWS_LC_INSTALL_FOLDER}"
make -j "${NUM_CPU_THREADS}"
}

function tcpdump_run_tests() {
make releasecheck
}

# Get latest tcpdump version.
git clone https://github.com/the-tcpdump-group/tcpdump.git "${TCPDUMP_SRC_FOLDER}"
mkdir -p "${AWS_LC_BUILD_FOLDER}" "${AWS_LC_INSTALL_FOLDER}" "${TCPDUMP_INSTALL_FOLDER}"
ls

aws_lc_build "${SRC_ROOT}" "${AWS_LC_BUILD_FOLDER}" "${AWS_LC_INSTALL_FOLDER}"

pushd "${TCPDUMP_SRC_FOLDER}"
tcpdump_build
tcpdump_run_tests
popd

popd

0 comments on commit 5c1b32e

Please sign in to comment.