Commit Graph

48 Commits

Author SHA1 Message Date
Stefan Berger
314f5f411b Travis: Downgrade to setuptools 59.6.0 to avoid error in 71.x
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: https://github.com/pypa/setuptools/issues/4483
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-12-02 15:24:57 -05:00
Stefan Berger
459f4e7dea Travis: Update from focal to jammy and from bionic to focal
Since the tss2 package is commonly available in focal and jammy
move it into to the general list of packages to installed.

libtpm2-pkcs11-tools is available since jammy, so installed it
there to enable the TPM 2 pkcs11 tests.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-02-27 07:10:10 -05:00
Stefan Berger
5e6e13802d Travis: Update from bionic to focal and from xenial to bionic
Since the package libasan2 does not exist in focal anymore, remove. The
bionic builds do not seem to require this package to be installed (maybe
it's already there), so there's no need to install it in a before_script.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-02-23 11:13:56 -05:00
Stefan Berger
2f7b271e33 Travis: Remove python3-twisted package from being installed
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-09-20 07:25:53 -04:00
Stefan Berger
d37095af6c Travis: Remove much of the python related stuff
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-04 16:04:09 -04:00
Stefan Berger
c125e34bf2 swtpm_setup: Rewrite in 'C' (addresses issue #437)
This is a 1:1 rewrite of swtpm_setup in 'C' as a first step to get
rid of the python dependency. It addresses issue #437.

Tested on: Cygwin, Fedora 33, Ubuntu Xenial & Bionic, FreeBSD,
           DragonFlyBSD, OpenBSD (i386), Mac, Debian (recent), Centos-8,
           CentOS (recent), Alpine (recent), OpenSUSE (recent)

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-05-28 13:08:16 -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
e3c6f2ffd6 Travis: Upgrade pip to v20.3.3
Pip 21.0.0 seems to be broken when upgraded to on Xenial. So
let's just only upgrade to 20.3.3.

$ sudo pip3 install --upgrade cryptography
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-01-29 10:51:30 -05:00
Stefan Berger
f495d8fc9b Travis: Remove OSX CI/CD due to costs
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-11-17 16:55:45 -05:00
Stefan Berger
1ed75624a6 Travis: Run pylint on new swtpm-localca, remove flock on OS X
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-18 12:09:11 -04:00
Stefan Berger
7ebb501646 Travis: Check for clean python files and add new python dependencies
Check for clean python files under swtpm_setup.py using pylint3.
Add new python dependencies.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-08-28 16:27:15 -04:00
Stefan Berger
0194fb22a5 Travis: Run IBM TSS2 for coverage; use Bionic
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>
2020-04-09 19:39:38 -04:00
Stefan Berger
ba65323def Travis: Checkout a certain libtpms revision
Allow specifying a libtpms revision to test with, defaulting to
master branch.

Have the OS X test use the stable-0.6.0 branch.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-03-18 09:20:50 -04:00
Stefan Berger
3b269659df Travis: Run make check with VERBOSE=1
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-02-17 13:58:03 -05:00
Stefan Berger
60e3abc3c8 Travis: Add asan build for non-openssl usage in libtpms
Since I am not often using the non-openssl crypto function usage
in libtpms, add a build to Travis that exercises the old code.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-11-27 11:20:26 -05:00
Stefan Berger
0151abba99 Travis: Work around failing OsX builds due to brew error
The Travis build on OSX was failing due to the following error:

/usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative': \
   /usr/local/Homebrew/Library/Homebrew/global.rb:110: \
   syntax error, unexpected keyword_rescue, expecting keyword_end (SyntaxError)

	from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'

The command "brew tap discoteq/discoteq" failed and exited with 1 during .

This patch resolves the issue.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-10-25 10:54:54 -04:00
Stefan Berger
a38cb19b97 Travis: Only clone libtpms if libtpms dir does not exist
Only build the libtpms dir if it doesn't exist. When we do a Coverity
scan build it looks like we are now running the script afterwards as
well and this creates a build failure due to the 2nd clone.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-13 21:26:10 -04:00
Stefan Berger
e87114b4b6 Travis: Set LIBTPMS_CFLAGS when sanitizing swtpm
Set the LIBTPMS_CFLAGS for libtpms to sanitize the same as we sanitize
in swtpm. Also set UBSAN_OPTIONS and ASAN_OPTIONS for directing runtime
behavior to halt_on_error=1.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-04-18 07:59:53 -04:00
Stefan Berger
281e7d2d43 travis: Run cpp-coveralls without sudo
Adjust directory and file ownerships so that we don't have to
run cpp-coveralls under sudo.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-04-03 12:46:25 -04:00
Stefan Berger
8d70fd4a16 tests: Pass --runas parameter to swtpm
Pass the --runas parameter to swtpm so we can test switching it
to a given user 'nobody'.

We also have to change ownership of files and directories so that
the nobody user can write the coverage files when swtpm ends.
In the test case we then use the trick of changing file ownership
just before we terminate swtpm, which will trigger the writing
of the .gcda files. We need to have nobody own these files.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-04-02 18:08:06 -04:00
Stefan Berger
4c7faf4617 travis: Exclude libtpms directory from coverage reporting
Exclude libtpms directory from coverage reporting.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-04-02 18:08:06 -04:00
Stefan Berger
df010be650 Travis: Add libseccomp-dev to packages to install
Do not run the 'asan' test with seccomp compiled in since the asan
libraries seem to use syscalls that we blacklist in the seccomp
profile. In particular those are:

- clone
- sigaltstack
- ptrace

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-18 15:43:44 -04:00
Stefan Berger
4d74a926b3 Travis: Get Travis to submit to Coverity again
The extension of the travis.yml with the matrix broke the Coverity
submission. This patch fixes this. We have to build libtpms in
build_command_prepend since before_script now does something different.

We only build in task .1 and exit early on all the other ones if
we are using the coverity_scan git branch.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-02-26 08:33:24 -05:00
Stefan Berger
02b7d5da10 Make softhsm/pkcs11 test case work on Travis on OS X
We need to run the softhsm/pkcs11 test case as root (sudo) under OS X
so that we can write the file /etc/gnutls/pkcs11.conf. However, once
we run the tests as root we cannot run the 'brew ls' command anymore
since it refuses to run with high privileges. So, if we run as root we
need to use sudo to switch to the nobody user to run the 'brew ls'
command that gives us the name of the softhsm pkcs11 module.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-23 15:42:52 -05:00
Stefan Berger
34308cc7d3 tests: Add test case that uses a pkcs11 URI for signing a cert
Use SoftHSM to create a pkcs11 URI and then use the pkcs11 URI
to sign the certificate of a TPM 2.0 with this key using swtpm-localca.

This test case works with softhsm >= 2.3.0 on Fedora and should work
with a recent version of Ubuntu. If an error is encountered setting
up the softhsm2 environment, we just skip the test.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-23 12:48:43 -05:00
Stefan Berger
aef6895d2a travis: Run tests on OSX, install, and run quick test
Run the build on OSX as well and run a quick test that exercises
some of the config files installed in --prefix=/usr/local

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-17 11:28:40 -05:00
Stefan Berger
eaf2a1db22 travis: Use ubsan (undefined behavior sanitizer) in a test run
Add another parallel test run that uses ubsan.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-23 20:36:25 -05:00
Stefan Berger
7fcd5fb45f travis: Add a build using asan for leak and address sanitization
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-18 21:30:57 -05:00
Stefan Berger
cc582b7abd travis: Use $(nproc) and reformat the yaml a bit
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-18 21:30:57 -05:00
Stefan Berger
31867f1abe travis: Use 2 parallel test runs
Parameterize the before_script and script phases and run two of them
in parallel.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-18 21:30:57 -05:00
Stefan Berger
1ad9c01651 travis: introduce a matrix for running multiple parallel tests
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-18 21:30:57 -05:00
Stefan Berger
458ea56b9e travis: Move packages to install into addons section
Move the packages to install into the addons section and
rename the before_install section to before_script section.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-18 21:30:57 -05:00
Stefan Berger
7ad2ff99e8 travis: Use libtpms master branch now
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-18 21:30:57 -05:00
Stefan Berger
9a8ee12f47 travis: Integrate with Coveralls.io
Integrate the Travis builds with Coveralls.io by sumitting the coverage
results to Coveralls.io.

We have to run the coveralls script with sudo rights since otherwise we
get permission denied errors.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-10-25 12:30:21 -04: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
Stefan Berger
94bb9f2d71 Travis: Fix the coverity scan build
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-09-24 17:46:58 -04:00
Stefan Berger
affd80ad6d travis: use 'distcheck' rather than 'check'
To test the creation of the tar and out-of-tree builds all the time, do
'distcheck' rather than a simple 'check'.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-09-01 14:49:49 -04:00
Stefan Berger
28c4645454 tests: Activate test case for swtpm-localca
With the SAN data in the certificate properly generated and accepted by
certtool, we can now activate the test case for swtpm-localca.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 14:22:12 -04:00
Marc-André Lureau
f9227dda91 build-sys: replace bootstrap with autogen
Follow more closely the https://github.com/cgwalters/build-api.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Marc-André Lureau
7318ae5125 build-sys: use pkg-config variable to check libtpms cryptolib
We also have to move the Travis tests to xenail since PKG_CHECK_VAR
was not available in trusty (14.04).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Stefan Berger
fbc596abbb swtpm: Provide support for TPM2 using --tpm2
Implement support for TPM2. Some of the capabilities are not supported yet in
this patch.

Extend the man pages with description for --tpm2.

Missing: configure should probe for needed API calls in libtpms

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:46 -04:00
Stefan Berger
55369fb652 travis: checkout tpm2-preview.rev146.v2 branch of libtpms
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-03-14 15:38:01 -04:00
Stefan Berger
c2ca9afc2c tests: use send1msg() in place of sendmsg() for older twisted versions
Use the send1msg() ot the twisted sendmsg package since sendmsg()
is only supported in more recent versions of twisted.

Following this we also don't need to install a recent version of twisted
via pip on Travis, which runs Ubuntu 14.04.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-09-29 20:03:14 -04:00
Stefan Berger
5c7f8386ce tests: Use python twisted for sendmsg on python 2
Rather than sending two separate messages with the bare python 2
API, use the python twisted package to send the control and data
in one sendmsg() call. This avoids occasional test failures in
the ctrlchannel test case that is currently sending the data and
control part of the message in 2 steps, which can lead to the
recpient not seeing the whole message.

Add python-twisted as a build dependency to the rpm and Debian
builds and the .travis.yml.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-09-29 14:15:26 -04:00
Stefan Berger
bc5118dde7 travis: Add pep8 test for python code
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-09-29 13:55:56 -04:00
Stefan Berger
c5b54f3279 Build: Fix coverity_scan parameters
Use a new and encrypted token. Fix other parameters. Build works now
and submits to coverity if coverty_scan branch is pushed to.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-09-22 10:51:57 -04:00
Stefan Berger
11e8030a9d Extend Travis integration with Coverity Scans
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-09-22 09:46:27 -04:00
Stefan Berger
2846f11541 ci: add .travis.yml
Add script for integration with Travis.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-07-31 13:21:41 -04:00