Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration ci for Monit #1286

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
andrewhop marked this conversation as resolved.
Show resolved Hide resolved
Comment on lines +33 to +34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there anything important in TimeTest? if so, is it worth configuring this box to be in CET tz within this script?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not anything relevant to AWS-LC, they're time function tests to verify things are parsed correctly: https://bitbucket.org/tildeslash/monit/src/master/libmonit/test/TimeTest.c

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

Loading