File: send.sh

package info (click to toggle)
tpm2-tools 5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,988 kB
  • sloc: ansic: 45,737; sh: 14,915; xml: 8,342; makefile: 610; python: 51
file content (24 lines) | stat: -rw-r--r-- 599 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# SPDX-License-Identifier: BSD-3-Clause

source helpers.sh

# assume this script is run from the test/ directory
TPM2_COMMAND_FILE="${abs_srcdir}/test/integration/fixtures/get-capability-tpm-prop-fixed.bin"

start_up

if [ ! -f "${TPM2_COMMAND_FILE}" ]; then
    echo "No TPM2 command file, cannot run $0"
    exit 1
fi

# check default stdin(file fd)/stdout
tpm2 send < "${TPM2_COMMAND_FILE}" > /dev/null

# check default stdin(pipe fd) with output file
cat ${TPM2_COMMAND_FILE} | tpm2 send -o /dev/null

# check -o out and argument file input
tpm2 send -o /dev/null "${TPM2_COMMAND_FILE}"

exit 0