Commit Graph

12 Commits

Author SHA1 Message Date
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
9c5bb4ac73 tests: Test automatic termination upon loss of ctrl channel connection
Extend the test_ctrlchannel3 to test for automatic termination of swtpm
upon loss of control channel connection.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-09-22 13:27:38 -04:00
Stefan Berger
1f36b7fec4 tests: Use SOCK_STREAM for CMD_SET_DATAFD socketpair
Switch to SOCK_STREAM for the CMD_SET_DATAFD socketpair where the one
end is passed to swtpm to test that this type of socket will cause
automatic termination of swtpm when the connection is lost. This is also
the socket type that QEMU uses.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-09-22 13:27:38 -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
Stefan Berger
f1adde9f29 tests: test for availability of TPM 1.2 support in swtpm
Skip test cases for TPM 1.2 if TPM 1.2 support is not provided by swtpm.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
[ skip more tests ]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-08-10 07:13:24 -04:00
Stefan Berger
930c7ba16e tests: Allow seccomp override w/ SWTPM_TEST_SECCOMP_OPT env var
The Ubuntu (PPA) build system executes the build on an environment that
has problems with seccomp profiles. It does not allow us to run the test
suite with swtpm applying its seccomp profile since it fails with a
'bad system call' error. To work around this we introduce the env. variable
SWTPM_TEST_SECCOMP_OPT that we can set to "--seccomp action=none" to avoid
having swtpm apply it seccomp profile.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-01-15 15:49:51 -05:00
Stefan Berger
8c2cb90f11 test: Replace uname -o with uname -s
Replace single occurrence of uname -o with uname -s so it's portable.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-23 17:56:31 -05:00
Stefan Berger
8f0f381f95 scripting: Use #!/usr/bin/env bash rather than /bin/bash
On some systems /bin/bash does not exists but the bash is somewhere
else and can be invoked with /usr/bin/env bash.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-09-10 16:49:12 +00:00
Stefan Berger
610cd51e5b tests: Make python test code independent of python 2 or 3
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Stefan Berger
47c7ea7783 tests: Make the killing of processes less noisy
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Stefan Berger
313cf75c42 tests: Enable running tests in out-of-source builds
Pass the top_builddir and top_srcdir via TESTS_ENVIRONMENT
variable in Makefile.am.

Use TESTDIR for the path to the test directory and replace
previously used DIR in all occurences.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Stefan Berger
281cb8ac8c tests: Split off CMD_SET_DATAFD test into own file
Split off the CMD_SET_DATAFD into its own file. This test only works on
Linux, so we skip it on Cygwin for example. Otherwise it should be able
to run.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-11 18:57:16 -04:00