blob: 14d1f5f5e25326c05944ea205d137e3796024838 [file] [log] [blame]
Stefan Berger8f0f3812018-09-10 16:48:04 +00001#!/usr/bin/env bash
Stefan Berger023423e2017-03-16 15:52:40 -04002
Marc-André Lureauc48dd1e2021-08-07 13:36:42 -04003TESTDIR=${abs_top_testdir:-$(dirname "$0")}
4ROOT=${abs_top_builddir:-$(dirname "$0")/..}
Stefan Bergerfd7a8122023-01-12 13:19:55 -05005source "${TESTDIR}/common"
Marc-André Lureauc48dd1e2021-08-07 13:36:42 -04006skip_test_no_tpm20 "${SWTPM_EXE}"
7
Stefan Berger5b51dc62023-01-13 17:08:01 -05008cd "$(dirname "$0")" || exit 1
Stefan Berger023423e2017-03-16 15:52:40 -04009
10export SWTPM_IOCTL_BUFFERSIZE=100
11export SWTPM_INTERFACE=cuse
12bash _test_tpm2_save_load_state
13ret=$?
14[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
15
16export SWTPM_IOCTL_BUFFERSIZE=4096
17export SWTPM_INTERFACE=cuse
18bash _test_tpm2_save_load_state
19ret=$?
20[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
21
22export SWTPM_INTERFACE=socket+socket
23export SWTPM_SERVER_NAME=localhost
Stefan Berger950523c2020-08-06 15:11:12 -040024export SWTPM_SERVER_PORT=65452
25export SWTPM_CTRL_PORT=65453
Stefan Berger023423e2017-03-16 15:52:40 -040026bash _test_tpm2_save_load_state
27ret=$?
28[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
29
30export SWTPM_INTERFACE=socket+unix
31export SWTPM_SERVER_NAME=localhost
Stefan Berger950523c2020-08-06 15:11:12 -040032export SWTPM_SERVER_PORT=65452
Stefan Berger023423e2017-03-16 15:52:40 -040033bash _test_tpm2_save_load_state
34ret=$?
35[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
36
37export SWTPM_INTERFACE=unix+unix
38bash _test_tpm2_save_load_state
39ret=$?
40[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
41
42exit 0