Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 798759 - app-crypt/swtpm-0.6.0 fails tests
Summary: app-crypt/swtpm-0.6.0 fails tests
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Christopher Byrne
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-06-26 05:51 UTC by Agostino Sarubbo
Modified: 2021-06-29 04:40 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,96.24 KB, text/plain)
2021-06-26 05:51 UTC, Agostino Sarubbo
Details
1-test-suite.log (1-test-suite.log,3.90 KB, text/plain)
2021-06-26 05:51 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2021-06-26 05:51:39 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: app-crypt/swtpm-0.6.0 fails tests.
Discovered on: amd64 (internal ref: ci)

NOTE:
This machine uses GCC-11: https://gcc.gnu.org/gcc-11/porting_to.html
If you think this is a GCC-11 related issue, please block bug 732706.
Comment 1 Agostino Sarubbo gentoo-dev 2021-06-26 05:51:42 UTC
Created attachment 719355 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2021-06-26 05:51:43 UTC
Created attachment 719358 [details]
1-test-suite.log

1-test-suite.log
Comment 3 Christopher Byrne 2021-06-26 23:05:20 UTC
Ok, I'm able to replicate this one. The problem seems to be net-libs/gnutls[-pkcs11]. If the pkcs11 USE flags is set, the test works. 

But WHY is bewildering, basically the test runs swtpm_setup which does something like this: 
 
./../src/swtpm_setup/swtpm_setup --tpm-state /tmp/tmp.Nb3hqSSH1l --create-ek-cert --config /tmp/tmp.Nb3hqSSH1l/swtpm_setup.conf --tpm ./../src/swtpm/swtpm socket

Which eventually does this:

/var/tmp/portage/app-crypt/swtpm-0.6.0/work/swtpm-0.6.0/src/swtpm/.libs/swtpm socket --flags not-need-init,startup-clear --tpmstate dir=/tmp/tmp.vCjvLNoJ4x --pid file=/tmp/tmp.vCjvLNoJ4x/.swtpm_setup.pidfile --server type=tcp,fd=6 --ctrl type=unixio,clientfd=4

without pkcs11, it chokes on --flags (This message gets swallowed and can only be seen with strace:

[pid 22831] write(2, "Unsupported TPM interface type '--flags'.\n", 42) = 42
[pid 22831] write(2, "TPM emulator with choice of interface.\n\nUsage: /var/tmp/portage/app-crypt/swtpm-0.6.0/work/swtpm-0.6.0/src/swtpm/.libs/swtpm socket|chardev [options]\n       /var/tmp/portage/app-crypt/swtpm-0.6.0/work/swtpm-0.6.0/src/swtpm/.libs/swtpm -v|--version\n\nUse the --help option to see the help screen for each interface type.\nUse the --version options to see version information.\n", 373) = 373
Comment 4 Christopher Byrne 2021-06-27 18:39:59 UTC
So gnutls needs PKCS11 support for the tests (and some optional scripts) to work correctly.
Comment 5 Larry the Git Cow gentoo-dev 2021-06-29 04:40:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a5b95ee155f9244cbfd0c5916becbe17e52c620

commit 5a5b95ee155f9244cbfd0c5916becbe17e52c620
Author:     Christopher Byrne <salah.coronya@gmail.com>
AuthorDate: 2021-06-27 18:22:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-06-29 04:12:03 +0000

    app-crypt/swtpm: Require pkcs11 support from gnutls/certtool
    
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: Christopher Byrne <salah.coronya@gmail.com>
    Closes: https://bugs.gentoo.org/798759
    Signed-off-by: Sam James <sam@gentoo.org>

 app-crypt/swtpm/swtpm-0.6.0-r1.ebuild | 69 +++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)