[LTP] [PATCH 4/4] doc: Fix incorrect struct tst_test field references

Andrea Cervesato andrea.cervesato@suse.de
Mon Jun 1 11:52:57 CEST 2026


From: Andrea Cervesato <andrea.cervesato@suse.com>

Fix several inaccuracies in ground_rules.rst and writing_tests.rst
where struct tst_test fields were referenced incorrectly:

- .save_restore and .needs_cgroup_ctrls are not boolean flags, drop
  the '= 1' assignment examples.
- .supported_archs example had a stray ')' in the type cast.
- .max_runtime renamed to .runtime per commit
  a6a369c5eeb4 ("lib: redefine the overall timeout logic of test").
- .tst_hugepage -> .hugepages (the actual field name).
- .dev_extra_opts, .dev_fs_opts, .dev_fs_type never existed as C
  struct fields; move them to the shell-only section of the
  comparison table.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 doc/developers/ground_rules.rst  |  6 +++---
 doc/developers/writing_tests.rst | 28 ++++++++++++++--------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/doc/developers/ground_rules.rst b/doc/developers/ground_rules.rst
index 1b68ce3427682e68866768b8344aca008939b7be..e03f32ad39ca8931ff1b616fc4e8383101cf523e 100644
--- a/doc/developers/ground_rules.rst
+++ b/doc/developers/ground_rules.rst
@@ -100,10 +100,10 @@ paths too.
 The test library can simplify cleanup greatly as there are various helpers such as:
 
 - :c:type:`.needs_tmpdir = 1 <tst_test>` that creates and deletes a temporary directory for the test
-- :c:type:`.save_restore = 1 <tst_test>` that saves and restores /sys/ and /proc/ files
+- :c:type:`.save_restore <tst_test>` that saves and restores /sys/ and /proc/ files
 - :c:type:`.needs_device = 1 <tst_test>` sets up and tears down a block device for the test
 - :c:type:`.restore_wallclock = 1 <tst_test>` that restores wall clock after the test
-- :c:type:`.needs_cgroup_ctrls = 1 <tst_test>` sets up and cleans up cgroups for the test
+- :c:type:`.needs_cgroup_ctrls <tst_test>` sets up and cleans up cgroups for the test
 - And many more.
 
 
@@ -115,7 +115,7 @@ Avoid nonstandard libc APIs when a portable equivalent exists; don't assume
 
 If the test is specific to a certain architecture, make sure that it at least
 compiles at the rest of architectures and set the
-:c:type:`.supported_archs = const char *const []){"s390x", ..., NULL} <tst_test>`.
+:c:type:`.supported_archs = (const char *const []){"s390x", ..., NULL} <tst_test>`.
 
 This also applies to shell code where it's easy to use bash features that are
 not available on other shell implementations, e.g. dash or busybox. Make sure
diff --git a/doc/developers/writing_tests.rst b/doc/developers/writing_tests.rst
index 2c1349eea190d79e99c4bf6562eb62806cb58b48..dc40324b16d40c4d210fe0dfa6b311b5b3337c7a 100644
--- a/doc/developers/writing_tests.rst
+++ b/doc/developers/writing_tests.rst
@@ -379,25 +379,16 @@ LTP C And Shell Test API Comparison
     * - .cleanup
       - TST_CLEANUP
 
-    * - .dev_extra_opts
-      - TST_DEV_EXTRA_OPTS
-
-    * - .dev_fs_opts
-      - TST_DEV_FS_OPTS
-
-    * - .dev_fs_type
-      - TST_FS_TYPE
-
     * - .dev_min_size
       - TST_DEVICE_SIZE
 
     * - .format_device
       - TST_FORMAT_DEVICE
 
-    * - .max_runtime
-      - TST_TIMEOUT (not exactly the same, a real timeout based on old .timeout
-        concept. .max_runtime has also an extra 30 sec safety margin for
-        teardown of the test.)
+    * - .runtime
+      - TST_TIMEOUT (not exactly the same, TST_TIMEOUT is a real timeout.
+        .runtime controls the test execution loop duration and has an extra
+        30 sec safety margin for setup and cleanup.)
 
     * - .min_cpus
       - not applicable
@@ -507,7 +498,7 @@ LTP C And Shell Test API Comparison
     * - .test_variants
       - \-
 
-    * - .tst_hugepage
+    * - .hugepages
       - not applicable
 
     * - .ulimit
@@ -525,6 +516,15 @@ LTP C And Shell Test API Comparison
     * - not applicable
       - TST_USAGE
 
+    * - not applicable
+      - TST_DEV_EXTRA_OPTS
+
+    * - not applicable
+      - TST_DEV_FS_OPTS
+
+    * - not applicable
+      - TST_FS_TYPE
+
 .. list-table::
     :header-rows: 1
 

-- 
2.51.0



More information about the ltp mailing list