All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Shuah Khan <shuah@kernel.org>,  Anup Patel <anup@brainfault.org>,
	Oliver Upton <oliver.upton@linux.dev>,
	 Claudio Imbrenda <imbrenda@linux.ibm.com>,
	kernel@collabora.com, kvm@vger.kernel.org,
	 linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] selftests: kvm: replace exit() with ksft_exit_fail_msg()
Date: Thu, 13 Jun 2024 11:57:30 -0700	[thread overview]
Message-ID: <ZmtBGn1rgFu8tcgl@google.com> (raw)
In-Reply-To: <ade2de8f-8f63-45fb-a01a-096d048dd971@collabora.com>

On Thu, Jun 13, 2024, Muhammad Usama Anjum wrote:
> > As above, AFAICT it comes from Google's internal test infrastructure (KVM selftests
> > came from Google).
> > 
> >> Its even better if we use ksft_exit_fail_msg() which will print out "Bail
> >> out" meaning the test exited without completing. This string is TAP protocol
> >> specific.
> > 
> > This is debatable and not obviously correct.  The documentation says:
> > 
> >   Bail out!
> >   As an emergency measure a test script can decide that further tests are
> >   useless (e.g. missing dependencies) and testing should stop immediately. In
> >   that case the test script prints the magic words
> > 
> > which suggests that a test should only emit "Bail out!" if it wants to stop
> > entirely.  We definitely don't want KVM selftests to bail out if a TEST_ASSERT()
> > fails in one testcase.
> But KVM tests are bailing out if assert fails, exit(254) is being called
> which stops the further execution of the test cases.

Not if the TEST_ASSERT() fires from within a test fixture, in which case the
magic in tools/testing/selftests/kselftest_harness.h captures the failure but
continues on with the next test.

  reply	other threads:[~2024-06-13 18:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 10:44 [PATCH 1/2] selftests: kvm: remove print_skip() Muhammad Usama Anjum
2024-06-12 10:44 ` [PATCH 2/2] selftests: kvm: replace exit() with ksft_exit_fail_msg() Muhammad Usama Anjum
2024-06-12 19:01   ` Sean Christopherson
2024-06-13  9:40     ` Muhammad Usama Anjum
2024-06-13 18:57       ` Sean Christopherson [this message]
2024-06-12 11:13 ` [PATCH 1/2] selftests: kvm: remove print_skip() Dev Jain
2024-06-12 18:10   ` Sean Christopherson
2024-06-15 13:01 ` kernel test robot

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=ZmtBGn1rgFu8tcgl@google.com \
    --to=seanjc@google.com \
    --cc=anup@brainfault.org \
    --cc=imbrenda@linux.ibm.com \
    --cc=kernel@collabora.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=shuah@kernel.org \
    --cc=usama.anjum@collabora.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.