diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index c7bf4281d..a97189a90 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -121,6 +121,9 @@ pre_initialize_variables () { FORCE=0 KEEP_GOING=0 + : ${MBEDTLS_TEST_PLATFORM="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} + export MBEDTLS_TEST_PLATFORM + # Default commands, can be overridden by the environment : ${OPENSSL:="openssl"} : ${OPENSSL_LEGACY:="$OPENSSL"} @@ -1424,6 +1427,7 @@ run_component () { # The cleanup function will restore it. cp -p "$CONFIG_H" "$CONFIG_BAK" current_component="$1" + export MBEDTLS_TEST_CONFIGURATION="$current_component" "$@" cleanup } diff --git a/tests/scripts/curves.pl b/tests/scripts/curves.pl index 4791d5521..ebe49c51b 100755 --- a/tests/scripts/curves.pl +++ b/tests/scripts/curves.pl @@ -51,6 +51,7 @@ for my $curve (@curves) { print "\n******************************************\n"; print "* Testing without curve: $curve\n"; print "******************************************\n"; + $ENV{MBEDTLS_TEST_CONFIGURATION} = "-$curve"; system( "scripts/config.pl unset $curve" ) and abort "Failed to disable $curve\n"; diff --git a/tests/scripts/depends-hashes.pl b/tests/scripts/depends-hashes.pl index f57e7ed88..5dfc255ce 100755 --- a/tests/scripts/depends-hashes.pl +++ b/tests/scripts/depends-hashes.pl @@ -57,6 +57,7 @@ for my $hash (@hashes) { print "\n******************************************\n"; print "* Testing without hash: $hash\n"; print "******************************************\n"; + $ENV{MBEDTLS_TEST_CONFIGURATION} = "-$hash"; system( "scripts/config.pl unset $hash" ) and abort "Failed to disable $hash\n"; diff --git a/tests/scripts/depends-pkalgs.pl b/tests/scripts/depends-pkalgs.pl index 97a43e881..ce6f3d5e6 100755 --- a/tests/scripts/depends-pkalgs.pl +++ b/tests/scripts/depends-pkalgs.pl @@ -72,6 +72,7 @@ while( my ($alg, $extras) = each %algs ) { print "\n******************************************\n"; print "* Testing without alg: $alg\n"; print "******************************************\n"; + $ENV{MBEDTLS_TEST_CONFIGURATION} = "-$alg"; system( "scripts/config.pl unset $alg" ) and abort "Failed to disable $alg\n"; diff --git a/tests/scripts/key-exchanges.pl b/tests/scripts/key-exchanges.pl index 3bf7ae34f..bfde0693a 100755 --- a/tests/scripts/key-exchanges.pl +++ b/tests/scripts/key-exchanges.pl @@ -45,6 +45,7 @@ for my $kex (@kexes) { print "\n******************************************\n"; print "* Testing with key exchange: $kex\n"; print "******************************************\n"; + $ENV{MBEDTLS_TEST_CONFIGURATION} = "-$kex"; # full config with all key exchanges disabled except one system( "scripts/config.pl full" ) and abort "Failed config full\n"; diff --git a/tests/scripts/test-ref-configs.pl b/tests/scripts/test-ref-configs.pl index a434b46b2..5e110113b 100755 --- a/tests/scripts/test-ref-configs.pl +++ b/tests/scripts/test-ref-configs.pl @@ -65,6 +65,7 @@ while( my ($conf, $data) = each %configs ) { print "\n******************************************\n"; print "* Testing configuration: $conf\n"; print "******************************************\n"; + $ENV{MBEDTLS_TEST_CONFIGURATION} = "$conf"; system( "cp configs/$conf $config_h" ) and abort "Failed to activate $conf\n";