]>
git.proxmox.com Git - swtpm.git/blob - tests/test_parameters
3 # For the license, see the LICENSE file in the root directory.
12 "--createek --lock-nvram"
13 "--take-ownership --lock-nvram"
15 "--take-ownership --ownerpass OOO"
16 "--take-ownership --srkpass SSS"
17 "--take-ownership --ownerpass OO --srkpass SS"
18 "--take-ownership --lock-nvram --display"
20 "--lock-nvram --display"
21 "--take-ownership --srk-well-known"
22 "--take-ownership --owner-well-known"
23 "--take-ownership --srk-well-known --owner-well-known"
24 "--createek --create-ek-cert --create-platform-cert --lock-nvram --config ${DIR}/swtpm_setup.conf --vmid test --display"
25 "--createek --create-ek-cert --create-platform-cert --lock-nvram --config ${DIR}/swtpm_setup.conf --vmid test --display --keyfile ${DIR}/data/keyfile.txt"
26 "--createek --create-ek-cert --create-platform-cert --lock-nvram --config ${DIR}/swtpm_setup.conf --vmid test --display --pwdfile ${DIR}/data/pwdfile.txt"
50 if [ "$(id -u)" -ne 0 ]; then
51 echo "Need to be root to run this test."
56 SWTPM_EXE
=$ROOT/src
/swtpm
/$SWTPM
59 SWTPM_SETUP_CONF
=$ROOT/etc
/swtpm_setup.conf
60 # filesystem privileges require to run swtpm_setup as root during test
61 TPMAUTHORING
="$ROOT/src/swtpm_setup/swtpm_setup --config ${SWTPM_SETUP_CONF} --runas root"
62 PATH
=${PWD}/${ROOT}/src
/swtpm_bios
:$PATH
63 PATH
=${PWD}/${ROOT}/src
/swtpm_setup
:$PATH
65 trap "cleanup" SIGTERM EXIT
67 if test "$TCSD" = ""; then
68 echo "TCSD executable 'tcsd' was not found in path."
77 chown tss
:tss
$TPMDIR 2>/dev
/null
79 echo "Could not change ownership of $TPMDIR to tss:tss." \
80 "You need to be root."
84 for (( i
=0; i
<${#PARAMETERS[*]}; i
++)); do
89 --tpm "$SWTPM_EXE socket" \
90 ${PARAMETERS[$i]} 2>&1 >/dev
/null
93 echo "ERROR: Test with parameters '${PARAMETERS[$i]}' failed."
95 elif [ ! -f $TPMDIR/tpm-00.permall
]; then
96 echo "ERROR: Test with parameters '${PARAMETERS[$i]}' did not
97 produce file $TPMDIR/tpm-00.permall."
101 FILESIZE
=`stat -c%s $TPMDIR/tpm-00.permall`
102 if [ ${FILESIZE} -ne ${FILESIZES[$i]} ]; then
103 echo "ERROR: Unexpected file size of $FILESIZE, "\
104 "expected ${FILESIZES[$i]}. Parameters: ${PARAMETERS[$i]}"
108 echo "SUCCESS with parameters '${PARAMETERS[$i]}'."