Skip to contentSkip to conversation

selftests: add TPM 2.0 tests

PATCH RESEND In review Jarkko Sakkinen 2 participants 3 messages Jan 16, 2019 – Jan 18, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 selftests: add TPM 2.0 tests

Added the tests that I've been using for testing TPM 2.0 functionality for long time but have out-of-tree so far residing in

https://github.com/jsakkine-intel/tpm2-scripts

Cc Tadeusz Struk <tadeusz.struk at intel.com>
Signed-off-by Jarkko Sakkinen <jarkko.sakkinen at linux.intel.com>
Acked-by Joey Pabalinas <joeypabalinas at gmail.com>
---
 tools/testing/selftests/Makefile           |   1 +
 tools/testing/selftests/tpm2/Makefile      |   3 +
 tools/testing/selftests/tpm2/test_smoke.sh |   4 +
 tools/testing/selftests/tpm2/test_space.sh |   4 +
 tools/testing/selftests/tpm2/tpm2.py       | 696 +++++++++++++++++++++
 tools/testing/selftests/tpm2/tpm2_tests.py | 227 +++++++
 6 files changed, 935 insertions(+)
 create mode 100644 tools/testing/selftests/tpm2/Makefile
 create mode 100755 tools/testing/selftests/tpm2/test_smoke.sh
 create mode 100755 tools/testing/selftests/tpm2/test_space.sh
 create mode 100644 tools/testing/selftests/tpm2/tpm2.py
 create mode 100644 tools/testing/selftests/tpm2/tpm2_tests.py
tools/testing/selftests/Makefile +1 -0
index 1a2bd15c5b6e..e4556132cbc4 100644
@@ -47,6 +47,7 @@ TARGETS += sysctl
 ifneq (1, $(quicktest))
 TARGETS += timers
 endif
+TARGETS += tpm
 TARGETS += user
 TARGETS += vm
 TARGETS += x86
tools/testing/selftests/tpm2/Makefile new file +3 -0
new file mode 100644
index 000000000000..4bc0d9d2ca76
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+
+TEST_PROGS := test_smoke.sh test_space.sh
tools/testing/selftests/tpm2/test_smoke.sh new file +4 -0
new file mode 100755
index 000000000000..80521d46220c
@@ -0,0 +1,4 @@
+#!/bin/bash
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+
+python -m unittest -v tpm2_tests.SmokeTest
tools/testing/selftests/tpm2/test_space.sh new file +4 -0
new file mode 100755
index 000000000000..a6f5e346635e
@@ -0,0 +1,4 @@
+#!/bin/bash
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+
+python -m unittest -v tpm2_tests.SpaceTest
tools/testing/selftests/tpm2/tpm2.py new file +696 -0

696 lines not on this page · raw message

tools/testing/selftests/tpm2/tpm2_tests.py new file +227 -0

227 lines not on this page · raw message

Signature · 1 line
2.19.1
#1 lore raw

Hello,

Quoted 27 lines · Jarkko Sakkinen

Added the tests that I've been using for testing TPM 2.0 functionality for long time but have out-of-tree so far residing in

https://github.com/jsakkine-intel/tpm2-scripts

Cc Tadeusz Struk <tadeusz.struk at intel.com>
Signed-off-by Jarkko Sakkinen <jarkko.sakkinen at linux.intel.com>
Acked-by Joey Pabalinas <joeypabalinas at gmail.com>
---
 tools/testing/selftests/Makefile           |   1 +
 tools/testing/selftests/tpm2/Makefile      |   3 +
 tools/testing/selftests/tpm2/test_smoke.sh |   4 +
 tools/testing/selftests/tpm2/test_space.sh |   4 +
 tools/testing/selftests/tpm2/tpm2.py       | 696 +++++++++++++++++++++
 tools/testing/selftests/tpm2/tpm2_tests.py | 227 +++++++
 6 files changed, 935 insertions(+)
 create mode 100644 tools/testing/selftests/tpm2/Makefile
 create mode 100755 tools/testing/selftests/tpm2/test_smoke.sh
 create mode 100755 tools/testing/selftests/tpm2/test_space.sh
 create mode 100644 tools/testing/selftests/tpm2/tpm2.py
 create mode 100644 tools/testing/selftests/tpm2/tpm2_tests.py
tools/testing/selftests/Makefile +0 -0
index 1a2bd15c5b6e..e4556132cbc4 100644

tools/testing/selftests/Makefile TARGETS += sysctl · line 50

Quoted 4 lines
tools/testing/selftests/Makefile +1 -0
@@ -47,6 +47,7 @@ TARGETS += sysctl
 ifneq (1, $(quicktest))
 TARGETS += timers
 endif
+TARGETS += tpm

This should be tpm2, right?

Quoted 3 lines
tools/testing/selftests/Makefile +0 -0
 TARGETS += user
 TARGETS += vm
 TARGETS += x86
Signature · 2 lines
Thiago Jung Bauermann
IBM Linux Technology Center
#2 lore raw
Quoted 27 lines · Thiago Jung Bauermann

Hello,

Quoted 22 lines · Jarkko Sakkinen

Added the tests that I've been using for testing TPM 2.0 functionality for long time but have out-of-tree so far residing in

https://github.com/jsakkine-intel/tpm2-scripts

Cc Tadeusz Struk <tadeusz.struk at intel.com>
Signed-off-by Jarkko Sakkinen <jarkko.sakkinen at linux.intel.com>
Acked-by Joey Pabalinas <joeypabalinas at gmail.com>
---
 tools/testing/selftests/Makefile           |   1 +
 tools/testing/selftests/tpm2/Makefile      |   3 +
 tools/testing/selftests/tpm2/test_smoke.sh |   4 +
 tools/testing/selftests/tpm2/test_space.sh |   4 +
 tools/testing/selftests/tpm2/tpm2.py       | 696 +++++++++++++++++++++
 tools/testing/selftests/tpm2/tpm2_tests.py | 227 +++++++
 6 files changed, 935 insertions(+)
 create mode 100644 tools/testing/selftests/tpm2/Makefile
 create mode 100755 tools/testing/selftests/tpm2/test_smoke.sh
 create mode 100755 tools/testing/selftests/tpm2/test_space.sh
 create mode 100644 tools/testing/selftests/tpm2/tpm2.py
 create mode 100644 tools/testing/selftests/tpm2/tpm2_tests.py
Quoted 11 lines

tools/testing/selftests/Makefile TARGETS += sysctl · line 50

Quoted 9 lines
tools/testing/selftests/Makefile +1 -0
index 1a2bd15c5b6e..e4556132cbc4 100644
@@ -47,6 +47,7 @@ TARGETS += sysctl
 ifneq (1, $(quicktest))
 TARGETS += timers
 endif
+TARGETS += tpm

This should be tpm2, right?

Yes, it should, thank you.

/Jarkko