blob: 5935410a0ea1c9c1115e81b6612718af9e42ed49 [file] [log] [blame]
#!/usr/bin/env bash
TESTDIR=${abs_top_testdir:-$(dirname "$0")}
ROOT=${abs_top_builddir:-$(dirname "$0")/..}
source "${TESTDIR}/common"
skip_test_no_tpm12 "${SWTPM_EXE}"
cd "$(dirname "$0")" || exit 1
export SWTPM_IOCTL_BUFFERSIZE=100
export SWTPM_INTERFACE=cuse
bash _test_save_load_state
ret=$?
[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
export SWTPM_IOCTL_BUFFERSIZE=4096
export SWTPM_INTERFACE=cuse
bash _test_save_load_state
ret=$?
[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
export SWTPM_INTERFACE=socket+socket
export SWTPM_SERVER_NAME=localhost
export SWTPM_SERVER_PORT=65418
export SWTPM_CTRL_PORT=65419
bash _test_save_load_state
ret=$?
[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
export SWTPM_INTERFACE=socket+unix
export SWTPM_SERVER_NAME=localhost
export SWTPM_SERVER_PORT=65418
bash _test_save_load_state
ret=$?
[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
export SWTPM_INTERFACE=unix+unix
bash _test_save_load_state
ret=$?
[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
echo "=== Testing with linear file backend ==="
export SWTPM_INTERFACE=socket+socket
export SWTPM_SERVER_NAME=localhost
export SWTPM_SERVER_PORT=65418
export SWTPM_CTRL_PORT=65419
export SWTPM_TEST_LINEAR_FILE=1
bash _test_save_load_state
ret=$?
[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
exit 0