Skip to content

Commit

Permalink
Add integration ci for Monit (#1286)
Browse files Browse the repository at this point in the history
Adding an integration CI for our recent support for Monit. Time tests
will fail on a non-CET timezone machine, so I removed the test. It's
non-relevant to AWS-LC functionality.
  • Loading branch information
samuel40791765 authored Nov 15, 2023
1 parent 487d115 commit 0b0c6b1
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/ci/cdk/cdk/codebuild/github_ci_integration_omnibus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,13 @@ batch:
image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-aarch:ubuntu-22.04_gcc-12x_latest
variables:
AWS_LC_CI_TARGET: "tests/ci/integration/run_sslproxy_integration.sh"

- identifier: monit_integration_x86_64
buildspec: tests/ci/codebuild/common/run_simple_target.yml
env:
type: LINUX_CONTAINER
privileged-mode: false
compute-type: BUILD_GENERAL1_SMALL
image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-22.04_gcc-12x_latest
variables:
AWS_LC_CI_TARGET: "tests/ci/integration/run_monit_integration.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ RUN set -ex && \
liblua5.4-dev \
libnet-dev \
libnet-ssleay-perl \
libpam0g-dev \
libpcap-dev \
libperl-dev \
libpcre2-dev \
Expand Down
56 changes: 56 additions & 0 deletions tests/ci/integration/run_monit_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
# - monit
# - AWS_LC_BUILD_FOLDER
# - AWS_LC_INSTALL_FOLDER
# - MONIT_BUILD_FOLDER

# Assumes script is executed from the root of aws-lc directory
SCRATCH_FOLDER="${SRC_ROOT}/MONIT_BUILD_ROOT"
MONIT_SRC_FOLDER="${SCRATCH_FOLDER}/monit"
MONIT_BUILD_FOLDER="${SCRATCH_FOLDER}/monit-aws-lc"
AWS_LC_BUILD_FOLDER="${SCRATCH_FOLDER}/aws-lc-build"
AWS_LC_INSTALL_FOLDER="${SCRATCH_FOLDER}/aws-lc-install"

function monit_build() {
./bootstrap
./configure --with-ssl-static="${AWS_LC_INSTALL_FOLDER}"
make -j ${NUM_CPU_THREADS}
}

# Monit doesn't run any tests verifying ssl behavior, but it shouldn't hurt to run the brief tests.
function monit_run_tests() {
pushd libmonit
# TimeTest will fail on a machine not in CET timezone.
# https://bitbucket.org/tildeslash/monit/src/def6b462259586358be3c86d76a299c80744df39/libmonit/test/TimeTest.c#lines-24
sed -i 's/TimeTest && //g' test/test.sh
make verify
popd
}

mkdir -p ${SCRATCH_FOLDER}
rm -rf ${SCRATCH_FOLDER}/*
cd ${SCRATCH_FOLDER}

git clone https://bitbucket.org/tildeslash/monit.git ${MONIT_SRC_FOLDER} --depth 1
mkdir -p ${AWS_LC_BUILD_FOLDER} ${AWS_LC_INSTALL_FOLDER} ${MONIT_BUILD_FOLDER}
ls

aws_lc_build ${SRC_ROOT} ${AWS_LC_BUILD_FOLDER} ${AWS_LC_INSTALL_FOLDER} -DBUILD_TESTING=OFF

# Build monit from source.
pushd ${MONIT_SRC_FOLDER}

monit_build
monit_run_tests
popd

0 comments on commit 0b0c6b1

Please sign in to comment.