<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/tpm2/test_smoke.sh, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2025-04-08T20:56:13Z</updated>
<entry>
<title>selftests: tpm2: test_smoke: use POSIX-conformant expression operator</title>
<updated>2025-04-08T20:56:13Z</updated>
<author>
<name>Ahmed Salem</name>
<email>x0rw3ll@gmail.com</email>
</author>
<published>2025-02-11T23:16:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=170ec11935de4acced0ae001562cca3a144acd67'/>
<id>urn:sha1:170ec11935de4acced0ae001562cca3a144acd67</id>
<content type='text'>
Use POSIX-conformant expression operator symbol '='.

The use of the non POSIX-conformant symbol '==' would work
in bash, but not in sh where the unexpected operator error
would result in test_smoke.sh being skipped.

Instead of changing the shebang to use bash, which may not be
available on all systems, use the POSIX-conformant expression
symbol '=' to test for equality.

Without this patch:
===================
 # make -j8 TARGETS=tpm2 kselftest
 # selftests: tpm2: test_smoke.sh
 # ./test_smoke.sh: 9: [: 2: unexpected operator
 ok 1 selftests: tpm2: test_smoke.sh # SKIP

With this patch:
================
 # make -j8 TARGETS=tpm2 kselftest
 # selftests: tpm2: test_smoke.sh
 # Ran 9 tests in 9.236s
 ok 1 selftests: tpm2: test_smoke.sh

Link: https://lore.kernel.org/r/37ztyakgrrtgvec344mg7mspchwjpxxtsprtjidso3pwkmm4f4@awsa5mzgqmtb
Signed-off-by: Ahmed Salem &lt;x0rw3ll@gmail.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: tpm2: test_smoke: Run only when TPM2 is avaialable.</title>
<updated>2024-09-17T15:56:37Z</updated>
<author>
<name>Michal Suchanek</name>
<email>msuchanek@suse.de</email>
</author>
<published>2024-08-28T11:23:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=27141f1950b8e40499a7aa95341cd5a37029a097'/>
<id>urn:sha1:27141f1950b8e40499a7aa95341cd5a37029a097</id>
<content type='text'>
Since Linux 5.6 tpm_version_major sysfs file is avaialble which gives
the TPM version.

Using this file the test can be skipped on systems with TPM 1.2.

Signed-off-by: Michal Suchanek &lt;msuchanek@suse.de&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: tpm2: redirect python unittest logs to stdout</title>
<updated>2024-07-31T17:42:22Z</updated>
<author>
<name>Muhammad Usama Anjum</name>
<email>usama.anjum@collabora.com</email>
</author>
<published>2024-07-10T08:15:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=45eb1bf4d726caff8f1dce7ac8f950012d5f64b1'/>
<id>urn:sha1:45eb1bf4d726caff8f1dce7ac8f950012d5f64b1</id>
<content type='text'>
The python unittest module writes all its output to stderr, even when
the run is clean. Redirect its output logs to stdout.

Cc: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Muhammad Usama Anjum &lt;usama.anjum@collabora.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/tpm2: Split async tests call to separate shell script runner</title>
<updated>2022-11-30T00:28:31Z</updated>
<author>
<name>Nícolas F. R. A. Prado</name>
<email>nfraprado@collabora.com</email>
</author>
<published>2022-11-28T22:03:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8008d88e6d160c4e73de5be7c3dcc54e3ccccf49'/>
<id>urn:sha1:8008d88e6d160c4e73de5be7c3dcc54e3ccccf49</id>
<content type='text'>
When the async test case was introduced, despite being a completely
independent test case, the command to run it was added to the same shell
script as the smoke test case. Since a shell script implicitly returns
the error code from the last run command, this effectively caused the
script to only return as error code the result from the async test case,
hiding the smoke test result (which could then only be seen from the
python unittest logs).

Move the async test case call to its own shell script runner to avoid
the aforementioned issue. This also makes the output clearer to read,
since each kselftest KTAP result now matches with one python unittest
report.

While at it, also make it so the async test case is skipped if
/dev/tpmrm0 doesn't exist, since commit 8335adb8f9d3 ("selftests: tpm:
add async space test with noneexisting handle") added a test that relies
on it.

