blob: 2d9573918934b84dd3b7a7ac5ebd86f19a926288 (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
Upstream-status:
diff --git a/tests/pkcs11-tool.sh b/tests/pkcs11-tool.sh
index 2d650b52f..e64803fc3 100755
--- a/tests/pkcs11-tool.sh
+++ b/tests/pkcs11-tool.sh
@@ -64,7 +64,7 @@ if ! test -f "${SOFTHSM_MODULE}"; then
exit 77
fi
-if [ -z "$(which pkcs11-tool 2>/dev/null)" ]; then
+if ! command -v pkcs11-tool >/dev/null; then
echo "Need pkcs11-tool from opensc package to run this test."
exit 77
fi
diff --git a/tests/tpm2.sh b/tests/tpm2.sh
index d48364c6c..a03945da8 100755
--- a/tests/tpm2.sh
+++ b/tests/tpm2.sh
@@ -29,22 +29,22 @@ if ! test -x "${CERTTOOL}"; then
exit 77
fi
-if [ -z "$(which swtpm 2>/dev/null)" ]; then
+if ! command -v swtpm >/dev/null; then
echo "Need swtpm package to run this test."
exit 77
fi
-if [ -z "$(which ncat 2>/dev/null)" ]; then
+if ! command -v ncat >/dev/null; then
echo "Need ncat from nmap-ncat package to run this test."
exit 77
fi
-if [ -z "$(which tpm2_startup 2>/dev/null)" ]; then
+if ! command -v tpm2_startup >/dev/null; then
echo "Need tpm2_startup from tpm2-tools package to run this test."
exit 77
fi
-if [ -z "$(which base64 2>/dev/null)" ]; then
+if ! command -v base64 >/dev/null; then
echo "Need the base64 tool to run this test."
exit 77
fi
@@ -58,7 +58,7 @@ case `"$OPENSSL" version` in
;;
esac
-if [ -z "$(which tpm2tss-genkey 2>/dev/null)" ]; then
+if ! command -v tpm2tss-genkey >/dev/null; then
echo "Need tpm2tss-genkey from tpm2-tss-engine package to run this test."
exit 77
fi
diff --git a/tests/tpmtool_test.sh b/tests/tpmtool_test.sh
index a14242808..962d571f6 100755
--- a/tests/tpmtool_test.sh
+++ b/tests/tpmtool_test.sh
@@ -28,27 +28,27 @@ if [ "$(id -u)" -ne 0 ]; then
exit 77
fi
-if [ -z "$(which swtpm 2>/dev/null)" ]; then
+if ! command -v swtpm >/dev/null; then
echo "Need swtpm package to run this test."
exit 77
fi
-if [ -z "$(which tcsd 2>/dev/null)" ]; then
+if ! command -v tcsd >/dev/null; then
echo "Need tcsd (TrouSerS) package to run this test."
exit 77
fi
-if [ -z "$(which tpm_createek 2>/dev/null)" ]; then
+if ! command -v tpm_createek >/dev/null; then
echo "Need tpm_createek from tpm-tools package to run this test."
exit 77
fi
-if [ -z "$(which ncat 2>/dev/null)" ]; then
+if ! command -v ncat >/dev/null; then
echo "Need ncat from nmap-ncat package to run this test."
exit 77
fi
-if [ -z "$(which expect 2>/dev/null)" ]; then
+if ! command -v expect >/dev/null; then
echo "Need expect from expect package to run this test."
exit 77
fi
|