[LTP] [PATCH v2 3/6] tst_test.sh: Add $TST_FORMAT_DEVICE and related vars

Petr Vorel pvorel@suse.cz
Sun Mar 13 22:48:03 CET 2022


Hi Cyril,

> > +| 'TST_FORMAT_DEVICE'      | Format a block device with a filesystem, see
> > +|                          | https://github.com/linux-test-project/ltp/wiki/Shell-Test-API#formatting-device-with-a-filesystem[Formatting device with a filesystem]

> Hm, I guess that we already have a few absolute links in the docs to a
> github.com wiki, but I do not like it that much. I guess that realtive
> links does not work, right?

AFAIK it does not in AsciiDoc format (not sure about other, but we don't want to
switch anyway). I guess I can keep it as we don't have any better solution,
right?

> > +|                          | See also 'TST_DEV_EXTRA_OPTS', 'TST_DEV_FS_OPTS', 'TST_FS_TYPE'.
> > +|                          | Implies 'TST_NEEDS_DEVICE=1' (no need to set it).
> > +| 'TST_FS_TYPE'            | Override the default filesystem to be used.
> >  | 'TST_NEEDS_ROOT'         | Exit the test with 'TCONF' unless executed under root.
> >  |                          | Alternatively the 'tst_require_root' command can be used.
> >  | 'TST_NEEDS_TMPDIR'       | Create test temporary directory and cd into it.
> > @@ -495,7 +504,25 @@ tst_random 0 1000
> >  Formatting device with a filesystem
> >  +++++++++++++++++++++++++++++++++++

> > -The 'tst_mkfs' helper will format device with the filesystem.
> > +'TST_FORMAT_DEVICE=1' can be used to format device before running the test.
> > +Uses '$TST_FS_TYPE' (used filesystem, by default ext2), '$TST_DEVICE' (used
>                               ^
> 			      I would removed this part and keep only
> 			      the (by default ext2)
> > +block device, usually prepared by 'TST_NEEDS_DEVICE=1'), '$TST_DEV_FS_OPTS'

> and rewrote this part no to be in the parentheses as:

> '$TST_DEVICE' a block device to be formatted, usually prepared by the
> library (TST_NEEDS_DEVICE=1 must be set).

> > +('mkfs' options _before_ the device name) and '$TST_DEV_EXTRA_OPTS'
> > +(extra 'mkfs' options _after_ the device name).

> And remove the parentheses here as:

> '$TST_DEV_FS_OPTS' a 'mkfs' options _before_ the device path and
> '$TST_DEV_EXTRA_OPTS' extra 'mkfs'' options _after_ the device path.

Agree with all of this.


> Other than that and the test1() pointed out by Yang Xu:
I suppose this is what you mean: s/test1/test/, right?

+++ doc/shell-test-api.txt
@@ -517,7 +517,7 @@ TST_DEV_FS_OPTS="-b 1024 -O quota"
 TST_DEV_EXTRA_OPTS="5m"
 TST_TESTFUNC=test

-test1()
+test()
 {
        tst_res TPASS "device formatted"
 }


> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Thanks!

Kind regards,
Petr


More information about the ltp mailing list