From: Niels Möller Date: Sun, 16 Jun 2024 10:51:17 +0000 (+0200) Subject: Fixes for running tests in wine. X-Git-Tag: nettle_3.10_release_20240616^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8c841dc3278dec0812365f02370b41ea9d4ddee;p=thirdparty%2Fnettle.git Fixes for running tests in wine. --- diff --git a/ChangeLog b/ChangeLog index fe7974c8..1cab94c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2024-06-16 Niels Möller + + * examples/rsa-encrypt-test: Consistently add $EXEEXT to + executable names. + * examples/rsa-sign-test: Likewise. + * examples/rsa-verify-test: Likewise. + * examples/setup-env: Likewise. + * tools/nettle-pbkdf2-test: Likewise. + * tools/pkcs1-conv-test: Likewise + * tools/sexp-conv-test: Likewise. + + * configure.ac: When cross-compiling targetting windows, + always use "wine" as EMULATOR; using "wine64" for 64-bit windows + seems no longer needed. + 2024-06-15 Niels Möller * testsuite/Makefile.in (TS_SC_NETTLE): New variable. diff --git a/configure.ac b/configure.ac index b5427050..4f27e663 100644 --- a/configure.ac +++ b/configure.ac @@ -803,14 +803,7 @@ case "$host_os" in ;; esac if test "x$cross_compiling" = xyes ; then - case "$ABI" in - 64) - EMULATOR=wine64 - ;; - *) - EMULATOR=wine - ;; - esac + EMULATOR=wine fi if test "x$ABI" = x64 ; then W64_ABI=yes diff --git a/examples/rsa-encrypt-test b/examples/rsa-encrypt-test index ff935fb0..83b951c6 100755 --- a/examples/rsa-encrypt-test +++ b/examples/rsa-encrypt-test @@ -7,12 +7,12 @@ fi data="$srcdir/nettle-benchmark.c" if [ -x rsa-encrypt$EXEEXT ] ; then - if $EMULATOR ./rsa-encrypt -r rsa-decrypt$EXEEXT testkey.pub < "$data" > testciphertext ; then + if $EMULATOR ./rsa-encrypt$EXEEXT -r rsa-decrypt$EXEEXT testkey.pub < "$data" > testciphertext ; then : else exit 1 fi - if $EMULATOR ./rsa-decrypt testkey < testciphertext > testcleartext ; then + if $EMULATOR ./rsa-decrypt$EXEEXT testkey < testciphertext > testcleartext ; then : else exit 1 diff --git a/examples/rsa-sign-test b/examples/rsa-sign-test index 99d90dfc..5cd0d3fa 100755 --- a/examples/rsa-sign-test +++ b/examples/rsa-sign-test @@ -7,7 +7,7 @@ fi data="$srcdir/nettle-benchmark.c" if [ -x rsa-sign$EXEEXT ] ; then - if $EMULATOR ./rsa-sign testkey < "$data" > testsignature ; then + if $EMULATOR ./rsa-sign$EXEEXT testkey < "$data" > testsignature ; then exit 0; else exit 1 diff --git a/examples/rsa-verify-test b/examples/rsa-verify-test index 13c143cb..66dcaa25 100755 --- a/examples/rsa-verify-test +++ b/examples/rsa-verify-test @@ -7,20 +7,20 @@ fi data="$srcdir/nettle-benchmark.c" if [ -x rsa-verify$EXEEXT ] ; then - $EMULATOR ./rsa-sign testkey < "$data" > testsignature \ - && $EMULATOR ./rsa-verify testkey.pub testsignature < "$data" \ + $EMULATOR ./rsa-sign$EXEEXT testkey < "$data" > testsignature \ + && $EMULATOR ./rsa-verify$EXEEXT testkey.pub testsignature < "$data" \ || exit 1; # Try modifying the data sed s/128/129/ < "$data" >testdata - if $EMULATOR ./rsa-verify testkey.pub testsignature < testdata 2>/dev/null; then + if $EMULATOR ./rsa-verify$EXEEXT testkey.pub testsignature < testdata 2>/dev/null; then exit 1 fi # Try modifying the signature sed s/1/2/ testsignature2 - if $EMULATOR ./rsa-verify testkey.pub testsignature2 < "$data" 2>/dev/null; then + if $EMULATOR ./rsa-verify$EXEEXT testkey.pub testsignature2 < "$data" 2>/dev/null; then exit 1; fi exit 0 diff --git a/examples/setup-env b/examples/setup-env index 3ebef2c8..ba270948 100755 --- a/examples/setup-env +++ b/examples/setup-env @@ -3,5 +3,5 @@ set -e if [ -x rsa-keygen$EXEEXT ] ; then - $EMULATOR ./rsa-keygen -r rsa-decrypt$EXEEXT -o testkey || exit 1 + $EMULATOR ./rsa-keygen$EXEEXT -r rsa-decrypt$EXEEXT -o testkey || exit 1 fi diff --git a/tools/nettle-pbkdf2-test b/tools/nettle-pbkdf2-test index 2229cb9b..6e9b25ac 100755 --- a/tools/nettle-pbkdf2-test +++ b/tools/nettle-pbkdf2-test @@ -15,7 +15,7 @@ test_pbkdf2 () { # Delete carriage return characters, needed when testing with # wine. - printf "%s" "$password" | $EMULATOR ./nettle-pbkdf2 \ + printf "%s" "$password" | $EMULATOR ./nettle-pbkdf2$EXEEXT \ -i "$iters" -l "$length" "$salt" | tr -d '\r' > test1.out echo "$expected" | tr -d '\r' > test2.out diff --git a/tools/pkcs1-conv-test b/tools/pkcs1-conv-test index 0cc28b49..96156259 100755 --- a/tools/pkcs1-conv-test +++ b/tools/pkcs1-conv-test @@ -7,7 +7,7 @@ fi [ -x ./pkcs1-conv$EXEEXT ] || exit 77 # Private RSA key, generated by openssl -$EMULATOR ./pkcs1-conv >testkey.priv <testkey.priv <testkey.pub <testkey.pub <testtmp <testtmp < testsignature @@ -45,7 +45,7 @@ cat > testsignature2 <test1.out ; then + if $EMULATOR ./sexp-conv$EXEEXT -s advanced test1.out ; then true else exit 1 @@ -30,7 +30,7 @@ test_advanced () { test_advanced_hex () { print_raw "$1" test.in - if $EMULATOR ./sexp-conv -s hex test1.out ; then + if $EMULATOR ./sexp-conv$EXEEXT -s hex test1.out ; then true else exit 1 @@ -46,7 +46,7 @@ test_advanced_hex () { test_transport () { print_raw "$1" test.in - if $EMULATOR ./sexp-conv -s transport test1.out ; then + if $EMULATOR ./sexp-conv$EXEEXT -s transport test1.out ; then true else exit 1 @@ -62,7 +62,7 @@ test_transport () { test_canonical () { print_raw "$1" test.in - if $EMULATOR ./sexp-conv -s canonical test1.out ; then + if $EMULATOR ./sexp-conv$EXEEXT -s canonical test1.out ; then true else exit 1