Skip to content

Commit

Permalink
Add gRPC integration tests (aws#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhop authored Dec 15, 2023
1 parent 2ac7aef commit a05dfc6
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ jobs:
- name: Run integration build
run: |
./tests/ci/integration/run_haproxy_integration.sh
grpc:
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
runs-on: ubuntu-latest
container:
image: ubuntu:latest
options: --sysctl=net.ipv6.conf.all.disable_ipv6=0
steps:
- name: Install OS Dependencies
run: |
apt-get update && apt-get -y --no-install-recommends install cmake gcc g++ ninja-build golang make python3 python3-sphinx autoconf libtool pkg-config git libc++-dev
- uses: actions/checkout@v3
- name: Run integration build
run: |
./tests/ci/integration/run_grpc_integration.sh
tcpdump:
runs-on: ubuntu-latest
steps:
Expand Down
51 changes: 51 additions & 0 deletions tests/ci/integration/run_grpc_integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/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

# SYS_ROOT
# |
# - SRC_ROOT(aws-lc)
# |
# - SCRATCH_FOLDER
# |
# - grpc
# - AWS_LC_BUILD_FOLDER
# - AWS_LC_INSTALL_FOLDER
# - GRPC_BUILD_FOLDER

# Assumes script is executed from the root of aws-lc directory
SCRATCH_FOLDER="${SYS_ROOT}/GRPC_BUILD_ROOT"
GRPC_SRC_FOLDER="${SCRATCH_FOLDER}/grpc"
GRPC_BUILD_FOLDER="${SCRATCH_FOLDER}/grpc/cmake/build"
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}/*
cd ${SCRATCH_FOLDER}
mkdir -p ${AWS_LC_BUILD_FOLDER} ${AWS_LC_INSTALL_FOLDER}

git clone --depth 1 https://github.com/grpc/grpc.git ${GRPC_SRC_FOLDER}
cd ${GRPC_SRC_FOLDER}
git submodule update --recursive --init

aws_lc_build ${SRC_ROOT} ${AWS_LC_BUILD_FOLDER} ${AWS_LC_INSTALL_FOLDER} -DBUILD_SHARED_LIBS=1

mkdir -p "${GRPC_SRC_FOLDER}/cmake/build"
cd "${GRPC_SRC_FOLDER}/cmake/build"
cmake -GNinja -DgRPC_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DgRPC_SSL_PROVIDER=package -DBUILD_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR="${AWS_LC_INSTALL_FOLDER}" ../..
ninja

# grpc tests expect to use relative paths to certificates and test files
cd "${GRPC_SRC_FOLDER}"
python3 tools/run_tests/start_port_server.py
for file in cmake/build/*; do
if [[ -x "$file" && ( "$file" == *ssl* || "$file" == *tls* || "$file" == *cert* ) ]]; then
./"$file"
fi
done

ldd "${GRPC_SRC_FOLDER}/cmake/build/libgrpc.so" | grep "${AWS_LC_INSTALL_FOLDER}/lib/libcrypto.so" || exit 1
ldd "${GRPC_SRC_FOLDER}/cmake/build/libgrpc.so" | grep "${AWS_LC_INSTALL_FOLDER}/lib/libssl.so" || exit 1

0 comments on commit a05dfc6

Please sign in to comment.