[gnutls-devel] GnuTLS | Test failure in test-ciphers-api.sh (#764)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Oct 8 18:35:22 CEST 2019

Ricardo M_ Correia commented:

Ok, I believe I figured out what's going on. I ran the tests in a slightly different (non-sandboxed) environment and they passed, but they still didn't pass in the sandboxed environment.

I noticed that `test-ciphers-api.sh` was failing with `SIGILL` in the sandboxed environment, but only on the 4th run of the `aes128-cbc` test.

However, in the non-sandboxed environment, `aes128-cbc` only ran twice, because `test-ciphers-api.sh` exited early with the `non-x86 CPU detected` message.

So the problem was that `test-ciphers-api.sh` was not detecting that this was not a x86 CPU in the sandboxed environment.
The root cause of the problem is in this code, inside `tests/scripts/common.sh`:

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

The way this is implemented, a non-x86 CPU will never be detected if `lscpu` is not available, i.e. if 
`utillinux` is not installed and included in the `PATH` variable.

My suggestion is that this code is reworked to use the `uname -m` command, which is more likely to be available as it's part of `coreutils`, or that `utillinux` is added as a required dependency in `README.md` and/or wherever else the dependencies are documented.

Either way, I'm going to add `utillinux` as a dependency of GnuTLS in NixOS, to fix this issue in the meantime.


Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/764#note_227613524
You're receiving this email because of your account on gitlab.com.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20191008/2d225162/attachment.html>

More information about the Gnutls-devel mailing list