Commit Graph

33 Commits

Author SHA1 Message Date
Stefan Berger
05f4d91989 test: Exit IBM TSS2 test early if it does not support swtpm
Check the help screen for necessary supported options since the IBM TSS2
test will have to be patched to support swtpm directly. If it does not
support it, exit the tests early with an error message.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-10-28 21:19:33 -04:00
Stefan Berger
395ada34d8 tests: Update IBMTSS2 test suite to v2.4.0
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-10-24 18:20:01 -04:00
Stefan Berger
8f670605b5 tests: Enable SWTPM_TEST_PROFILE for running test_tpm2_ibmtss2 with profile
Enable SWTPM_TEST_PROFILE for running the test_tpm2_ibmtss2 test cases
with a user provided profile. Document it.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-10-02 18:20:18 -04:00
Marc-André Lureau
603396664f tests: allow running ibmtss2 tests against installed version
Run against the installed version only when SWTPM_TEST_IBMTSS is
set to the directory that has the tests, otherwise, build the known
version.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-27 07:49:10 -04:00
Stefan Berger
5677f2caf5 tests: Set OPENSSL_ENABLE_SHA1_SIGNATURES=1 for IBMTSS2 test
The IBMTSS2 tests suite creates signatures over SHA1 that may now fail on
RHEL 9.x and CentOS 9. To have these tests succeed set
OPENSSL_ENABLE_SHA1_SIGNATURES=1 so the tests do not need to be modified
and also check that the TPM 2 can handle SHA1 signatures as before.
'swtpm socket --tpm2' should set this environment variable automatically
if needed.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-08-21 12:13:26 -04:00
Stefan Berger
e3cdb5d29c tests: Update IBMTSS2 test suite to v2.3.2
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-08-19 10:59:31 -04:00
Stefan Berger
eefbd3fb93 tests: Update to ibmtpm20tss v2.3.1 with rev183 tests
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-07-22 11:57:12 -04:00
Stefan Berger
77d42c9ac9 tests: Remove unncessary patches for ibmtss2 test suite
With swtpm now requiring libtpms >= 0.10 some of the patches applied to
the IBM TSS2 test suite have become obsolete. Remove them but also
have swtpm use the default-v1 profile that enables some of the newer
commands that were previously disabled.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-07-22 11:57:12 -04:00
Stefan Berger
81da4d3289 tests: Update to ibmtpm20tss v2.2.0
With patches applied to the test suite this now works with
libtpms v0.7 .. v0.10-dev.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2024-06-27 09:37:21 -04:00
Stefan Berger
9a154fa45f tests: ibmtss2: Add patch to disable x509 test with older libtpms
Older versions of libtpms need to have another patch applied that disables
x509 certificate creation (0013-Disable-x509-test-cases-part2.patch).

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-05-15 14:21:37 -04:00
Stefan Berger
3095011412 tests: Upgrade to ibmtss2 v2.0.1
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-05-11 09:24:54 -04:00
Stefan Berger
5704342aa8 tests: Fix shellcheck issue SC2181 by if cmd; ...
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-01-27 11:58:54 -05:00
Stefan Berger
4cad2bb32e tests: Fix shellcheck issue SC2143 by using grep -q
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-01-26 08:12:59 -05:00
Stefan Berger
5b51dc6a58 tests: Fix issues related to SC2164
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-01-13 21:02:51 -05:00
Stefan Berger
fd7a812b24 tests: Fix code to pass shellcheck with some errors disabled
Fix the test cases to pass shellcheck with some of the errors
disable.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-01-13 13:59:02 -05:00
Stefan Berger
85ec64573b tests: Patch IBM TSS2 test suite for OpenSSL 3.x
Apply a patch to the IBM TSS2 v1.6 test suite when OpenSSL 3.x is de-
tected.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-05-03 13:27:13 -04:00
Stefan Berger
f894b45f99 tests: OSSL 3: Make TPM 1.2 test compile; skip IBM TSS 2 test
Add CFLAGS="-DOPENSSL_SUPPRESS_DEPRECATED=1" to the configure line
to avoid compile-time errors when building the TPM 1.2 test with
OpenSSL 3.0.

