From: Nícolas F. R. A. Prado <nfraprado(a)collabora.com>
[ Upstream commit f034cc1301e7d83d4ec428dd6b8ffb57ca446efb ]
The timeout setting for the rtc kselftest is currently 90 seconds. This
setting is used by the kselftest runner to stop running a test if it
takes longer than the assigned value.
However, two of the test cases inside rtc set alarms. These alarms are
set to the next beginning of the minute, so each of these test cases may
take up to, in the worst case, 60 seconds.
In order to allow for all test cases in rtc to run, even in the worst
case, when using the kselftest runner, the timeout value should be
increased to at least 120. Set it to 180, so there's some additional
slack.
Correct operation can be tested by running the following command right
after the start of a minute (low second count), and checking that all
test cases run:
./run_kselftest.sh -c rtc
Signed-off-by: Nícolas F. R. A. Prado <nfraprado(a)collabora.com>
Acked-by: Alexandre Belloni <alexandre.belloni(a)bootlin.com>
Signed-off-by: Shuah Khan <skhan(a)linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
---
tools/testing/selftests/rtc/settings | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/rtc/settings b/tools/testing/selftests/rtc/settings
index ba4d85f74cd6b..a953c96aa16e1 100644
--- a/tools/testing/selftests/rtc/settings
+++ b/tools/testing/selftests/rtc/settings
@@ -1 +1 @@
-timeout=90
+timeout=180
--
2.34.1
The list_del_init_careful() function was added[1] after the list KUnit
test. Add a very basic test to cover it.
Note that this test only covers the single-threaded behaviour (which
matches list_del_init()), as is already the case with the test for
list_empty_careful().
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
Signed-off-by: David Gow <davidgow(a)google.com>
---
Changes since v2:
https://lore.kernel.org/linux-kselftest/20220208040122.695258-1-davidgow@go…
- Fix the test calling list_del_init() instead of
list_del_init_careful()
- Improve the comment noting we only test single-threaded behaviour.
Changes since v1:
https://lore.kernel.org/linux-kselftest/20220205061539.273330-1-davidgow@go…
- Patch 1/3 unchanged
---
lib/list-test.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/lib/list-test.c b/lib/list-test.c
index ee09505df16f..f82a3c7788b8 100644
--- a/lib/list-test.c
+++ b/lib/list-test.c
@@ -161,6 +161,25 @@ static void list_test_list_del_init(struct kunit *test)
KUNIT_EXPECT_TRUE(test, list_empty_careful(&a));
}
+static void list_test_list_del_init_careful(struct kunit *test)
+{
+ /* NOTE: This test only checks the behaviour of this function in
+ * isolation. It does not verify memory model guarantees. */
+ struct list_head a, b;
+ LIST_HEAD(list);
+
+ list_add_tail(&a, &list);
+ list_add_tail(&b, &list);
+
+ /* before: [list] -> a -> b */
+ list_del_init_careful(&a);
+ /* after: [list] -> b, a initialised */
+
+ KUNIT_EXPECT_PTR_EQ(test, list.next, &b);
+ KUNIT_EXPECT_PTR_EQ(test, b.prev, &list);
+ KUNIT_EXPECT_TRUE(test, list_empty_careful(&a));
+}
+
static void list_test_list_move(struct kunit *test)
{
struct list_head a, b;
@@ -707,6 +726,7 @@ static struct kunit_case list_test_cases[] = {
KUNIT_CASE(list_test_list_replace_init),
KUNIT_CASE(list_test_list_swap),
KUNIT_CASE(list_test_list_del_init),
+ KUNIT_CASE(list_test_list_del_init_careful),
KUNIT_CASE(list_test_list_move),
KUNIT_CASE(list_test_list_move_tail),
KUNIT_CASE(list_test_list_bulk_move_tail),
--
2.35.0.263.gb82422642f-goog
Changes since V2:
- V2: https://lore.kernel.org/linux-sgx/cover.1643754040.git.reinette.chatre@inte…
- Added Acked-by from Shuah to all patches in series.
- Shuah is ok with these entering the kernel via tip.git:
https://lore.kernel.org/linux-sgx/e188c62e-f75e-2bec-b544-76063098611d@linu…
- Include x86(a)kernel.org and more x86 maintainers since goal is for
inclusion into tip.git.
Changes since V1:
- V1: https://lore.kernel.org/linux-sgx/cover.1643393473.git.reinette.chatre@inte…
- All changes impact the commit messages only, no changes to code.
- Rewrite commit message of 1/4 (Dave).
- Detail in 2/4 commit log what callers will see with this change (Dave).
- Add Acked-by from Dave to 2/4 and 4/4.
Hi Everybody,
Please find included a few fixes that address problems encountered after
venturing into the enclave loading error handling code of the SGX
selftests.
Reinette
Reinette Chatre (4):
selftests/sgx: Fix NULL-pointer-dereference upon early test failure
selftests/sgx: Do not attempt enclave build without valid enclave
selftests/sgx: Ensure enclave data available during debug print
selftests/sgx: Remove extra newlines in test output
tools/testing/selftests/sgx/load.c | 9 +++++----
tools/testing/selftests/sgx/main.c | 9 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
--
2.25.1
From: Frank Rowand <frank.rowand(a)sony.com>
Add the spec version to the title line.
Explain likely source of "Unknown lines".
"Unknown lines" in nested tests are optionally indented.
Add "Unknown lines" items to differences between TAP & KTAP list
Reviewed-by: Tim Bird <Tim.Bird(a)sony.com>
Reviewed-by: David Gow <davidgow(a)google.com>
Signed-off-by: Frank Rowand <frank.rowand(a)sony.com>
---
Changes since version 2
- Add missing quote after word: incorrect
- Add Reviewed-by tags
Changes since version 1
- Explain likely source of "Unknown lines"
- "Unknown line" in nested tests are optionally indented
- Add "Unknown lines" items to differences between TAP & KTAP list
Documentation/dev-tools/ktap.rst | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/Documentation/dev-tools/ktap.rst b/Documentation/dev-tools/ktap.rst
index 878530cb9c27..dfb3f10a8b2d 100644
--- a/Documentation/dev-tools/ktap.rst
+++ b/Documentation/dev-tools/ktap.rst
@@ -1,8 +1,8 @@
.. SPDX-License-Identifier: GPL-2.0
-========================================
-The Kernel Test Anything Protocol (KTAP)
-========================================
+===================================================
+The Kernel Test Anything Protocol (KTAP), version 1
+===================================================
TAP, or the Test Anything Protocol is a format for specifying test results used
by a number of projects. It's website and specification are found at this `link
@@ -174,6 +174,13 @@ There may be lines within KTAP output that do not follow the format of one of
the four formats for lines described above. This is allowed, however, they will
not influence the status of the tests.
+This is an important difference from TAP. Kernel tests may print messages
+to the system console or a log file. Both of these destinations may contain
+messages either from unrelated kernel or userspace activity, or kernel
+messages from non-test code that is invoked by the test. The kernel code
+invoked by the test likely is not aware that a test is in progress and
+thus can not print the message as a diagnostic message.
+
Nested tests
------------
@@ -186,10 +193,13 @@ starting with another KTAP version line and test plan, and end with the overall
result. If one of the subtests fail, for example, the parent test should also
fail.
-Additionally, all result lines in a subtest should be indented. One level of
+Additionally, all lines in a subtest should be indented. One level of
indentation is two spaces: " ". The indentation should begin at the version
line and should end before the parent test's result line.
+"Unknown lines" are not considered to be lines in a subtest and thus are
+allowed to be either indented or not indented.
+
An example of a test with two nested subtests:
.. code-block::
@@ -225,9 +235,11 @@ Major differences between TAP and KTAP
--------------------------------------
Note the major differences between the TAP and KTAP specification:
-- yaml and json are not recommended in diagnostic messages
-- TODO directive not recognized
+- yaml and json are not recommended in KTAP diagnostic messages
+- TODO directive not recognized in KTAP
- KTAP allows for an arbitrary number of tests to be nested
+- TAP includes "Unknown lines" in the category of "Anything else"
+- TAP says "Unknown lines" are "incorrect"; KTAP allows "Unknown lines"
The TAP14 specification does permit nested tests, but instead of using another
nested version line, uses a line of the form
--
Frank Rowand <frank.rowand(a)sony.com>