File: test_cuse

package info (click to toggle)
swtpm 0.10.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,008 kB
  • sloc: ansic: 20,787; sh: 14,667; makefile: 760; python: 173
file content (31 lines) | stat: -rw-r--r-- 634 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

# shellcheck shell=bash

# For the license, see the LICENSE file in the root directory.

if ! [[ "$(uname -s)" =~ Linux ]]; then
	echo "Need Linux to run test with CUSE interface."
	exit 77
fi

if [ "$(id -u)" -ne 0 ]; then
	echo "Need to be root to run test with CUSE interface."
	exit 77
fi

if [ -z "${SWTPM_EXE}" ]; then
	echo "Error: SWTPM_EXE must be set"
	exit 1
fi

if ! ${SWTPM_EXE} --help | grep -q cuse; then
	echo "Skipping test: swtpm was not compiled with CUSE interface"
	exit 77
fi

if [ ! -c /dev/cuse ]; then
	if ! modprobe cuse; then
		echo "Skipping test using CUSE module: module not available"
		exit 77
	fi
fi