IBM TSS2 v1.6 test does not currently work with OpenSSL 3.0, so
skip it.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-11-05 12:59:42 -04:00
Stefan Berger
cce7503cbf tests: exit with error code if mktemp fails
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-11-02 08:35:49 -04:00
Marc-André Lureau
c48dd1e279 tests: test for availability of TPM 2.0 support in swtpm
Skip test cases for TPM 2.0 if TPM 2.0 support is not provided by swtpm.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-08-10 07:13:24 -04:00
Stefan Berger
be6ba388a2 tests: Store and also restore the volatile state at every step
Add restoring of the volatile state after having it stored.

Since this is now taking a long time it must be explicitly enabled
by setting the environment variable SWTPM_TEST_STORE_VOLATILE=1.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-03-17 19:19:10 -04:00
Stefan Berger
b91575e7da tests: Set test-check local user.name and user.email before git am
If we are running the tests as a user that doesn't have a git config
setup we run into the following issue when trying to apply patches
suing 'git am':

Committer identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

This patch fixes this by setting the git config on the local checkout
before using 'git am'.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-03-17 19:19:10 -04:00
Stefan Berger
e78c9db255 tests: Apply patches to IBM TSS2 test suite
Apply patches to the IBM TSS2 test suite rather than using sed on its
files and other types of file manipulations.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-03-01 07:54:27 -05:00
Stefan Berger
4d4d24fb56 tests: Use the IBM TSS2 v1.6.0's test suite
Upgrade to use the IBM TSS2 tests from v1.6.0.

Add a patch that eliminates all testing of 3072 bit RSA keys in case
libtpms does not support such keys. Also disable a test case related
to ACT for older revisions.

This test passes with libtpms 0.8.0 as well libtpms 0.6.0 and 0.7.0.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-02-24 12:23:27 -05:00
Stefan Berger
468f7e61c3 tests: Fix spelling error swptm->swtpm
This patch fixes issue #410.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-02-05 16:48:55 -05:00
Stefan Berger
605e823f39 tests: Use the IBM TSS2 v1.5.0's test suite
Upgrade to use the IBM TSS2 tests from v1.5.0.

Add a patch that eliminates all testing of 3072 bit RSA keys in case
libtpms does not support such keys. This test also passes with libtpms
0.6.0 and 0.7.0.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-07-13 11:10:56 -04:00
Stefan Berger
8abf473257 tests: Remove RSA 3072 tests only if libtpms not show RSA 3072 support
Check the libtpms capabilities via 'swtpm_ioctl -i 4' to see whether
libtpms supports RSA 3072 bit keys. Only if this is not the case
deactivate all RSA 3072 bit key tests.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-05-04 18:12:24 -04:00
Stefan Berger
3e7555c469 tests: Change localhost to 127.0.0.1 or explicityly set 127.0.0.1
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>
2020-04-09 19:39:38 -04:00
Stefan Berger
8415d39d5f tests: Use the IBM TSS2 v1.4.0's test suite
Upgrade to use the IBM TSS2 tests from v1.4.0 but eliminate all testing
with 3072 bit RSA keys.

This test also passes with libtpms 0.6.0 and 0.7.0.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-04-07 12:59:27 -04:00
Stefan Berger
8dc2415d53 tests: Have IBM TSS2 test case use tags/v1.3.0 of the TPM 2.0 TSS repo
Use v1.3.0 of the IBM TSS 2.0 repo.

Depending on the revision that libtpms implements, some test cases have to be
replaced with empty files.

The test suite now works with the libtpms stable-0.6.0 and stable-0.7.0
branches. A patch fixing an NV PIN issue needed to be applied to those
branches.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-12-20 23:11:06 -05:00
Stefan Berger
22ecb5ce5a tests: Have IBM TSS2 test not use the raw interface anymore
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-08 07:09:16 -04:00
Stefan Berger
4ba6012cef tests: Use tag v1470 for revision of ibmtss2 test suite
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-06-05 21:31:05 -04:00
Stefan Berger
a1c9aedd77 tests: Set TPM_INTERFACE_TYPE=socsim
Set the TPM_INTERFACE_TYPE to socsim to override a potential
compile-time default.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-17 18:57:53 -05:00
Stefan Berger
03c7fe4566 tests: Get the IBM TSS2 test suite and run it
Get the IBM TSS2 test suite from its git repo, compile it, and run
its test suite if SWTPM_TEST_EXPENSIVE=1 is set.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-10-05 13:34:22 -04:00