All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org,
	linux-sgx@vger.kernel.org,
	Reinette Chatre <reinette.chatre@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 5/5] selftests/sgx: Refine the test enclave to have storage
Date: Tue, 15 Jun 2021 16:13:59 +0300	[thread overview]
Message-ID: <20210615131359.zrfvi36sjdpxghzl@kernel.org> (raw)
In-Reply-To: <b1bf69f5-e203-d69e-d15d-3fb5e98b63dd@linuxfoundation.org>

On Mon, Jun 14, 2021 at 02:16:15PM -0600, Shuah Khan wrote:
> On 6/10/21 2:30 AM, Jarkko Sakkinen wrote:
> > Extend the enclave to have two operations: ENCL_OP_PUT and ENCL_OP_GET.
> > ENCL_OP_PUT stores value inside the enclave address space and
> > ENCL_OP_GET reads it. The internal buffer can be later extended to be
> > variable size, and allow reclaimer tests.
> > 
> > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> > ---
> >   tools/testing/selftests/sgx/defines.h     | 10 ++++
> >   tools/testing/selftests/sgx/main.c        | 57 ++++++++++++++++++-----
> >   tools/testing/selftests/sgx/test_encl.c   | 19 +++++++-
> >   tools/testing/selftests/sgx/test_encl.lds |  3 +-
> >   4 files changed, 74 insertions(+), 15 deletions(-)
> > 
> 
> Test output before applying the series:
> 
> TAP version 13
> 1..1
> # selftests: sgx: test_sgx
> # Unable to open /dev/sgx_enclave: No such file or directory
> # 1..0 # SKIP cannot load enclaves
> ok 1 selftests: sgx: test_sgx # SKIP
> 
> Test output after applying second patch
> 
> selftests/sgx: Migrate to kselftest harness
> 
> Output changes to the following. It doesn't look like the second
> patch adds any new tests. What is the point in running the tests
> that fail if /dev/sgx_enclave is missing.
> 
> Unfortunately this series doesn't have a cover letter that explains
> what this series is doing. I don't like the fact that the test
> output and behavior changes when migrating the test to kselftest
> harness. Shouldn't the output stay the same as in skip the tests
> if /dev/sgx_enclave fails.

I get what you are saying but actually I do not know how with
fixtures I can skip "the rest" when FIXTURE_SETUP() fails.

The reason for the output below is that with fixtures for all
tests enclave is initialized for each test case. And it kind of
makes sense because all tests start from the clean expected
state.

I don't how to do that with zero change in the output.

The reason to do this change is to make it easy to add more tests,
and return correct status codes to the framework.

> TAP version 13
> 1..1
> # selftests: sgx: test_sgx
> # TAP version 13
> # 1..3
> # # Starting 3 tests from 2 test cases.
> # #  RUN           enclave.unclobbered_vdso ...
> # Unable to open /dev/sgx_enclave: No such file or directory
> # ok 2 # SKIP cannot load enclaves
> # # Planned tests != run tests (3 != 1)
> # # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0
> # # unclobbered_vdso: Test failed at step #4
> # #          FAIL  enclave.unclobbered_vdso
> # not ok 1 enclave.unclobbered_vdso
> # #  RUN           enclave.clobbered_vdso ...
> # Unable to open /dev/sgx_enclave: No such file or directory
> # ok 3 # SKIP cannot load enclaves
> # # Planned tests != run tests (3 != 2)
> # # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:1 error:0
> # # clobbered_vdso: Test failed at step #4
> # #          FAIL  enclave.clobbered_vdso
> # not ok 2 enclave.clobbered_vdso
> # #  RUN           enclave.clobbered_vdso_and_user_function ...
> # Unable to open /dev/sgx_enclave: No such file or directory
> # ok 4 # SKIP cannot load enclaves
> # # Totals: pass:0 fail:2 xfail:0 xpass:0 skip:1 error:0
> # # clobbered_vdso_and_user_function: Test failed at step #4
> # #          FAIL  enclave.clobbered_vdso_and_user_function
> # not ok 3 enclave.clobbered_vdso_and_user_function
> # # FAILED: 0 / 3 tests passed.
> # # Totals: pass:0 fail:3 xfail:0 xpass:0 skip:0 error:0
> not ok 1 selftests: sgx: test_sgx # exit=1
> 
> thanks,
> -- Shuah

/Jarkko

  reply	other threads:[~2021-06-15 13:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  8:30 [PATCH v8 1/5] selftests/sgx: Rename 'eenter' and 'sgx_call_vdso' Jarkko Sakkinen
2021-06-10  8:30 ` [PATCH v8 2/5] selftests/sgx: Migrate to kselftest harness Jarkko Sakkinen
2021-06-10  8:30 ` [PATCH v8 3/5] selftests/sgx: Dump enclave memory map Jarkko Sakkinen
2021-06-11 22:45   ` Shuah Khan
2021-06-12  0:34     ` Dave Hansen
2021-06-12  4:27     ` Jarkko Sakkinen
2021-06-14 16:45       ` Shuah Khan
2021-06-15 13:07         ` Jarkko Sakkinen
2021-06-10  8:30 ` [PATCH v8 4/5] selftests/sgx: Add EXPECT_EEXIT() macro Jarkko Sakkinen
2021-06-10  8:30 ` [PATCH v8 5/5] selftests/sgx: Refine the test enclave to have storage Jarkko Sakkinen
2021-06-14 20:16   ` Shuah Khan
2021-06-15 13:13     ` Jarkko Sakkinen [this message]
2021-06-15 13:15       ` Jarkko Sakkinen
2021-06-15 21:55         ` Shuah Khan
2021-06-18  9:07           ` Jarkko Sakkinen
2021-06-10 15:45 ` [PATCH v8 1/5] selftests/sgx: Rename 'eenter' and 'sgx_call_vdso' Dave Hansen
2021-06-11 17:35   ` Shuah Khan
2021-06-11 22:47     ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210615131359.zrfvi36sjdpxghzl@kernel.org \
    --to=jarkko@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --subject='Re: [PATCH v8 5/5] selftests/sgx: Refine the test enclave to have storage' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.