aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/run_all_suites.sh29
-rwxr-xr-xutil/run_test_suite.sh81
-rwxr-xr-xutil/test.sh48
3 files changed, 0 insertions, 158 deletions
diff --git a/util/run_all_suites.sh b/util/run_all_suites.sh
deleted file mode 100755
index c861efa..0000000
--- a/util/run_all_suites.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/bash
-#
-# ECTesterStandalone testing script,
-# runs all the suites on all the libraries
-#
-tempfolder=.temp_results
-cur=$PWD
-cd "$(dirname "${BASH_SOURCE[0]}")"/../dist
-run="$(which java) -jar ECTesterStandalone-dist.jar"
-suites=$($run list-suites | grep -P "^ -" | cut -c3-)
-cd $cur
-
-rm -rf $tempfolder
-mkdir $tempfolder
-while read -r suite; do
- echo "**Run $suite suite on all the libraries:"
- bash run_test_suite.sh $suite
- unzip results_$suite.zip -d $tempfolder
- rm results_$suite.zip
-done <<< "$suites"
-
-if [[ -f results_all.zip ]]; then
- echo '**Removing old archive...'
- rm -f results_all.zip
-fi
-echo '**Creating archive...'
-cd $tempfolder && zip -r ../results_all.zip . && cd ..
-rm -rf $tempfolder
-echo "**All tests finished! The results can be found in results_all.zip"
diff --git a/util/run_test_suite.sh b/util/run_test_suite.sh
deleted file mode 100755
index 67457c1..0000000
--- a/util/run_test_suite.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/bash
-#
-# ECTesterStandalone testing script,
-# runs the specified suite on all installed libraries
-#
-suite=${1,,}
-extra_args="" #e.g., -kt ECDH -st ECDSA
-tempfolder="temp_results"
-cur=$PWD
-timeout=10
-
-cd "$(dirname "${BASH_SOURCE[0]}")"/../dist
-if [[ $# -eq 0 ]]; then
- echo 'No test suite specified.'
- exit 0
-fi
-if [[ ! -f ECTesterStandalone-dist.jar ]]; then
- echo 'ECTesterStandalone-dist.jar not found. Build ECTesterStandalone first.'
- exit 0
-fi
-
-rm -rf $tempfolder
-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
- 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"
- else
- args=""
- fi
-
- #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 $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 $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 $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
- echo "#" >> $filename
- fi
- #Signature suite requires SHA1withECDSA signature type
- elif [[ $suite == "signature" ]]; then
- $run test $args $extra_args -st SHA1withECDSA $suite "$lib" > $filename 2>&1
- else
- $run test $args $extra_args $suite "$lib" > $filename 2>&1
- fi
-done <<< "$libs"
-
-#Comment out these two lines to keep java error logs. They are removed by default to prevent unnecessary cluttering of dist folder.
-echo 'Removing java error logs...'
-find . -type f -name 'hs_err_*' -exec rm {} \;
-
-if [[ -f $cur/results_$suite.zip ]]; then
- echo 'Removing old archive...'
- rm -f $cur/results_$suite.zip
-fi
-echo 'Creating archive...'
-cd $tempfolder
-zip -r $cur/results_$suite.zip .
-cd ..
-rm -rf $tempfolder
-
-echo "Finished. The results can be found in results_$suite.zip."
-exit 1
diff --git a/util/test.sh b/util/test.sh
deleted file mode 100755
index 41a16e0..0000000
--- a/util/test.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env bash
-#
-# ECTesterStandalone testing script,
-# tests to see everything is implemented correctly in the testing tool
-#
-cur=$PWD
-cd "$(dirname "${BASH_SOURCE[0]}")"/../dist
-
-trap int INT
-function int() {
- cd $cur
- exit 1
-}
-
-function do_test() {
- out=$($run "$@")
- ret=$?
- echo "$out" | tail -n1
- if [ "$ret" -ne "0" ]; then
- echo ">>>> ERROR '$@' => $ret"
- fi
-}
-
-run="$(which java) -jar ECTesterStandalone.jar"
-libs=$($run list-libs | grep -P "^\t-" | cut -d"-" -f 2 | cut -d"(" -f1)
-while read -r lib; do
- echo "** Testing library: $lib"
- support=$($run list-libs "$lib")
- kpgs=$(echo "$support" | grep KeyPairGenerators | cut -d":" -f2 | sed 's/,//g')
- kas=$(echo "$support" | grep KeyAgreements | cut -d":" -f2 | sed 's/,//g')
- sigs=$(echo "$support" | grep Signatures | cut -d":" -f2 | sed 's/,//g')
- for kpg in $kpgs; do
- echo "*** KPG: $kpg"
- do_test generate -t $kpg "$lib"
- done
- for ka in $kas; do
- echo "*** KA: $ka"
- do_test ecdh -t $ka "$lib"
- done
- for sig in $sigs; do
- echo "*** SIG: $sig"
- do_test ecdsa -t $sig "$lib"
- done
- echo -en "\n\n"
-done <<< "$libs"
-
-trap INT
-cd $cur \ No newline at end of file