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

ci: add ktls + asan build #4213

Merged
merged 4 commits into from
Oct 4, 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
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,17 @@ if (BUILD_TESTING)
endif()
set(UNIT_TEST_ENVS ${UNIT_TEST_ENVS} TSAN_OPTIONS=${TSAN_OPTIONS})
endif()
if(ASAN)
# "detect_odr_violation" detects violations of the "one definition rule",
# ensuring that symbols are only defined once.
# But some of our unit tests intentionally include *.c files for testing,
# resulting in duplicate global values.
set(ASAN_OPTIONS detect_odr_violation=0)
if(DEFINED ENV{ASAN_OPTIONS})
set(ASAN_OPTIONS "${ASAN_OPTIONS} $ENV{ASAN_OPTIONS}")
endif()
set(UNIT_TEST_ENVS ${UNIT_TEST_ENVS} ASAN_OPTIONS=${ASAN_OPTIONS})
endif()
message(STATUS "Running tests with environment: ${UNIT_TEST_ENVS}")

file(GLOB UNITTESTS_SRC "tests/unit/*.c")
Expand Down
8 changes: 8 additions & 0 deletions codebuild/spec/buildspec_generalbatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,11 @@ batch:
compute-type: BUILD_GENERAL1_LARGE
image: aws/codebuild/standard:7.0
privileged-mode: true
- identifier: ktlsASAN
buildspec: codebuild/spec/buildspec_ktls.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: aws/codebuild/standard:7.0
privileged-mode: true
variables:
S2N_CMAKE_OPTIONS: "-DASAN=ON"
12 changes: 8 additions & 4 deletions codebuild/spec/buildspec_ktls.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
version: 0.2
env:
variables:
S2N_KTLS_TESTING_EXPECTED: true
phases:
install:
commands:
Expand All @@ -17,4 +14,11 @@ phases:
build:
commands:
- codebuild-breakpoint
- ssh -p 2222 codebuild@localhost "cd s2n-tls; sudo modprobe tls; nix develop .#openssl111 --command bash -c 'source ./nix/shell.sh && clean && configure && build && unit'"
- |
ssh -p 2222 codebuild@localhost " \
cd s2n-tls; sudo modprobe tls; \
export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \
export S2N_KTLS_TESTING_EXPECTED=1; \
nix develop .#openssl111 --command bash -c \
'source ./nix/shell.sh && clean && configure && build && unit' \
"