Signed-off-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: tpm: upgrade TPM2 tests from Python 2 to Python 3</title>
<updated>2020-07-06T20:20:35Z</updated>
<author>
<name>Pengfei Xu</name>
<email>pengfei.xu@intel.com</email>
</author>
<published>2020-06-26T03:40:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0b78c9e8c19b57bf2081cd432841c7fe3f800633'/>
<id>urn:sha1:0b78c9e8c19b57bf2081cd432841c7fe3f800633</id>
<content type='text'>
Python 2 is no longer supported by the Python upstream project, so
upgrade TPM2 tests to Python 3.

Fixed minor merge conflicts
Shuah Khan &lt;skhan@linuxfoundation.org&gt;

Signed-off-by: Pengfei Xu &lt;pengfei.xu@intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Tested-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: tpm: Use /bin/sh instead of /bin/bash</title>
<updated>2020-06-29T20:19:38Z</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2020-06-22T21:20:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=377ff83083c953dd58c5a030b3c9b5b85d8cc727'/>
<id>urn:sha1:377ff83083c953dd58c5a030b3c9b5b85d8cc727</id>
<content type='text'>
It's better to use /bin/sh instead of /bin/bash in order to run the tests
in the BusyBox shell.

Fixes: 6ea3dfe1e073 ("selftests: add TPM 2.0 tests")
Cc: stable@vger.kernel.org
Cc: linux-integrity@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: tpm: Use 'test -e' instead of 'test -f'</title>
<updated>2020-06-29T20:19:23Z</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2020-06-22T21:20:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=88a16840f462f96d3a1808aff1d6479f87a02147'/>
<id>urn:sha1:88a16840f462f96d3a1808aff1d6479f87a02147</id>
<content type='text'>
'test -f' is suitable only for *regular* files. Use 'test -e' instead.

Cc: Nikita Sobolev &lt;Nikita.Sobolev@synopsys.com&gt;
Cc: linux-integrity@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Fixes: 5627f9cffee7 ("Kernel selftests: Add check if TPM devices are supported")
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "tpm: selftest: cleanup after unseal with wrong auth/policy test"</title>
<updated>2020-06-29T20:18:15Z</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2020-06-22T21:20:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5be206eaac9a68992fc3b06fb5dd5634e323de86'/>
<id>urn:sha1:5be206eaac9a68992fc3b06fb5dd5634e323de86</id>
<content type='text'>
The reverted commit illegitly uses tpm2-tools. External dependencies are
absolutely forbidden from these tests. There is also the problem that
clearing is not necessarily wanted behavior if the test/target computer is
not used only solely for testing.

Fixes: a9920d3bad40 ("tpm: selftest: cleanup after unseal with wrong auth/policy test")
Cc: Tadeusz Struk &lt;tadeusz.struk@intel.com&gt;
Cc: stable@vger.kernel.org
Cc: linux-integrity@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Kernel selftests: Add check if TPM devices are supported</title>
<updated>2020-05-22T19:19:57Z</updated>
<author>
<name>Nikita Sobolev</name>
<email>Nikita.Sobolev@synopsys.com</email>
</author>
<published>2020-05-21T14:43:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5627f9cffee73dca9762135b6a8c7ab7213f31e2'/>
<id>urn:sha1:5627f9cffee73dca9762135b6a8c7ab7213f31e2</id>
<content type='text'>
TPM2 tests set uses /dev/tpm0 and /dev/tpmrm0 without check if they
are available. In case, when these devices are not available test
fails, but expected behaviour is skipped test.

Signed-off-by: Nikita Sobolev &lt;Nikita.Sobolev@synopsys.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Reviewed-by: Petr Vorel &lt;petr.vorel@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "Kernel selftests: tpm2: check for tpm support"</title>
<updated>2020-04-14T16:08:24Z</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2020-04-12T14:23:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=aaa2d92efe1f972567f1691b423ab8dc606ab3a9'/>
<id>urn:sha1:aaa2d92efe1f972567f1691b423ab8dc606ab3a9</id>
<content type='text'>
This reverts commit b32694cd0724d4ceca2c62cc7c3d3a8d1ffa11fc.

The original comment was neither reviewed nor tested. Thus, this the
*only* possible action to take.

Cc: Nikita Sobolev &lt;Nikita.Sobolev@synopsys.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
