]>
Commit | Line | Data |
---|---|---|
30510820 SB |
1 | #!/usr/bin/env bash |
2 | ||
3 | if [ "$(id -u)" -ne 0 ]; then | |
4 | echo "Need to be root to run this test." | |
5 | exit 77 | |
6 | fi | |
7 | ||
8 | TESTDIR=${abs_top_testdir:-$(dirname "$0")} | |
9 | ROOT=${abs_top_builddir:-$(dirname "$0")/..} | |
10 | source ${TESTDIR}/common | |
11 | skip_test_linked_with_asan "${SWTPM_EXE}" | |
12 | ||
13 | # Determine a test user and group | |
14 | id -u nobody &>/dev/null && export TESTUSER=nobody | |
15 | export TESTGROUP="$(getent group $(id -g "${TESTUSER}") | cut -d':' -f1)" | |
16 | ||
17 | if [ -z "${TESTUSER}" ] || [ -z "${TESTGROUP}" ]; then | |
18 | echo "Could not find suitable user/group for testing with." | |
19 | exit 77 | |
20 | fi | |
21 | ||
22 | TESTDIR=${abs_top_testdir:-$(dirname "$0")} | |
23 | ROOT=${abs_top_builddir:-$(dirname "$0")/..} | |
24 | source ${TESTDIR}/common | |
25 | ||
26 | cd "$(dirname "$0")" | |
27 | ||
28 | export SWTPM_INTERFACE=cuse | |
29 | bash _test_tpm2_file_permissions | |
30 | ret=$? | |
31 | [ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret | |
32 | ||
33 | export SWTPM_INTERFACE=socket+socket | |
34 | export SWTPM_SERVER_NAME=localhost | |
35 | export SWTPM_SERVER_PORT=65458 | |
36 | export SWTPM_CTRL_PORT=65459 | |
37 | bash _test_tpm2_file_permissions | |
38 | ret=$? | |
39 | [ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret | |
40 | ||
41 | exit 0 |