Skip to contentSkip to conversation

doc: update unittests doc

PATCH In review Nicholas Piggin 2 participants 3 messages May 3, 2024 – May 7, 2024 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: update unittests doc

Some cleanups and a comment about the check parameter restrictions.

---
 docs/unittests.txt | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
docs/unittests.txt +7 -5
index 3192a60ec..7cf2c55ad 100644
@@ -15,8 +15,8 @@ unittests.cfg format
 
 # is the comment symbol, all following contents of the line is ignored.
 
-Each unit test is defined with a [unit-test-name] line, followed by
-a set of parameters that control how the test case is run. The name is
+Each unit test is defined with a [unit-test-name] line, followed by a
+set of parameters that control how the test case is run. The name is
 arbitrary and appears in the status reporting output.
 
 Parameters appear on their own lines under the test name, and have a
@@ -62,8 +62,8 @@ groups
 groups = <group_name1> <group_name2> ...
 
 Used to group the test cases for the `run_tests.sh -g ...` run group
-option. Adding a test to the nodefault group will cause it to not be
-run by default.
+option. The group name is arbitrary, aside from the nodefault group
+which makes the test to not be run by default.
 
 accel
 -----
@@ -82,8 +82,10 @@ Optional timeout in seconds, after which the test will be killed and fail.
 
 check
 -----
-check = <path>=<<value>
+check = <path>=<value>
 
 Check a file for a particular value before running a test. The check line
 can contain multiple files to check separated by a space, but each check
 parameter needs to be of the form <path>=<value>
+
+The path and value can not contain space, =, or shell wildcard characters.
Signature · 1 line
2.43.0
#1 lore raw
Quoted 12 lines · Nicholas Piggin

Some cleanups and a comment about the check parameter restrictions.

---
  docs/unittests.txt | 12 +++++++-----
  1 file changed, 7 insertions(+), 5 deletions(-)
docs/unittests.txt +0 -0
index 3192a60ec..7cf2c55ad 100644

docs/unittests.txt unittests.cfg format · line 19

Quoted 7 lines
docs/unittests.txt +2 -2
@@ -15,8 +15,8 @@ unittests.cfg format
 
  # is the comment symbol, all following contents of the line is ignored.
 
-Each unit test is defined with a [unit-test-name] line, followed by
-a set of parameters that control how the test case is run. The name is
+Each unit test is defined with a [unit-test-name] line, followed by a
+set of parameters that control how the test case is run. The name is

This looks like it's only moving the "a" from one line to the other? I'd suggest to drop this hunk.

docs/unittests.txt groups · line 66

Quoted 11 lines
docs/unittests.txt +2 -2
  arbitrary and appears in the status reporting output.
 
  Parameters appear on their own lines under the test name, and have a
@@ -62,8 +62,8 @@ groups
  groups = <group_name1> <group_name2> ...
 
  Used to group the test cases for the `run_tests.sh -g ...` run group
-option. Adding a test to the nodefault group will cause it to not be
-run by default.
+option. The group name is arbitrary, aside from the nodefault group
+which makes the test to not be run by default.

Actually, there are some other "magic" groups that have been introduced in the course of time:

- The "migration" group is required for migration tests.

- The "panic" group is required for tests where success means that the guest crashed (but it's currently only used on s390x).

We might want to document those groups here, too?

Thomas

#2 lore raw
Quoted 16 lines · Thomas Huth
Quoted 15 lines · Nicholas Piggin

Some cleanups and a comment about the check parameter restrictions.

---
  docs/unittests.txt | 12 +++++++-----
  1 file changed, 7 insertions(+), 5 deletions(-)
docs/unittests.txt +0 -0
index 3192a60ec..7cf2c55ad 100644
@@ -15,8 +15,8 @@ unittests.cfg format
 
  # is the comment symbol, all following contents of the line is ignored.
 
Quoted 7 lines

docs/unittests.txt unittests.cfg format · line 19

Quoted 4 lines
docs/unittests.txt +2 -2
-Each unit test is defined with a [unit-test-name] line, followed by
-a set of parameters that control how the test case is run. The name is
+Each unit test is defined with a [unit-test-name] line, followed by a
+set of parameters that control how the test case is run. The name is

This looks like it's only moving the "a" from one line to the other? I'd suggest to drop this hunk.

Sure. Might have just re-wrapped it but it's not a big deal.

Quoted 15 lines

docs/unittests.txt groups · line 66

Quoted 11 lines
docs/unittests.txt +2 -2
  arbitrary and appears in the status reporting output.
 
  Parameters appear on their own lines under the test name, and have a
@@ -62,8 +62,8 @@ groups
  groups = <group_name1> <group_name2> ...
 
  Used to group the test cases for the `run_tests.sh -g ...` run group
-option. Adding a test to the nodefault group will cause it to not be
-run by default.
+option. The group name is arbitrary, aside from the nodefault group
+which makes the test to not be run by default.

Actually, there are some other "magic" groups that have been introduced in the course of time:

Quoted 1 line

- The "migration" group is required for migration tests.

Ah yes good point.

Quoted 2 lines

- The "panic" group is required for tests where success means that the guest crashed (but it's currently only used on s390x).

I actually didn't pay much attention to the crashing tests before but I should have. Maybe we should add this to a common harness selftest too.

Quoted 1 line

We might want to document those groups here, too?

Yeah, hold off merging this for now.

Thanks,
Nick