From 5c1b32e949564e794343a71bac1e01719535239a Mon Sep 17 00:00:00 2001 From: Justin W Smith <103147162+justsmth@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:23:29 -0500 Subject: [PATCH] Add integ test for tcpdump --- .github/workflows/integrations.yml | 12 +++- .../ci/integration/run_tcpdump_integration.sh | 56 +++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100755 tests/ci/integration/run_tcpdump_integration.sh diff --git a/.github/workflows/integrations.yml b/.github/workflows/integrations.yml index 83a54d92c2c..5bb4ab33622 100644 --- a/.github/workflows/integrations.yml +++ b/.github/workflows/integrations.yml @@ -19,4 +19,14 @@ jobs: - uses: actions/checkout@v3 - name: Run integration build run: | - ./tests/ci/integration/run_haproxy_integration.sh \ No newline at end of file + ./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 diff --git a/tests/ci/integration/run_tcpdump_integration.sh b/tests/ci/integration/run_tcpdump_integration.sh new file mode 100755 index 00000000000..ed7d8ea8d7f --- /dev/null +++ b/tests/ci/integration/run_tcpdump_integration.sh @@ -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