aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authordavidhofman2021-12-09 16:32:53 +0100
committerGitHub2021-12-09 16:32:53 +0100
commit9c8d14b6fa44bb6d1b3928ecf2afc133b35e0a51 (patch)
tree442ed80f7622bce6da229a2465c2673d356b9d5e /util
parent22ef8bacc8f8238cfe07f12f2fa94b45deee04b2 (diff)
downloadECTester-9c8d14b6fa44bb6d1b3928ecf2afc133b35e0a51.tar.gz
ECTester-9c8d14b6fa44bb6d1b3928ecf2afc133b35e0a51.tar.zst
ECTester-9c8d14b6fa44bb6d1b3928ecf2afc133b35e0a51.zip
Test with default curve if possible.
Final changes to the new test suites and scripts. (#16) * Final changes in some of the test suites. * Final changes to testing scripts. * Roll back recent changes in the cofactor test suite. * Change key generation method in Degenerate, Invalid, and Twist test suites. * Small cosmetic change to the edge-cases test suite. * Small change to run_test_suite.sh
Diffstat (limited to 'util')
-rwxr-xr-xutil/run_all_suites.sh3
-rwxr-xr-xutil/run_test_suite.sh25
2 files changed, 17 insertions, 11 deletions
diff --git a/util/run_all_suites.sh b/util/run_all_suites.sh
index dd4dc7e..c861efa 100755
--- a/util/run_all_suites.sh
+++ b/util/run_all_suites.sh
@@ -15,8 +15,7 @@ mkdir $tempfolder
while read -r suite; do
echo "**Run $suite suite on all the libraries:"
bash run_test_suite.sh $suite
- mkdir $tempfolder/$suite
- unzip results_$suite.zip -d $tempfolder/$suite
+ unzip results_$suite.zip -d $tempfolder
rm results_$suite.zip
done <<< "$suites"
diff --git a/util/run_test_suite.sh b/util/run_test_suite.sh
index c465c79..67457c1 100755
--- a/util/run_test_suite.sh
+++ b/util/run_test_suite.sh
@@ -4,7 +4,8 @@
# runs the specified suite on all installed libraries
#
suite=${1,,}
-tempfolder=.temp_results
+extra_args="" #e.g., -kt ECDH -st ECDSA
+tempfolder="temp_results"
cur=$PWD
timeout=10
@@ -23,9 +24,13 @@ mkdir $tempfolder
run="$(which java) -jar ECTesterStandalone-dist.jar"
libs=$($run list-libs | grep -P "^\t-" | cut -d"-" -f 2 | cut -d"(" -f1)
while read -r lib; do
- echo "Testing library: $lib..."
- filename=$tempfolder/$"${lib// /_}"-${suite}_suite-results.txt
+ if [[ $lib == *"BoringSSL"* ]]; then
+ lib=BoringSSL
+ fi
+ mkdir -p $tempfolder/${suite}/$"${lib// /_}"
+ filename=$tempfolder/${suite}/$"${lib// /_}"/results.txt
+ echo "Testing library: $lib..."
#Botan and Crypto++ don't recognize default kgt type EC, specify kgt=ECDH instead.
if [[ $lib == *"Botan"* ]] || [[ $lib == *"Crypto++"* ]]; then
args="-gt ECDH"
@@ -35,16 +40,16 @@ while read -r lib; do
#Wrong suite can cause a freeze in some libraries. Try running the tests again with the -skip argument if it happens. Default timeout is 10s.
if [[ $suite == "wrong" ]]; then
- timeout ${timeout}s $run test $args $suite "$lib" > $filename 2>&1
+ timeout ${timeout}s $run test $args $extra_args $suite "$lib" > $filename 2>&1
if [[ $? -eq 124 ]]; then
echo "#" >> $filename
echo "# NOTE: Tests timeouted at this point after taking longer than ${timeout}s. What follows next is a second run with -skip argument." >> $filename
echo "#" >> $filename
- $run test $args $suite -skip "$lib" >> $filename 2>&1
+ $run test $args $extra_args $suite -skip "$lib" >> $filename 2>&1
fi
#Composite suite can also cause a freeze, but this time there is no -skip argument.
elif [[ $suite == "composite" ]]; then
- timeout ${timeout}s $run test $args $suite "$lib" > $filename 2>&1
+ timeout ${timeout}s $run test $args $extra_args $suite "$lib" > $filename 2>&1
if [[ $? -eq 124 ]]; then
echo "#" >> $filename
echo "# NOTE: Tests timeouted at this point after taking longer than ${timeout}s." >> $filename
@@ -52,9 +57,9 @@ while read -r lib; do
fi
#Signature suite requires SHA1withECDSA signature type
elif [[ $suite == "signature" ]]; then
- $run test $args -st SHA1withECDSA $suite "$lib" > $tempfolder/$"${lib// /_}"-${suite}_suite-results.txt 2>&1
+ $run test $args $extra_args -st SHA1withECDSA $suite "$lib" > $filename 2>&1
else
- $run test $args $suite "$lib" > $tempfolder/$"${lib// /_}"-${suite}_suite-results.txt 2>&1
+ $run test $args $extra_args $suite "$lib" > $filename 2>&1
fi
done <<< "$libs"
@@ -67,7 +72,9 @@ if [[ -f $cur/results_$suite.zip ]]; then
rm -f $cur/results_$suite.zip
fi
echo 'Creating archive...'
-zip -r -j $cur/results_$suite.zip $tempfolder/
+cd $tempfolder
+zip -r $cur/results_$suite.zip .
+cd ..
rm -rf $tempfolder
echo "Finished. The results can be found in results_$suite.zip."