Documentation: dev-tools: Add KTAP specification
Subsystems (3)
RFC PATCH v2 1/1 Documentation: dev-tools: Add KTAP specification
From: Rae Moar <[email protected]>
It does not make any significant additions or changes other than those already in use in the kernel: additional features can be added as they become necessary and used.
[1]: https://testanything.org/tap-version-13-specification.html
---
Changes since RFC v1:
https://lore.kernel.org/linux-kselftest/[email protected]/
- Add a "see also" section with some useful links.
- Remove the XPASS directive, which isn't used anywhere.
- Clear up / reorganise the discussion around differences between KTAP and TAP14.
- Improve the wording around some directives.
- Fix a bunch of typos.
See prior discussion in the following RFC:
https://lore.kernel.org/linux-kselftest/CA+GJov6tdjvY9x12JsJT14qn6c7NViJxqaJk+r-K1YJzPggFDQ@mail.gmail.com/.
---
Documentation/dev-tools/index.rst | 1 + Documentation/dev-tools/ktap.rst | 298 ++++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+) create mode 100644 Documentation/dev-tools/ktap.rst
Documentation/dev-tools/index.rst +1 -0
@@ -32,6 +32,7 @@ Documentation/dev-tools/testing-overview.rst kgdb kselftest kunit/index + ktap .. only:: subproject and html
Documentation/dev-tools/ktap.rst new file +298 -0
298 lines not on this page · raw message
Signature · 1 line
2.34.1.400.ga245620fadb-goog
Quoted 11 lines · David Gow
From: Rae Moar <[email protected]>
It does not make any significant additions or changes other than those already in use in the kernel: additional features can be added as they become necessary and used.
[1]: https://testanything.org/tap-version-13-specification.html
Signed-off-by Rae Moar <[email protected]>Co-developed-by David Gow <[email protected]>Signed-off-by David Gow <[email protected]>
I like it! Thank you so much for suffering through my earlier reviews. :)
The only concern I have is wonder what'll be needed to kselftest to deal with indentation changes. As long as this can be implemented without a subtest knowing it is a subtest, we're good.
Signature · 1 line
Kees Cook
Quoted 13 lines · Kees Cook
Quoted 11 lines · David Gow
From: Rae Moar <[email protected]>
It does not make any significant additions or changes other than those already in use in the kernel: additional features can be added as they become necessary and used.
[1]: https://testanything.org/tap-version-13-specification.html
Signed-off-by Rae Moar <[email protected]>Co-developed-by David Gow <[email protected]>Signed-off-by David Gow <[email protected]>
Quoted 7 lines
I like it! Thank you so much for suffering through my earlier reviews. :)
The only concern I have is wonder what'll be needed to kselftest to deal with indentation changes. As long as this can be implemented without a subtest knowing it is a subtest, we're good.
A lot of this TAP output is in the wrappers - hopefully it will be okay. Fingers crossed. :)
Quoted 2 lines
Reviewed-by Kees Cook <[email protected]>
Looks good to me as well. Thanks for doing this work.
thanks,
-- Shuah
Jonathan Corbet
maintainerQuoted 25 lines · Shuah Khan
Quoted 13 lines · Kees Cook
Quoted 11 lines · David Gow
From: Rae Moar <[email protected]>
It does not make any significant additions or changes other than those already in use in the kernel: additional features can be added as they become necessary and used.
[1]: https://testanything.org/tap-version-13-specification.html
Signed-off-by Rae Moar <[email protected]>Co-developed-by David Gow <[email protected]>Signed-off-by David Gow <[email protected]>Quoted 7 lines
I like it! Thank you so much for suffering through my earlier reviews. :)
The only concern I have is wonder what'll be needed to kselftest to deal with indentation changes. As long as this can be implemented without a subtest knowing it is a subtest, we're good.
A lot of this TAP output is in the wrappers - hopefully it will be okay. Fingers crossed. :)
Quoted 6 lines
Quoted 2 lines
Reviewed-by Kees Cook <[email protected]>Looks good to me as well. Thanks for doing this work.
Reviewed-by Shuah Khan <[email protected]>
Would you like me to take this through the docs tree, or do you have other plans for merging?
Thanks,
jon
Shuah Khan
maintainerQuoted 30 lines · Jonathan Corbet
Quoted 28 lines · Shuah Khan
Quoted 13 lines · Kees Cook
Quoted 11 lines · David Gow
From: Rae Moar <[email protected]>
It does not make any significant additions or changes other than those already in use in the kernel: additional features can be added as they become necessary and used.
[1]: https://testanything.org/tap-version-13-specification.html
Signed-off-by Rae Moar <[email protected]>Co-developed-by David Gow <[email protected]>Signed-off-by David Gow <[email protected]>Quoted 7 lines
I like it! Thank you so much for suffering through my earlier reviews. :)
The only concern I have is wonder what'll be needed to kselftest to deal with indentation changes. As long as this can be implemented without a subtest knowing it is a subtest, we're good.
A lot of this TAP output is in the wrappers - hopefully it will be okay. Fingers crossed. :)
Quoted 2 lines
Reviewed-by Kees Cook <[email protected]>
Quoted 7 lines
Quoted 3 lines
Looks good to me as well. Thanks for doing this work.
Reviewed-by Shuah Khan <[email protected]>Would you like me to take this through the docs tree, or do you have other plans for merging?
Please take this through docs.
thanks,
-- Shuah
Jonathan Corbet
maintainerQuoted 4 lines · Shuah Khan
Quoted 2 lines
Would you like me to take this through the docs tree, or do you have other plans for merging?
Please take this through docs.
Done.
Thanks,
jon
Quoted 14 lines · Kees Cook
Quoted 11 lines · David Gow
From: Rae Moar <[email protected]>
It does not make any significant additions or changes other than those already in use in the kernel: additional features can be added as they become necessary and used.
[1]: https://testanything.org/tap-version-13-specification.html
Signed-off-by Rae Moar <[email protected]>Co-developed-by David Gow <[email protected]>Signed-off-by David Gow <[email protected]>
Quoted 6 lines
I like it! Thank you so much for suffering through my earlier reviews. :)
The only concern I have is wonder what'll be needed to kselftest to deal with indentation changes. As long as this can be implemented without a subtest knowing it is a subtest, we're good.
I'd think a minor tweak to the prefix.pl script should handle it for most tests:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/tree/tools/testing/selftests/kselftest/prefix.pl
Certainly the indent should be the only difference between a top-level test result and a subtest now.
And, if the results do use test plans (i.e., state how many tests are expected beforehand) it's possible to parse the results even without indentation. It it looks like it would be a problem, we could explicitly state that indentation is optional if a test plan is present (or provide some other mechanism for detecting the end of the
subtests: just checking the test number has some corner cases which'd fail, but doing something akin to the "Subtest:" header TAP14 used makes this pretty robust). Things like that would overcomplicate it a bit, though, and might end up verging back on "tests need to know they're subtests" territory, depending on the exact implementation, so I think things are probably better as-is.
Cheers,
-- David
Randy Dunlap
reviewerHi,
Quoted 25 lines · David Gow
From: Rae Moar <[email protected]>
It does not make any significant additions or changes other than those already in use in the kernel: additional features can be added as they become necessary and used.
[1]: https://testanything.org/tap-version-13-specification.html
Signed-off-by Rae Moar <[email protected]>Co-developed-by David Gow <[email protected]>Signed-off-by David Gow <[email protected]>---
Changes since RFC v1:
https://lore.kernel.org/linux-kselftest/[email protected]/
- Add a "see also" section with some useful links.
- Remove the XPASS directive, which isn't used anywhere.
- Clear up / reorganise the discussion around differences between KTAP and TAP14.
- Improve the wording around some directives.
- Fix a bunch of typos.See prior discussion in the following RFC:
https://lore.kernel.org/linux-kselftest/CA+GJov6tdjvY9x12JsJT14qn6c7NViJxqaJk+r-K1YJzPggFDQ@mail.gmail.com/.
Quoted 6 lines
---
Documentation/dev-tools/index.rst | 1 + Documentation/dev-tools/ktap.rst | 298 ++++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+) create mode 100644 Documentation/dev-tools/ktap.rst
I suppose that someone tested this. Maybe my version of Sphinx tools is older than other people's -- I dunno. Anyway, I get this:
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:71: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
<result> <number> [<description>][ # [<directive>] [<diagnostic data>]]
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:120: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
ok 1 test_case_name
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:126: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
not ok 1 test_case_name
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:132: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
ok 1 test # SKIP necessary dependency unavailable
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:139: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
not ok 1 test # TIMEOUT 30 seconds
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:145: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
ok 5 check return code # rcode=0
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:195: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
KTAP version 1
1..1
KTAP version 1
1..2
ok 1 test_1
not ok 2 test_2
# example failed
not ok 1 example
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:208: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
KTAP version 1
1..2
KTAP version 1
1..2
KTAP version 1
1..2
not ok 1 test_1
ok 2 test_2
not ok 1 test_3
ok 2 test_4 # SKIP
not ok 1 example_test_1
ok 2 example_test_2
/work/lnx/next/linux-next-20211217/Documentation/dev-tools/ktap.rst:238: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.
.. code-block::
KTAP version 1
1..1
KTAP version 1
1..3
KTAP version 1
1..1
# test_1: initializing test_1
ok 1 test_1
ok 1 example_test_1
KTAP version 1
1..2
ok 1 test_1 # SKIP test_1 skipped
ok 2 test_2
ok 2 example_test_2
KTAP version 1
1..3
ok 1 test_1
# test_2: FAIL
not ok 2 test_2
ok 3 test_3 # SKIP test_3 skipped
not ok 3 example_test_3
not ok 1 main_test
thanks.
Signature · 1 line
~Randy