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

Additional unit-tests and unit-test adjustment #499

Merged
merged 69 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
cafbdfd
Convert existing tests to use new environment variables, fix mqtt311 …
TwistedTwigleg May 5, 2023
33aa94c
Add some MQTT311 tests akin to the MQTT5 tests. Just direct MQTT for now
TwistedTwigleg May 5, 2023
e3ac79c
use a UUID for IoT Core connection tests
TwistedTwigleg May 8, 2023
1a35733
Add the MQTT311 WS low-level tests, add tests to the CMakeLists
TwistedTwigleg May 8, 2023
3de4d3b
Minor compiling fixes
TwistedTwigleg May 8, 2023
60e8c70
Relax the operation statistics test just a bit
TwistedTwigleg May 8, 2023
78415d5
Add a bunch of MQTT311 credentials tests
TwistedTwigleg May 8, 2023
4bb8cdb
Run new builder CI in Codebuild
TwistedTwigleg May 8, 2023
90e31b8
Add MQTT5 credentials connection tests, add MQTT311 will test
TwistedTwigleg May 9, 2023
ee7af8c
Removed unused variables
TwistedTwigleg May 9, 2023
bef0948
Make Windows happy
TwistedTwigleg May 9, 2023
c63f939
Make the PKCS11 init strict in CI
TwistedTwigleg May 9, 2023
2a52be1
Use DUSE_OPENSSL=ON to run PKCS11 in CI, install the SSL development …
TwistedTwigleg May 9, 2023
8c441b1
Try installing openssl11 before openssl
TwistedTwigleg May 9, 2023
435e400
Nevermind, do not use openssl11-devel
TwistedTwigleg May 9, 2023
1cc0912
Only selectively set to use OpenSSL
TwistedTwigleg May 10, 2023
74b25c8
Make running PKCS11 tests dependent on USE_OPENSSL, adjust Codebuild …
TwistedTwigleg May 10, 2023
bf686fa
Adjust Codebuild install steps
TwistedTwigleg May 10, 2023
2fe7820
Skip installing AWS CLI on Codebuild, split Alpine out into own matri…
TwistedTwigleg May 10, 2023
72f9068
Fix byo-crypto CI and API init in Codebuild
TwistedTwigleg May 10, 2023
92f728d
More BYO-Crpto fixes, further Codebuild adjustments
TwistedTwigleg May 10, 2023
3942fb3
Fix compile issue
TwistedTwigleg May 10, 2023
9c5f7f4
Fix PKCS11 tests being skipped sometimes, adjust CMakeLists for tests
TwistedTwigleg May 10, 2023
57c47aa
Move AL2 to not run with USE_OPENSSL for now
TwistedTwigleg May 10, 2023
b026742
Hopefully fix Will test in MQTT5 on Codebuild
TwistedTwigleg May 10, 2023
568f898
Did not fix the will thing after all
TwistedTwigleg May 10, 2023
8f26a74
Quick trivial commit to trigger CI to see if PKCS12 is fixed on MacOS…
TwistedTwigleg May 10, 2023
86c966f
Super quick test - try NOT using OpenSSL in Codebuild to see if that …
TwistedTwigleg May 10, 2023
788d56a
Go back to using OpenSSL in Codebuild since it did not make a difference
TwistedTwigleg May 12, 2023
47d3999
Adjust the PKCS11 port and pass the CA file
TwistedTwigleg May 12, 2023
fc9e365
For now, skip PKCS11 tests on ManyLinux
TwistedTwigleg May 12, 2023
21b2958
Better adjust CI headers. Compile iOS to ios-armv8, which appears to …
TwistedTwigleg May 12, 2023
0f7ca00
Set the bundle identifier if cross compiling on iOS to fix CI
TwistedTwigleg May 12, 2023
9507fe0
Try to fix iOS compile again
TwistedTwigleg May 12, 2023
b7564fd
Try disabling code signing on XCode
TwistedTwigleg May 12, 2023
427bc42
Another attempt at iOS code signing fix
TwistedTwigleg May 12, 2023
21207ae
Try the last commit but set to run on APPLE instead of IOS for testin…
TwistedTwigleg May 12, 2023
a9cdfe2
Try setting the properties a different way
TwistedTwigleg May 12, 2023
74df3c1
Try a different way to disable code signing
TwistedTwigleg May 12, 2023
5679c9d
Codebuild time. See if the environment tests are being skipped due to…
TwistedTwigleg May 12, 2023
541f1c5
Is it the net_test_case causing the skip in Codebuild?
TwistedTwigleg May 12, 2023
aff862b
Does it have anything to do with the code itself?
TwistedTwigleg May 12, 2023
b9e038c
Is it due to returning -1
TwistedTwigleg May 12, 2023
96b693a
Instead of assert or returning -1, try returning a big number when so…
TwistedTwigleg May 12, 2023
4f9b193
Adjust MQTT311 environment test to not assume the AWS credentials are…
TwistedTwigleg May 12, 2023
8dace70
Use a working test, but make the env credentials provider
TwistedTwigleg May 12, 2023
0035078
Incorporate the provider back to it
TwistedTwigleg May 12, 2023
948ff56
Okay, we are getting somewhere. Keep narrowing down on where the skip is
TwistedTwigleg May 12, 2023
b4378e3
Check the credentials provider for null
TwistedTwigleg May 12, 2023
dccbc50
Bring the next bit of code
TwistedTwigleg May 12, 2023
91d2af2
Is it printf or ASSERT_TRUE(false) causing the skip?
TwistedTwigleg May 12, 2023
0944d0e
See if this makes a difference
TwistedTwigleg May 12, 2023
a39e5da
Is it this specific print that causes a skip? Why
TwistedTwigleg May 12, 2023
f4836c7
Return -1 instead?
TwistedTwigleg May 12, 2023
b965244
Throw an exception? Not sure everything else is a skip...
TwistedTwigleg May 12, 2023
109c7d7
Skip the environment tests if the environment variables are not there…
TwistedTwigleg May 12, 2023
7a971e5
For MQTT311 tests, set the socket timeout options
TwistedTwigleg May 12, 2023
1095107
Derp, tests might have been failing due to Codebuild setup rather tha…
TwistedTwigleg May 12, 2023
258fa90
Clean up unreachable code
TwistedTwigleg May 12, 2023
f6ee0f2
CMakeLists cleanup
TwistedTwigleg May 15, 2023
f3c0182
Merge branch 'main' into unit_test_refactor
TwistedTwigleg May 15, 2023
8c502f5
Merge branch 'main' into unit_test_refactor
TwistedTwigleg May 24, 2023
f04a873
CR changes: Improve wording and reduce duplicate code
TwistedTwigleg May 24, 2023
d600d89
Merge branch 'unit_test_refactor' of https://github.com/awslabs/aws-c…
TwistedTwigleg May 24, 2023
d982622
CR: Add some helper functions to reduce duplicate code, use ASSERT again
TwistedTwigleg May 24, 2023
bd709bc
This should fix all the C++ tests...
TwistedTwigleg May 24, 2023
d5d0a1f
Use the latest builder release
TwistedTwigleg May 24, 2023
cf8bcc3
Adjust CMAKE to not force disabling code signing and instead just dis…
TwistedTwigleg May 25, 2023
271f49f
Forgot to set the release builder in Codebuild. This fixes that
TwistedTwigleg May 25, 2023
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
28 changes: 28 additions & 0 deletions .builder/actions/build_crt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,47 @@ class BuildCrt(Builder.Action):
technique of overlaying data from json files.
"""

def _setenv(self, env, var, value):
"""
Set environment variable now,
and ensure the environment variable is set again when tests run
"""
env.shell.setenv(var, value)
env.project.config['test_env'][var] = value

def run(self, env):
project = Builder.Project.find_project('aws-crt-cpp')
return Builder.CMakeBuild(project, args_transformer=self._transform_cmake_args)

def _transform_cmake_args(self, env, project, cmake_args):
new_args = []
is_using_openssl = False

# remove or swap out flags that we don't want for C++
for arg in cmake_args:
# we want to use PERFORM_HEADER_CHECK_CXX instead of PERFORM_HEADER_CHECK
if arg == "-DPERFORM_HEADER_CHECK=ON":
arg = "-DPERFORM_HEADER_CHECK_CXX=ON"
if (arg == "-DUSE_OPENSSL=ON"):
is_using_openssl = True

new_args.append(arg)

# If we are using OpenSSL on Linux, then we want to make sure our CI container has the latest version
# for that platform, therefore we need to update
if (is_using_openssl):
self._setenv(env, "AWS_TEST_PKCS11_USE_OPENSSL_SET", "true")
print(
"Trying to install a SSL development library (either libssl-dev or openssl-devel)")
# Make sure libssl-dev is installed
try:
Builder.InstallPackages(['libssl-dev']).run(env)
print("Installed/Updated libssl-dev")
except:
try:
Builder.InstallPackages(['openssl-devel']).run(env)
print("Installed/Updated openssl-devel")
except:
print(
"ERROR - could not install either libssl-devel or openssl-devel")
return new_args
63 changes: 3 additions & 60 deletions .builder/actions/crt-ci-prep.py
Original file line number Diff line number Diff line change
@@ -1,66 +1,9 @@
import Builder
import json
import os
import re
import subprocess
import sys
import tempfile


class CrtCiPrep(Builder.Action):
def _write_environment_script_secret_to_env(self, env, secret_name):
mqtt5_ci_environment_script = env.shell.get_secret(secret_name)
env_line = re.compile('^export\s+(\w+)=(.+)')

lines = mqtt5_ci_environment_script.splitlines()
for line in lines:
env_pair_match = env_line.match(line)
if env_pair_match.group(1) and env_pair_match.group(2):
env.shell.setenv(env_pair_match.group(1), env_pair_match.group(2), quiet=True)

def _write_secret_to_temp_file(self, env, secret_name):
secret_value = env.shell.get_secret(secret_name)

fd, filename = tempfile.mkstemp()
os.write(fd, str.encode(secret_value))
os.close(fd)

return filename

def _write_s3_to_temp_file(self, env, s3_file):
try:
tmp_file = tempfile.NamedTemporaryFile(delete=False)
tmp_file.flush()
tmp_s3_filepath = tmp_file.name
cmd = ['aws', '--region', 'us-east-1', 's3', 'cp',
s3_file, tmp_s3_filepath]
env.shell.exec(*cmd, check=True, quiet=True)
return tmp_s3_filepath
except:
print (f"ERROR: Could not get S3 file from URL {s3_file}!")
raise RuntimeError("Could not get S3 file from URL")


def run(self, env):
env.shell.setenv("AWS_TESTING_COGNITO_IDENTITY", env.shell.get_secret("aws-c-auth-testing/cognito-identity"))
env.shell.setenv("AWS_TESTING_STS_ROLE_ARN", env.shell.get_secret("aws-c-auth-testing/sts-role-arn"))

# Unfortunately, we can't use NamedTemporaryFile and a with-block because NamedTemporaryFile is not readable
# on Windows.
self._write_environment_script_secret_to_env(env, "mqtt5-testing/github-ci-environment")

cert_file_name = self._write_secret_to_temp_file(env, "unit-test/certificate")
key_file_name = self._write_secret_to_temp_file(env, "unit-test/privatekey")

env.shell.setenv("AWS_TEST_MQTT5_IOT_CORE_CERTIFICATE_PATH", cert_file_name, quiet=True)
env.shell.setenv("AWS_TEST_MQTT5_IOT_CORE_KEY_PATH", key_file_name, quiet=True)

# PKCS12 setup (MacOS only)
if (sys.platform == "darwin"):
pkcs12_file_name = self._write_s3_to_temp_file(env, "s3://aws-crt-test-stuff/unit-test-key-pkcs12.pem")
env.shell.setenv("AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY", pkcs12_file_name)
env.shell.setenv("AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY_PASSWORD", "PKCS12_KEY_PASSWORD")

actions = []

actions = [
Builder.SetupCrossCICrtEnvironment()
]
return Builder.Script(actions, name='crt-ci-prep')
34 changes: 25 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- 'docs'

env:
BUILDER_VERSION: v0.9.21
BUILDER_SOURCE: releases
BUILDER_VERSION: setup_crt_ci_from_action
BUILDER_SOURCE: channels
TwistedTwigleg marked this conversation as resolved.
Show resolved Hide resolved
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-cpp
LINUX_BASE_IMAGE: ubuntu-18-x64
Expand All @@ -18,6 +18,25 @@ env:
AWS_REGION: us-east-1

jobs:
linux-compat-use-openssl:
runs-on: ubuntu-20.04 # latest
strategy:
matrix:
image:
- fedora-34-x64
- opensuse-leap
- rhel8-x64
steps:
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_OPENSSL=ON

# These linux-compat images need to run without -DUSE_OPENSSL because they do not have OpenSSL packages
# that are up-to-date (AL2) or don't provide OpenSSL development packages that is found in CMake (alpine)
# or are not able to connect on the socket even with the correct setup (manylinux2014)
linux-compat:
runs-on: ubuntu-20.04 # latest
strategy:
Expand All @@ -26,9 +45,6 @@ jobs:
- manylinux2014-x64
- manylinux2014-x86
- al2-x64
- fedora-34-x64
- opensuse-leap
- rhel8-x64
- alpine-3.16-x64
- alpine-3.16-x86
- alpine-3.16-armv6
Expand Down Expand Up @@ -63,7 +79,7 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }}
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --cmake-extra=-DUSE_OPENSSL=ON

raspberry:
runs-on: ubuntu-20.04 # latest
Expand Down Expand Up @@ -94,7 +110,7 @@ jobs:
run: |
export CXXFLAGS=-std=${{ matrix.std }}
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }}
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --cmake-extra=-DUSE_OPENSSL=ON

byo-crypto:
runs-on: ubuntu-20.04 # latest
Expand All @@ -103,7 +119,7 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} -cmake-extra=-DBYO_CRYPTO=ON
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBYO_CRYPTO=ON --cmake-extra=-DUSE_OPENSSL=ON

linux-shared-libs:
runs-on: ubuntu-20.04 # latest
Expand Down Expand Up @@ -139,7 +155,7 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF --cmake-extra=-DUSE_OPENSSL=ON

windows:
runs-on: windows-2022 # latest
Expand Down
62 changes: 16 additions & 46 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,12 @@ option(USE_OPENSSL "Set this if you want to use your system's OpenSSL 1.0.2/1.1.
# Let aws-iot-device-sdk-cpp-v2 report its own version in MQTT connections (instead of reporting aws-crt-cpp's version).
option(AWS_IOT_SDK_VERSION "Set the version reported by Aws::Iot::MqttClientConnectionConfigBuilder")

# Proxy integration test control - In addition to this option, all proxy tests require the following environment variables set appropriately when running tests:
#
# AWS_TEST_HTTP_PROXY_HOST - host address of the proxy to use for tests that make open connections to the proxy
# AWS_TEST_HTTP_PROXY_PORT - port to use for tests that make open connections to the proxy
# AWS_TEST_HTTPS_PROXY_HOST - host address of the proxy to use for tests that make tls-protected connections to the proxy
# AWS_TEST_HTTPS_PROXY_PORT - port to use for tests that make tls-protected connections to the proxy
# AWS_TEST_HTTP_PROXY_BASIC_HOST - host address of the proxy to use for tests that make open connections to the proxy with basic authentication
# AWS_TEST_HTTP_PROXY_BASIC_PORT - port to use for tests that make open connections to the proxy with basic authentication
#
# The x509 proxy tests also require:
#
# AWS_TEST_TLS_CERT_PATH - file path to certificate used to initialize the tls context of the x509 provider connection
# AWS_TEST_TLS_KEY_PATH - file path to the key used to initialize the tls context of the x509 provider connection
# AWS_TEST_TLS_ROOT_CERT_PATH - file path to the root CA used to initialize the tls context of the x509 provider connection
# AWS_TEST_X509_ENDPOINT - AWS account-specific endpoint to source x509 credentials from
# AWS_TEST_X509_THING_NAME - associated name of the x509 thing
# AWS_TEST_X509_ROLE_ALIAS - associated role alias ...
#
# And the mqtt websocket tests require x509 sourced credentials with sufficient permission to
# connect to IoT Core as well as:
#
# AWS_TEST_IOT_SIGNING_REGION - AWS region to make a websocket connection to
# AWS_TEST_IOT_MQTT_ENDPOINT - AWS account-specific endpoint to connect to IoT core by
#
# The MQTT5 tests environment variables:
#
# AWS_TEST_MQTT5_DIRECT_MQTT_HOST - host to connect to in direct mqtt tests
# AWS_TEST_MQTT5_DIRECT_MQTT_PORT - port to connect to in direct mqtt tests
# AWS_TEST_MQTT5_DIRECT_MQTT_BASIC_AUTH_HOST - host to connect to in direct mqtt basic authentication tests
# AWS_TEST_MQTT5_DIRECT_MQTT_BASIC_AUTH_PORT - port to connect to in direct mqtt basic authentication tests
# AWS_TEST_MQTT5_DIRECT_MQTT_TLS_HOST - host to connect to in direct mqtt tls tests
# AWS_TEST_MQTT5_DIRECT_MQTT_TLS_PORT - port to connect to in direct mqtt tls tests
# AWS_TEST_MQTT5_WS_MQTT_HOST - host to connect to in websocket tests
# AWS_TEST_MQTT5_WS_MQTT_PORT - port to connect to in websocket tests
# AWS_TEST_MQTT5_WS_MQTT_BASIC_AUTH_HOST - host to connect to in websocket basic authentication tests
# AWS_TEST_MQTT5_WS_MQTT_BASIC_AUTH_PORT - port to connect to in websocket basic authentication tests
# AWS_TEST_MQTT5_WS_MQTT_TLS_HOST - host to connect to in websocket tls tests
# AWS_TEST_MQTT5_WS_MQTT_TLS_PORT - port to connect to in websocket tls tests
# AWS_TEST_MQTT5_BASIC_AUTH_USERNAME - username to use in basic authentication tests
# AWS_TEST_MQTT5_BASIC_AUTH_PASSWORD - password to use in basic authentication tests
# AWS_TEST_MQTT5_PROXY_HOST - name of http proxy host to use in proxy-based tests
# AWS_TEST_MQTT5_PROXY_PORT - port of http proxy host to use in proxy-based tests
#
# ToDo: Scripts to populate environment variables via the CLI and IoT, SecretsManager calls
#
# Tests require environment variables setup in order to run properly.
# See https://github.com/awslabs/aws-crt-builder/blob/main/builder/actions/setup_cross_ci_crt_environment.py
# for how environment variables are setup.
# NOTE: Some environment variables use Mosquitto or Proxy servers, which are assumed to be installed
# locally if running the testing outside of CI/CD.
option(ENABLE_PROXY_INTEGRATION_TESTS "Whether or not to build and run the proxy integration tests that rely on a proxy server installed and running locally" OFF)
option(ENABLE_MQTT5_TEST "Whether or not to build and run the mqtt5 integration reply on a proxy server running locally" ON)


list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down Expand Up @@ -317,6 +276,17 @@ endif()
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD ${CMAKE_CXX_STANDARD})

# We need to force skip code signing, or iOS will not comiple in CI due to XCode.
# This only applies to iOS as MacOS doesn't care.
if (IOS)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/plist.in)
endif()
TwistedTwigleg marked this conversation as resolved.
Show resolved Hide resolved

aws_prepare_symbol_visibility_args(${PROJECT_NAME} "AWS_CRT_CPP")

# set runtime library
Expand Down
25 changes: 12 additions & 13 deletions codebuild/linux-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
version: 0.2
env:
shell: bash
#this buildspec assumes the ubuntu 14 image
variables:
BUILDER_VERSION: setup_crt_ci_from_action
BUILDER_SOURCE: channels
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-cpp
#this buildspec assumes usage of an Ubuntu image
phases:
install:
commands:
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-add-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main"
- sudo apt-get update -y
- sudo apt-get install clang-6.0 cmake3 clang-tidy-6.0 clang-format-6.0 -y -f
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip"
- unzip -q -d /tmp /tmp/awscliv2.zip
- sudo /tmp/aws/install

- sudo apt-get install gcc-7 cmake python3 python3-pip -y -f
pre_build:
commands:
- export CC=clang-6.0
- export CXX=clang++-6.0
- export CC=gcc-7
build:
commands:
- echo Build started on `date`
- aws s3 cp s3://aws-crt-test-stuff/setup_proxy_test_env.sh /tmp/setup_proxy_test_env.sh
- sudo chmod a+xr /tmp/setup_proxy_test_env.sh
# Setup Mqtt5 test environment
- source ./codebuild/mqtt5_test_setup.sh s3://aws-crt-test-stuff/CodeBuildIotProdMQTT5EnvironmentVariables_v2.txt us-east-1
- ./codebuild/common-posix.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_FUZZ_TESTS=ON -DENABLE_MQTT5_TEST=ON
- git submodule update --init
# Build using builder, which will also run tests
- python3 -c "from urllib.request import urlretrieve; urlretrieve('$BUILDER_HOST/$BUILDER_SOURCE/$BUILDER_VERSION/builder.pyz?run=$CODEBUILD_BUILD_ID', 'builder.pyz')"
- python3 builder.pyz build --project aws-crt-cpp downstream --cmake-extra=-DUSE_OPENSSL=ON
post_build:
commands:
- echo Build completed on `date`
Expand Down
Loading