linux-stable/tools/testing/selftests/tpm2
Stefan Berger 2d869f0b45 selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle
The following output can bee seen when the test is executed:

  test_flush_context (tpm2_tests.SpaceTest) ... \
    /usr/lib64/python3.6/unittest/case.py:605: ResourceWarning: \
    unclosed file <_io.FileIO name='/dev/tpmrm0' mode='rb+' closefd=True>

An instance of Client does not implicitly close /dev/tpm* handle, once it
gets destroyed. Close the file handle in the class destructor
Client.__del__().

Fixes: 6ea3dfe1e0 ("selftests: add TPM 2.0 tests")
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2022-10-05 00:25:56 +03:00
..
Makefile selftests: tpm2: install python files 2019-09-23 08:33:16 -06:00
settings selftests/tpm2: increase timeout for kselftests 2022-06-28 13:31:10 -06:00
test_smoke.sh selftests: tpm: upgrade TPM2 tests from Python 2 to Python 3 2020-07-06 14:20:35 -06:00
test_space.sh selftests: tpm: upgrade TPM2 tests from Python 2 to Python 3 2020-07-06 14:20:35 -06:00
tpm2.py selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle 2022-10-05 00:25:56 +03:00
tpm2_tests.py selftests: tpm: add async space test with noneexisting handle 2022-03-08 10:33:17 +02:00