From 590b1ace72fc15310e1d5db811250d7b0305667e Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Tue, 5 Nov 2024 23:43:18 +0000 Subject: [PATCH 01/13] gUse the nix cache for ktls --- codebuild/spec/buildspec_ktls.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index f341e20dc51..724aedcad69 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -1,24 +1,33 @@ --- version: 0.2 +env: + variables: + NIX_CACHE_BUCKET: "s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2" phases: install: commands: - apt update - apt upgrade -y - apt install -y qemu qemu-system-x86 wget cloud-image-utils + - time sh <(curl -L https://nixos.org/nix/install) --no-daemon --yes + - time mkdir -p ~/.config/nix; echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf + - time nix copy --from $NIX_CACHE_BUCKET --all --no-check-sigs + - time nix build .#s2n-tls + - time nix build .#devShell pre_build: commands: + - mkdir ~/.ssh; echo -e "Host localhost\nUser codebuild\nPort 2222" > ~/.ssh/config - aws s3 --quiet sync s3://s2n-ktls-testing ./qemu - cd qemu; bash ./run.sh; cd .. - rsync -avz --exclude=qemu --exclude=tests/fuzz -e 'ssh -p 2222' . codebuild@localhost:/home/codebuild/s2n-tls build: commands: - - codebuild-breakpoint + - time nix copy --to ssh://localhost . - | - ssh -p 2222 codebuild@localhost " \ + ssh 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 \ + time nix develop .#openssl111 --command bash -c \ 'source ./nix/shell.sh && clean && configure && unit' \ " From c0e51fe0e5b09ccd768db1217efc754761844c2b Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Tue, 5 Nov 2024 23:51:05 +0000 Subject: [PATCH 02/13] use an actual shell, nix installer missing some things --- codebuild/spec/buildspec_ktls.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index 724aedcad69..c00e54e6102 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -1,6 +1,7 @@ --- version: 0.2 env: + shell: bash variables: NIX_CACHE_BUCKET: "s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2" phases: @@ -9,7 +10,10 @@ phases: - apt update - apt upgrade -y - apt install -y qemu qemu-system-x86 wget cloud-image-utils + - codebuild-breakpoint + - id; addgroup nixbld; usermod -aG nixbld $USER - time sh <(curl -L https://nixos.org/nix/install) --no-daemon --yes + - . ~/.nix-profile/etc/profile.d/nix.sh - time mkdir -p ~/.config/nix; echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf - time nix copy --from $NIX_CACHE_BUCKET --all --no-check-sigs - time nix build .#s2n-tls From fbd945acd2a3d6a0a5d9e6f93d67e008dea0c485 Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Wed, 6 Nov 2024 21:40:24 +0000 Subject: [PATCH 03/13] nix installer fixes --- codebuild/spec/buildspec_ktls.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index c00e54e6102..84488a4ab8c 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -9,11 +9,16 @@ phases: commands: - apt update - apt upgrade -y - - apt install -y qemu qemu-system-x86 wget cloud-image-utils - - codebuild-breakpoint - - id; addgroup nixbld; usermod -aG nixbld $USER - - time sh <(curl -L https://nixos.org/nix/install) --no-daemon --yes - - . ~/.nix-profile/etc/profile.d/nix.sh + - apt install -y qemu qemu-system-x86 wget cloud-image-utils sudo xz-utils + # Work around the opinions of the nix installer. + - id; groupadd nixbld; useradd -m -g nixbld -G nixbld nix + - | + echo "Working around the faulty yaml parser..." + echo 'nix ALL=NOPASSWD: ALL' > /etc/sudoers.d/nix + - su nix -c "wget -O /tmp/install.sh https://nixos.org/nix/install" + - su nix -c "bash /tmp/install.sh --no-daemon --yes" + - cp -aR /home/nix/.nix-profile ~/; chown -R root /root/.nix-profile; export PATH=$HOME/.nix-profile/bin:$PATH + # phew, nix installed, now turn on flakes. - time mkdir -p ~/.config/nix; echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf - time nix copy --from $NIX_CACHE_BUCKET --all --no-check-sigs - time nix build .#s2n-tls From d11a4349f237c06bc200de65cd23a989c5a55044 Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Fri, 8 Nov 2024 23:13:22 +0000 Subject: [PATCH 04/13] drop explicit build; make the nix copy commands more explicit --- codebuild/spec/buildspec_ktls.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index 84488a4ab8c..cd1cc72d80f 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -2,8 +2,6 @@ version: 0.2 env: shell: bash - variables: - NIX_CACHE_BUCKET: "s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2" phases: install: commands: @@ -20,9 +18,6 @@ phases: - cp -aR /home/nix/.nix-profile ~/; chown -R root /root/.nix-profile; export PATH=$HOME/.nix-profile/bin:$PATH # phew, nix installed, now turn on flakes. - time mkdir -p ~/.config/nix; echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf - - time nix copy --from $NIX_CACHE_BUCKET --all --no-check-sigs - - time nix build .#s2n-tls - - time nix build .#devShell pre_build: commands: - mkdir ~/.ssh; echo -e "Host localhost\nUser codebuild\nPort 2222" > ~/.ssh/config @@ -31,7 +26,13 @@ phases: - rsync -avz --exclude=qemu --exclude=tests/fuzz -e 'ssh -p 2222' . codebuild@localhost:/home/codebuild/s2n-tls build: commands: - - time nix copy --to ssh://localhost . + - nix copy --to ssh://localhost github:dougch/aws-lc?ref=nixv1.36.0 --no-write-lock-file + - nix copy --to ssh://localhost ".#packages.x86_64-linux.s2n-tls" + - nix copy --to ssh://localhost ".#packages.x86_64-linux.s2n-tls-libressl" + - nix copy --to ssh://localhost ".#packages.x86_64-linux.s2n-tls-openssl3" + - nix copy --to ssh://localhost ".#packages.x86_64-linux.s2n-tls-openssl11" + post_build: + commands: - | ssh localhost " \ cd s2n-tls; sudo modprobe tls; \ From 0eabd13ce310a74771935eceda948652fe486d14 Mon Sep 17 00:00:00 2001 From: Doug Chapman <54039637+dougch@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:47:34 -0800 Subject: [PATCH 05/13] make a ktls specific devshell --- flake.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index b38d08909fb..48e4840ad52 100644 --- a/flake.nix +++ b/flake.nix @@ -171,7 +171,20 @@ source ${writeScript ./nix/shell.sh} ''; }); - + devShells.ktls = pkgs.mkShell { + # Intended for kTLS. + # This is not an over-ride like the other shells. + inherit system; + buildInputs = [ pkgs.cmake openssl_1_1_1 ]; + S2N_LIBCRYPTO = "openssl-1.1.1"; + OPENSSL_1_1_1_INSTALL_DIR = "${openssl_1_1_1}"; + shellHook = '' + echo Setting up $S2N_LIBCRYPTO environment from flake.nix... + export PATH=${openssl_1_1_1}/bin:$PATH + export PS1="[nix $S2N_LIBCRYPTO] $PS1" + source ${writeScript ./nix/shell.sh} + ''; + }; # Used to backup the devShell to s3 for caching. packages.devShell = devShells.default.inputDerivation; packages.default = packages.s2n-tls; From f30d8ea20138de7a142f19e2e50695239f094a92 Mon Sep 17 00:00:00 2001 From: Doug Chapman <54039637+dougch@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:52:27 -0800 Subject: [PATCH 06/13] drop nix install and pre-build in favor of a minimal devshell and test run --- codebuild/spec/buildspec_ktls.yml | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index cd1cc72d80f..08a5f2f6fca 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -8,16 +8,6 @@ phases: - apt update - apt upgrade -y - apt install -y qemu qemu-system-x86 wget cloud-image-utils sudo xz-utils - # Work around the opinions of the nix installer. - - id; groupadd nixbld; useradd -m -g nixbld -G nixbld nix - - | - echo "Working around the faulty yaml parser..." - echo 'nix ALL=NOPASSWD: ALL' > /etc/sudoers.d/nix - - su nix -c "wget -O /tmp/install.sh https://nixos.org/nix/install" - - su nix -c "bash /tmp/install.sh --no-daemon --yes" - - cp -aR /home/nix/.nix-profile ~/; chown -R root /root/.nix-profile; export PATH=$HOME/.nix-profile/bin:$PATH - # phew, nix installed, now turn on flakes. - - time mkdir -p ~/.config/nix; echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf pre_build: commands: - mkdir ~/.ssh; echo -e "Host localhost\nUser codebuild\nPort 2222" > ~/.ssh/config @@ -26,18 +16,21 @@ phases: - rsync -avz --exclude=qemu --exclude=tests/fuzz -e 'ssh -p 2222' . codebuild@localhost:/home/codebuild/s2n-tls build: commands: - - nix copy --to ssh://localhost github:dougch/aws-lc?ref=nixv1.36.0 --no-write-lock-file - - nix copy --to ssh://localhost ".#packages.x86_64-linux.s2n-tls" - - nix copy --to ssh://localhost ".#packages.x86_64-linux.s2n-tls-libressl" - - nix copy --to ssh://localhost ".#packages.x86_64-linux.s2n-tls-openssl3" - - nix copy --to ssh://localhost ".#packages.x86_64-linux.s2n-tls-openssl11" + - | + ssh localhost " \ + cd s2n-tls; sudo modprobe tls; \ + export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ + export S2N_KTLS_TESTING_EXPECTED=1; \ + time nix develop .#ktls --command bash -c \ + 'source ./nix/shell.sh && clean && configure && build' \ + " post_build: commands: - | ssh localhost " \ - cd s2n-tls; sudo modprobe tls; \ + cd s2n-tls; \ export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ export S2N_KTLS_TESTING_EXPECTED=1; \ - time nix develop .#openssl111 --command bash -c \ - 'source ./nix/shell.sh && clean && configure && unit' \ + time nix develop .#ktls --command bash -c \ + 'source ./nix/shell.sh && unit ktls' \ " From f5fe84767f66afed63b7e5d8e8800c97470c2695 Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Tue, 12 Nov 2024 00:08:14 +0000 Subject: [PATCH 07/13] javac isn't available in ktls shell --- flake.nix | 1 - nix/shell.sh | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 48e4840ad52..c78a740af33 100644 --- a/flake.nix +++ b/flake.nix @@ -174,7 +174,6 @@ devShells.ktls = pkgs.mkShell { # Intended for kTLS. # This is not an over-ride like the other shells. - inherit system; buildInputs = [ pkgs.cmake openssl_1_1_1 ]; S2N_LIBCRYPTO = "openssl-1.1.1"; OPENSSL_1_1_1_INSTALL_DIR = "${openssl_1_1_1}"; diff --git a/nix/shell.sh b/nix/shell.sh index 880422f1a6b..fa727cb84e9 100644 --- a/nix/shell.sh +++ b/nix/shell.sh @@ -45,7 +45,9 @@ function configure {(set -e function build {(set -e banner "Running Build" - javac tests/integrationv2/bin/SSLSocketClient.java + if [[ -x "$(which javac)" ]]; then + javac tests/integrationv2/bin/SSLSocketClient.java + fi cmake --build ./build -j $(nproc) # Build s2n from HEAD if [[ -z "${S2N_KTLS_TESTING_EXPECTED}" ]]; then From 7f4ed8358de9223840d443a46655a173939c5e65 Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Tue, 12 Nov 2024 00:19:36 +0000 Subject: [PATCH 08/13] fix javac check --- nix/shell.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/shell.sh b/nix/shell.sh index fa727cb84e9..760c582ee8d 100644 --- a/nix/shell.sh +++ b/nix/shell.sh @@ -45,7 +45,7 @@ function configure {(set -e function build {(set -e banner "Running Build" - if [[ -x "$(which javac)" ]]; then + if [[ -f "/usr/bin/javac" ]]; then javac tests/integrationv2/bin/SSLSocketClient.java fi cmake --build ./build -j $(nproc) From 35a42130872cf7b93fa4e63c43804fd1451a799d Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Tue, 12 Nov 2024 01:06:25 +0000 Subject: [PATCH 09/13] drop time and remove unneeded packages --- codebuild/spec/buildspec_ktls.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index 08a5f2f6fca..e22b2387299 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -7,7 +7,7 @@ phases: commands: - apt update - apt upgrade -y - - apt install -y qemu qemu-system-x86 wget cloud-image-utils sudo xz-utils + - apt install -y qemu qemu-system-x86 wget cloud-image-utils pre_build: commands: - mkdir ~/.ssh; echo -e "Host localhost\nUser codebuild\nPort 2222" > ~/.ssh/config @@ -21,7 +21,7 @@ phases: cd s2n-tls; sudo modprobe tls; \ export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ export S2N_KTLS_TESTING_EXPECTED=1; \ - time nix develop .#ktls --command bash -c \ + nix develop .#ktls --command bash -c \ 'source ./nix/shell.sh && clean && configure && build' \ " post_build: @@ -31,6 +31,6 @@ phases: cd s2n-tls; \ export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ export S2N_KTLS_TESTING_EXPECTED=1; \ - time nix develop .#ktls --command bash -c \ + nix develop .#ktls --command bash -c \ 'source ./nix/shell.sh && unit ktls' \ " From 891178993315457452d843d5246c1e51be740ba1 Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Tue, 12 Nov 2024 01:20:26 +0000 Subject: [PATCH 10/13] simplify; revert just running ktls tests to get timing data --- codebuild/spec/buildspec_ktls.yml | 4 ++-- nix/shell.sh | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index e22b2387299..80f6c2c0814 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -22,7 +22,7 @@ phases: export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ export S2N_KTLS_TESTING_EXPECTED=1; \ nix develop .#ktls --command bash -c \ - 'source ./nix/shell.sh && clean && configure && build' \ + 'source ./nix/shell.sh && clean && configure' \ " post_build: commands: @@ -32,5 +32,5 @@ phases: export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ export S2N_KTLS_TESTING_EXPECTED=1; \ nix develop .#ktls --command bash -c \ - 'source ./nix/shell.sh && unit ktls' \ + 'source ./nix/shell.sh && unit' \ " diff --git a/nix/shell.sh b/nix/shell.sh index 760c582ee8d..880422f1a6b 100644 --- a/nix/shell.sh +++ b/nix/shell.sh @@ -45,9 +45,7 @@ function configure {(set -e function build {(set -e banner "Running Build" - if [[ -f "/usr/bin/javac" ]]; then - javac tests/integrationv2/bin/SSLSocketClient.java - fi + javac tests/integrationv2/bin/SSLSocketClient.java cmake --build ./build -j $(nproc) # Build s2n from HEAD if [[ -z "${S2N_KTLS_TESTING_EXPECTED}" ]]; then From f39a48700a74c53d6f9336512d63afe862c52207 Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Tue, 12 Nov 2024 22:15:17 +0000 Subject: [PATCH 11/13] rename devshell, switch to awslc --- codebuild/spec/buildspec_ktls.yml | 10 ++++------ flake.nix | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index 80f6c2c0814..179eb86d3fd 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -8,29 +8,27 @@ phases: - apt update - apt upgrade -y - apt install -y qemu qemu-system-x86 wget cloud-image-utils - pre_build: - commands: - mkdir ~/.ssh; echo -e "Host localhost\nUser codebuild\nPort 2222" > ~/.ssh/config - aws s3 --quiet sync s3://s2n-ktls-testing ./qemu - cd qemu; bash ./run.sh; cd .. - rsync -avz --exclude=qemu --exclude=tests/fuzz -e 'ssh -p 2222' . codebuild@localhost:/home/codebuild/s2n-tls - build: + pre_build: commands: - | ssh localhost " \ cd s2n-tls; sudo modprobe tls; \ export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ export S2N_KTLS_TESTING_EXPECTED=1; \ - nix develop .#ktls --command bash -c \ + nix develop .#minimal --command bash -c \ 'source ./nix/shell.sh && clean && configure' \ " - post_build: + build: commands: - | ssh localhost " \ cd s2n-tls; \ export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ export S2N_KTLS_TESTING_EXPECTED=1; \ - nix develop .#ktls --command bash -c \ + nix develop .#minimal --command bash -c \ 'source ./nix/shell.sh && unit' \ " diff --git a/flake.nix b/flake.nix index c78a740af33..09cb0184fc9 100644 --- a/flake.nix +++ b/flake.nix @@ -171,15 +171,13 @@ source ${writeScript ./nix/shell.sh} ''; }); - devShells.ktls = pkgs.mkShell { - # Intended for kTLS. + devShells.minimal = pkgs.mkShell { + # Minimal unit test environment with aws-lc. # This is not an over-ride like the other shells. - buildInputs = [ pkgs.cmake openssl_1_1_1 ]; - S2N_LIBCRYPTO = "openssl-1.1.1"; - OPENSSL_1_1_1_INSTALL_DIR = "${openssl_1_1_1}"; + buildInputs = [ pkgs.cmake aws-lc ]; + S2N_LIBCRYPTO = "awslc"; shellHook = '' echo Setting up $S2N_LIBCRYPTO environment from flake.nix... - export PATH=${openssl_1_1_1}/bin:$PATH export PS1="[nix $S2N_LIBCRYPTO] $PS1" source ${writeScript ./nix/shell.sh} ''; From 873a65784e9231e80db97a44984e8a2d7a3d42f7 Mon Sep 17 00:00:00 2001 From: Doug Chapman <54039637+dougch@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:10:55 -0800 Subject: [PATCH 12/13] revert phase rename --- codebuild/spec/buildspec_ktls.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index 179eb86d3fd..0d5cc3ca3c2 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -12,7 +12,7 @@ phases: - aws s3 --quiet sync s3://s2n-ktls-testing ./qemu - cd qemu; bash ./run.sh; cd .. - rsync -avz --exclude=qemu --exclude=tests/fuzz -e 'ssh -p 2222' . codebuild@localhost:/home/codebuild/s2n-tls - pre_build: + build: commands: - | ssh localhost " \ @@ -22,7 +22,7 @@ phases: nix develop .#minimal --command bash -c \ 'source ./nix/shell.sh && clean && configure' \ " - build: + post_build: commands: - | ssh localhost " \ From d32ae24dc81d212a1f3f624306524665160013f7 Mon Sep 17 00:00:00 2001 From: Doug Chapman <54039637+dougch@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:07:07 -0800 Subject: [PATCH 13/13] exclude some slow tests for ktls --- codebuild/spec/buildspec_ktls.yml | 1 + nix/shell.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/codebuild/spec/buildspec_ktls.yml b/codebuild/spec/buildspec_ktls.yml index 0d5cc3ca3c2..643b60ba609 100644 --- a/codebuild/spec/buildspec_ktls.yml +++ b/codebuild/spec/buildspec_ktls.yml @@ -29,6 +29,7 @@ phases: cd s2n-tls; \ export S2N_CMAKE_OPTIONS=${S2N_CMAKE_OPTIONS}; \ export S2N_KTLS_TESTING_EXPECTED=1; \ + export S2N_EXCLUDE_TESTS=aead; \ nix develop .#minimal --command bash -c \ 'source ./nix/shell.sh && unit' \ " diff --git a/nix/shell.sh b/nix/shell.sh index 880422f1a6b..368cd7bf076 100644 --- a/nix/shell.sh +++ b/nix/shell.sh @@ -56,7 +56,7 @@ function build {(set -e function unit {(set -e if [[ -z "$1" ]]; then cmake --build build -j $(nproc) - ctest --test-dir build -L unit -j $(nproc) --verbose + ctest --test-dir build -L unit -E "$S2N_EXCLUDE_TESTS" -j $(nproc) --verbose else tests=$(ctest --test-dir build -N -L unit | grep -E "Test +#" | grep -Eo "[^ ]+_test$" | grep "$1") echo "Tests:"