Skip to content

Commit 18040ed

Browse files
author
Yanray Wang
committed
all.sh: export LC_COLLATE=C for sorting in ASCII order
By default, 'sort' sorts characters with system default locale, which causes unexpected sorting order. To sort characters in ASCII from computer perspective, export LC_COLLATE=C to specify character collation for regular expressions and sorting with C locale. Signed-off-by: Yanray Wang <[email protected]>
1 parent 42be1ba commit 18040ed

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/scripts/all.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ pre_initialize_variables () {
163163
# basic-build-test.sh as well.
164164
RELEASE_SEED=1
165165

166+
# Specify character collation for regular expressions and sorting with C locale
167+
export LC_COLLATE=C
168+
166169
: ${MBEDTLS_TEST_OUTCOME_FILE=}
167170
: ${MBEDTLS_TEST_PLATFORM="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"}
168171
export MBEDTLS_TEST_OUTCOME_FILE
@@ -1044,23 +1047,20 @@ component_check_test_dependencies () {
10441047
tests/suites/test_suite_psa*.data tests/suites/test_suite_psa*.function |
10451048
grep -Eo '!?MBEDTLS_[^: ]*' |
10461049
grep -v MBEDTLS_PSA_ |
1047-
# By default, sort (v8.25) on ubuntu-16 and sort (v8.30) on ubuntu-20
1048-
# sort text in different order. We use -d option to sort text in
1049-
# an order considering only blanks and alphanumeric characters.
1050-
sort -ud > $found
1050+
sort -u > $found
10511051
1052-
# Expected ones with justification - keep in sorted order!
1052+
# Expected ones with justification - keep in sorted order by ASCII table!
10531053
rm -f $expected
10541054
# No PSA equivalent - WANT_KEY_TYPE_AES means all sizes
10551055
echo "!MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH" >> $expected
1056+
# No PSA equivalent - used to skip decryption tests in PSA-ECB, CBC/XTS/NIST_KW/DES
1057+
echo "!MBEDTLS_BLOCK_CIPHER_NO_DECRYPT" >> $expected
10561058
# This is used by import_rsa_made_up() in test_suite_psa_crypto in order
10571059
# to build a fake RSA key of the wanted size based on
10581060
# PSA_VENDOR_RSA_MAX_KEY_BITS. The legacy module is only used by
10591061
# the test code and that's probably the most convenient way of achieving
10601062
# the test's goal.
10611063
echo "MBEDTLS_ASN1_WRITE_C" >> $expected
1062-
# No PSA equivalent - used to skip decryption tests in PSA-ECB, CBC/XTS/NIST_KW/DES
1063-
echo "!MBEDTLS_BLOCK_CIPHER_NO_DECRYPT" >> $expected
10641064
# No PSA equivalent - we should probably have one in the future.
10651065
echo "MBEDTLS_ECP_RESTARTABLE" >> $expected
10661066
# No PSA equivalent - needed by some init tests

0 commit comments

Comments
 (0)