Stefan Berger | 8f0f381 | 2018-09-10 16:48:04 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Stefan Berger | 023423e | 2017-03-16 15:52:40 -0400 | [diff] [blame] | 2 | |
Marc-André Lureau | c48dd1e | 2021-08-07 13:36:42 -0400 | [diff] [blame] | 3 | TESTDIR=${abs_top_testdir:-$(dirname "$0")} |
| 4 | ROOT=${abs_top_builddir:-$(dirname "$0")/..} |
Stefan Berger | fd7a812 | 2023-01-12 13:19:55 -0500 | [diff] [blame] | 5 | source "${TESTDIR}/common" |
Marc-André Lureau | c48dd1e | 2021-08-07 13:36:42 -0400 | [diff] [blame] | 6 | skip_test_no_tpm20 "${SWTPM_EXE}" |
| 7 | |
Stefan Berger | 5b51dc6 | 2023-01-13 17:08:01 -0500 | [diff] [blame] | 8 | cd "$(dirname "$0")" || exit 1 |
Stefan Berger | 023423e | 2017-03-16 15:52:40 -0400 | [diff] [blame] | 9 | |
| 10 | export SWTPM_IOCTL_BUFFERSIZE=100 |
| 11 | export SWTPM_INTERFACE=cuse |
| 12 | bash _test_tpm2_save_load_state |
| 13 | ret=$? |
| 14 | [ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret |
| 15 | |
| 16 | export SWTPM_IOCTL_BUFFERSIZE=4096 |
| 17 | export SWTPM_INTERFACE=cuse |
| 18 | bash _test_tpm2_save_load_state |
| 19 | ret=$? |
| 20 | [ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret |
| 21 | |
| 22 | export SWTPM_INTERFACE=socket+socket |
| 23 | export SWTPM_SERVER_NAME=localhost |
Stefan Berger | 950523c | 2020-08-06 15:11:12 -0400 | [diff] [blame] | 24 | export SWTPM_SERVER_PORT=65452 |
| 25 | export SWTPM_CTRL_PORT=65453 |
Stefan Berger | 023423e | 2017-03-16 15:52:40 -0400 | [diff] [blame] | 26 | bash _test_tpm2_save_load_state |
| 27 | ret=$? |
| 28 | [ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret |
| 29 | |
| 30 | export SWTPM_INTERFACE=socket+unix |
| 31 | export SWTPM_SERVER_NAME=localhost |
Stefan Berger | 950523c | 2020-08-06 15:11:12 -0400 | [diff] [blame] | 32 | export SWTPM_SERVER_PORT=65452 |
Stefan Berger | 023423e | 2017-03-16 15:52:40 -0400 | [diff] [blame] | 33 | bash _test_tpm2_save_load_state |
| 34 | ret=$? |
| 35 | [ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret |
| 36 | |
| 37 | export SWTPM_INTERFACE=unix+unix |
| 38 | bash _test_tpm2_save_load_state |
| 39 | ret=$? |
| 40 | [ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret |
| 41 | |
| 42 | exit 0 |