selftests/sgx: Migrate to kselftest harness
authorJarkko Sakkinen <jarkko@kernel.org>
Thu, 10 Jun 2021 08:30:18 +0000 (11:30 +0300)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 15 Jun 2021 22:23:09 +0000 (16:23 -0600)
commit235d1c9c63088c33d746a1e7e92e15153b8d1192
treeb77ee5282fcb8a91a3b915ecb4b01cf42b5a029d
parent6a7171b8a0f8e961744d0c46fb7547662a3fca36
selftests/sgx: Migrate to kselftest harness

Migrate to kselftest harness. Use a fixture test with enclave initialized
and de-initialized for each of the existing three tests, in other words:

1. One FIXTURE() for managing the enclave life-cycle.
2. Three TEST_F()'s, one for each test case.

Dump lines of /proc/self/maps matching "sgx" in FIXTURE_SETUP() as this
can be very useful debugging information later on.

Amended commit log:
This migration changes the output of this test. Instead of skipping
the tests if open /dev/sgx_enclave fails, it will run all the tests
and report failures on all of them.
Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/sgx/load.c
tools/testing/selftests/sgx/main.c