Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable IBM TSS2 test via package for Bionic #231

Merged
merged 4 commits into from
Apr 9, 2020
Merged

Conversation

stefanberger
Copy link
Owner

This PR enable another IBM TSS2 related test by installing the tss2 package on Bionic. Unfortunately it wasn't as easy as moving certain test runs to Bionic but there were problems with Bionic on Travis that I could not recreate on a normal Bionic installation. The issues were related to resolving localhost to 127.0.0.1 by some TSS 1.2 and TSS 2 tools that worked fine on Xenial (on Travis) but errored on Bionic. So some adjustments had to be made to some tools and test cases to not use localhost but 127.0.0.1.

To make swtpm_setup.sh work on Travis on Bionic we need to
explicitly set TCSD_TCP_DEVICE_HOSTAME=127.0.0.1 since lookup
of localhost (with the API the tcsd is using) does not work.
It doesn't negatively affect any other use case, so no problem
setting it.

Also replace localhost in the bash tcp device path with 127.0.0.1.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
To make the test cases work on Travis on Bionic replace all occurrences of
localhost with 127.0.0.1. The only affected client tools seem to be those
related to the TPM 1.2 and the IBM TSS2. For some reason the API used
there cannot resolve localhost to 127.0.0.1.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
The IBM TSS2 is available starting with Bionic. Use it there
to extend the test coverage of the code.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Modify the test_tpm2_save_load_state_3 to create 2 orderly NVRAM indices
in the first two locations. Those indices will be cleared by a reset
of the TPM and therefore cannot be read once the TPM 2 restarts after
the reset. This also provides better test coverage.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@stefanberger stefanberger merged commit 39b49a4 into master Apr 9, 2020
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1967

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 81 unchanged lines in 16 files lost coverage.
  • Overall coverage increased (+0.1%) to 72.542%

Files with Coverage Reduction New Missed Lines %
src/swtpm/key.c 1 69.83%
src/swtpm/logging.c 1 87.64%
src/swtpm/options.c 1 81.56%
src/swtpm/pidfile.c 1 67.65%
src/swtpm_setup/swtpm_setup.c 1 69.72%
src/swtpm/utils.c 1 62.64%
src/swtpm/swtpm.c 2 81.71%
src/swtpm_ioctl/tpm_ioctl.c 3 61.26%
src/swtpm/swtpm_nvfile.c 3 78.09%
src/swtpm/ctrlchannel.c 4 87.94%
Totals Coverage Status
Change from base Build 1923: 0.1%
Covered Lines: 3696
Relevant Lines: 5095

💛 - Coveralls

@stefanberger stefanberger deleted the tests_on_bionic branch April 13, 2020 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants