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