diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-05-26 12:43:21 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-05-26 17:36:33 +0200 |
commit | 085aa25d09db57f0ccb60305439478696ba2c47d (patch) | |
tree | a84457aff5818834d1d2cfeeaf6a0db3997ba6fb | |
parent | 6b748886799f88ddee9721dba4fc4d52854832ae (diff) | |
download | gnutls-085aa25d09db57f0ccb60305439478696ba2c47d.tar.gz |
tests: skip x86-specific tests when not in x86
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | tests/scripts/common.sh | 12 | ||||
-rw-r--r-- | tests/slow/Makefile.am | 4 | ||||
-rw-r--r-- | tests/slow/test-ciphers-common.sh | 6 | ||||
-rwxr-xr-x | tests/slow/test-hash-large.sh (renamed from tests/slow/test-hash-large) | 5 |
4 files changed, 25 insertions, 2 deletions
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh index 485197a291..5b6734b7dd 100644 --- a/tests/scripts/common.sh +++ b/tests/scripts/common.sh @@ -83,6 +83,18 @@ fail() { exit 1 } +exit_if_non_x86() +{ +which lscpu >/dev/null 2>&1 +if test $? = 0;then + $(which lscpu)|grep Architecture|grep x86 + if test $? != 0;then + echo "non-x86 CPU detected" + exit 0 + fi +fi +} + wait_for_port() { local ret diff --git a/tests/slow/Makefile.am b/tests/slow/Makefile.am index 65c8a4297a..07339bbe88 100644 --- a/tests/slow/Makefile.am +++ b/tests/slow/Makefile.am @@ -52,9 +52,9 @@ mac_override_LDFLAGS = $(NETTLE_LIBS) $(HOGWEED_LIBS) $(GMP_LIBS) $(LDADD) endif -dist_check_SCRIPTS = test-ciphers.sh override-ciphers test-hash-large test-ciphers-common.sh +dist_check_SCRIPTS = test-ciphers.sh override-ciphers test-hash-large.sh test-ciphers-common.sh check_PROGRAMS = $(ctests) cipher-test cipher-override mac-override cipher-override2 hash-large -TESTS = $(ctests) test-ciphers.sh override-ciphers test-hash-large +TESTS = $(ctests) test-ciphers.sh override-ciphers test-hash-large.sh if HAVE_LIBCRYPTO cipher_openssl_compat_LDFLAGS = $(LDADD) $(LIBCRYPTO) diff --git a/tests/slow/test-ciphers-common.sh b/tests/slow/test-ciphers-common.sh index cb415a35bc..52d9d50ea9 100644 --- a/tests/slow/test-ciphers-common.sh +++ b/tests/slow/test-ciphers-common.sh @@ -23,6 +23,9 @@ if ! test -z "${VALGRIND}"; then VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}" fi +srcdir="${srcdir:-.}" +. "${srcdir}/../scripts/common.sh" + ${PROG} ret=$? if test $ret != 0; then @@ -30,6 +33,7 @@ if test $ret != 0; then exit $ret fi +# All optimizations disabled GNUTLS_CPUID_OVERRIDE=0x1 ${PROG} ret=$? if test $ret != 0; then @@ -37,6 +41,8 @@ if test $ret != 0; then exit $ret fi +exit_if_non_x86 + GNUTLS_CPUID_OVERRIDE=0x2 ${PROG} ret=$? if test $ret != 0; then diff --git a/tests/slow/test-hash-large b/tests/slow/test-hash-large.sh index e09579a00c..74350b6686 100755 --- a/tests/slow/test-hash-large +++ b/tests/slow/test-hash-large.sh @@ -26,6 +26,9 @@ if ! test -z "${VALGRIND}"; then VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}" fi +srcdir="${srcdir:-.}" +. "${srcdir}/../scripts/common.sh" + ${PROG} ret=$? if test $ret != 0; then @@ -40,6 +43,8 @@ if test $ret != 0; then exit $ret fi +exit_if_non_x86 + GNUTLS_CPUID_OVERRIDE=0x4 ${PROG} ret=$? if test $ret != 0; then |