From 93d150f9b6a5f5f9cc75f504eb5fd5a657769076 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 13 Nov 2023 10:51:00 +0100 Subject: [PATCH 1/3] Hide spurious error message if uncrustify is not present Signed-off-by: Gilles Peskine --- tests/scripts/components-basic-checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/components-basic-checks.sh b/tests/scripts/components-basic-checks.sh index e791ad065c59..2fe94f3ce5f9 100644 --- a/tests/scripts/components-basic-checks.sh +++ b/tests/scripts/components-basic-checks.sh @@ -97,7 +97,7 @@ component_check_code_style () { } support_check_code_style () { - case $(uncrustify --version) in + case $(uncrustify --version 2>/dev/null) in *0.75.1*) true;; *) false;; esac From 64066d79d45376f7bc3c05a7424f2c05718eb56a Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 3 Nov 2025 19:33:16 +0100 Subject: [PATCH 2/3] Update comment in support_test_aesni The comment was out-of-date since the addition of `component_test_aesni_m32` in b6d39c2f8cba00eca52bc8d1081b7ddbb2c44b29 and the change from inspecting `/proc/cpuinfo` to calling `lscpu` in a7de78d050aa62197e105d963af926a1b82a64bb. Signed-off-by: Gilles Peskine --- tests/scripts/components-platform.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/scripts/components-platform.sh b/tests/scripts/components-platform.sh index d6eef6f78133..3ed81923b552 100644 --- a/tests/scripts/components-platform.sh +++ b/tests/scripts/components-platform.sh @@ -94,13 +94,11 @@ support_test_aesni () { # # The name of this function is possibly slightly misleading, but needs to align # with the name of the corresponding test, component_test_aesni. - # - # In principle 32-bit x86 can support AESNI, but our implementation does not - # support 32-bit x86, so we check for x86-64. - # We can only grep /proc/cpuinfo on Linux, so this also checks for Linux + # We check only for 64-bit x86 here: 32-bit AESNI is tested separately + # in component_test_aesni_m32. (gcc -v 2>&1 | grep Target | grep -q x86_64) && - [[ "$HOSTTYPE" == "x86_64" && "$OSTYPE" == "linux-gnu" ]] && - (lscpu | grep -qw aes) + [[ "$HOSTTYPE" == "x86_64" && "$OSTYPE" == "linux-gnu" ]] && + (lscpu | grep -qw aes) } component_test_aesni () { # ~ 60s From 339a122d5783771f7bc6cef4dbcef27eba2907bc Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 3 Nov 2025 19:34:56 +0100 Subject: [PATCH 3/3] Suppress expected output from commands when support_xxx is false Signed-off-by: Gilles Peskine --- tests/scripts/components-configuration.sh | 2 +- tests/scripts/components-platform.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/scripts/components-configuration.sh b/tests/scripts/components-configuration.sh index 89104a3bab97..f8fedf4e2575 100644 --- a/tests/scripts/components-configuration.sh +++ b/tests/scripts/components-configuration.sh @@ -227,7 +227,7 @@ support_build_baremetal () { # Older Glibc versions include time.h from other headers such as stdlib.h, # which makes the no-time.h-in-baremetal check fail. Ubuntu 16.04 has this # problem, Ubuntu 18.04 is ok. - ! grep -q -F time.h /usr/include/x86_64-linux-gnu/sys/types.h + ! grep -s -q -F time.h /usr/include/x86_64-linux-gnu/sys/types.h } component_build_tfm () { diff --git a/tests/scripts/components-platform.sh b/tests/scripts/components-platform.sh index 3ed81923b552..e35b4afe85ff 100644 --- a/tests/scripts/components-platform.sh +++ b/tests/scripts/components-platform.sh @@ -98,7 +98,7 @@ support_test_aesni () { # in component_test_aesni_m32. (gcc -v 2>&1 | grep Target | grep -q x86_64) && [[ "$HOSTTYPE" == "x86_64" && "$OSTYPE" == "linux-gnu" ]] && - (lscpu | grep -qw aes) + (lscpu | grep -qw aes) 2>/dev/null } component_test_aesni () { # ~ 60s @@ -155,7 +155,7 @@ component_test_aesni () { # ~ 60s } support_test_aesni_m32 () { - support_test_m32_no_asm && (lscpu | grep -qw aes) + support_test_m32_no_asm && (lscpu | grep -qw aes) 2>/dev/null } component_test_aesni_m32 () { # ~ 60s