[git] GCRYPT - branch, master, updated. libgcrypt-1.8.0-8-g94a92a3

by Jussi Kivilinna cvs at cvs.gnupg.org
Tue Aug 1 21:09:12 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".

The branch, master has been updated
       via  94a92a3db909aef0ebcc009c2d7f5a2663e99004 (commit)
      from  cf1528e7f2761774d06ace0de48f39c96b52dc4f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 94a92a3db909aef0ebcc009c2d7f5a2663e99004
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date:   Tue Aug 1 21:05:31 2017 +0300

    Add script to run basic tests with all supported HWF combinations
    
    * tests/basic_all_hwfeature_combinations.sh: New.
    * tests/Makefile.am: Add basic_all_hwfeature_combinations.sh.
    --
    
    Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1744ea7..eee24fa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -60,7 +60,7 @@ EXTRA_DIST = README rsa-16k.key cavs_tests.sh cavs_driver.pl \
 	     t-ed25519.inp stopwatch.h hashtest-256g.in \
 	     sha3-224.h sha3-256.h sha3-384.h sha3-512.h \
 	     blake2b.h blake2s.h \
-	     basic-disable-all-hwf.in
+	     basic-disable-all-hwf.in basic_all_hwfeature_combinations.sh
 
 LDADD = $(standard_ldadd) $(GPG_ERROR_LIBS)
 t_lock_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS)
diff --git a/tests/basic_all_hwfeature_combinations.sh b/tests/basic_all_hwfeature_combinations.sh
new file mode 100755
index 0000000..8ec97bf
--- /dev/null
+++ b/tests/basic_all_hwfeature_combinations.sh
@@ -0,0 +1,111 @@
+#!/bin/bash
+# Run basic tests with all HW feature combinations
+# Copyright 2017 Jussi Kivilinna <jussi.kivilinna at iki.fi>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+
+# Use BINEXT to set executable extension
+#  For example for Windows executables: BINEXT=.exe
+if [ "x$BINEXT" != "x" ] && [ -e "tests/version$BINEXT" ]; then
+	binext="$BINEXT"
+else
+	binext=""
+fi
+
+# Use BINPRE to set executable prefix
+#  For example to run Windows executable with WINE: BINPRE="wine "
+if [ "x$BINPRE" != "x" ]; then
+	binpre="$BINPRE"
+else
+	binpre=""
+fi
+
+# Use NJOBS to define number of parallel tasks
+if [ "x$NJOBS" != "x" ]; then
+	njobs="$NJOBS"
+else
+	# default to cpu count
+	ncpus=$(nproc --all)
+	if [ "x at cpus" != "x" ]; then
+		njobs=$ncpus
+	else
+		# could not get cpu count, use 4 parallel tasks instead
+		njobs=4
+	fi
+fi
+
+get_supported_hwfeatures() {
+	$binpre "tests/version$binext" 2>&1 | \
+		grep "hwflist" | \
+		sed -e 's/hwflist://' -e 's/:/ /g' -e 's/\x0d/\x0a/g'
+}
+
+hwfs=($(get_supported_hwfeatures))
+retcodes=()
+optslist=()
+echo "Total HW-feature combinations: $((1<<${#hwfs[@]}))"
+for ((cbits=0; cbits < (1<<${#hwfs[@]}); cbits++)); do
+  for ((mask=0; mask < ${#hwfs[@]}; mask++)); do
+    match=$(((1<<mask) & cbits))
+    if [ "x$match" != "x0" ]; then
+      echo -n "--disable-hwf ${hwfs[$mask]} "
+    fi
+  done
+  echo ""
+done | sort | (
+  # Run all combinations
+  nbasic=0
+  nwait=0
+  failed=0
+  output=""
+  while read opts; do
+    currn=$nbasic
+    curr_jobs=($(jobs -p))
+    while [ "${#curr_jobs[@]}" -ge "8" ]; do
+      # Wait for one job to complete
+      wait ${retcodes[$nwait]}
+      retval=$?
+      if [ "x$retval" != "x0" ]; then
+        output="$output\nERROR: HWF disable failed: [${optslist[$nwait]}]"
+        failed=1
+      else
+        output="$output\nSUCCESS: HWF disable OK: [${optslist[$nwait]}]"
+      fi
+      nwait=$((nwait+1))
+      curr_jobs=($(jobs -p))
+      if [ $failed != 0 ]; then
+        break
+      fi
+    done
+    if [ $failed != 0 ]; then
+      break
+    fi
+    nbasic=$((nbasic+1))
+    echo "[$nbasic/$((1<<${#hwfs[@]}))] Basic test with '$opts'"
+    optslist[$currn]="$opts"
+    nice nice $binpre "tests/basic$binext" $opts & retcodes[$currn]=$!
+  done
+
+  # Fetch remaining return codes
+  for ((; nwait < nbasic; nwait++)); do
+    # Wait for one job to complete
+    wait ${retcodes[$nwait]}
+    retval=$?
+    if [ "x$retval" != "x0" ]; then
+      output="$output\nERROR: HWF disable failed: [${optslist[$nwait]}]"
+      failed=1
+    else
+      output="$output\nSUCCESS: HWF disable OK: [${optslist[$nwait]}]"
+    fi
+  done
+
+  echo -e "$output"
+  exit $failed
+)

-----------------------------------------------------------------------

Summary of changes:
 tests/Makefile.am                         |   2 +-
 tests/basic_all_hwfeature_combinations.sh | 111 ++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100755 tests/basic_all_hwfeature_combinations.sh


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org


_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits




More information about the Gcrypt-devel mailing list