[LTP] [RFC PATCH 1/5] shell lib: Add support for test cleanup

Petr Vorel pvorel@suse.cz
Tue Mar 4 14:08:33 CET 2025


Hi Li,

...
> > +++ b/testcases/lib/run_tests.sh
> > @@ -9,6 +9,7 @@ shell_loader_filesystems.sh
> >  shell_loader_kconfigs.sh
> >  shell_loader_supported_archs.sh
> >  shell_loader_tcnt.sh
> > +shell_loader_cleanup.sh
> >  shell_test01
> >  shell_test02
> >  shell_test03
> > @@ -21,7 +22,8 @@ TESTS_TBROK="
> >  shell_loader_invalid_block.sh
> >  shell_loader_invalid_metadata.sh
> >  shell_loader_no_metadata.sh
> > -shell_loader_wrong_metadata.sh"
> > +shell_loader_wrong_metadata.sh

> It seems the shell_loader_wrong_metadata.sh is a duplicate of
> shell_loader_invalid_metadata. Maybe we can remove one of them.

Good catch. But I think there are testing a different thing:

shell_loader_wrong_metadata.sh IMHO has too high int value
("Wrong 'needs_tmpdir' type expected boolean" error):

"needs_tmpdir": 42,

# PATH="$PWD:$PWD/tests:$PATH" shell_loader_wrong_metadata.sh
Parse error at line 002

001: {
002:  "needs_tmpdir": 42,
                        ^
Wrong 'needs_tmpdir' type expected boolean
tst_run_shell.c:508: TBROK: Invalid metadata

shell_loader_invalid_metadata.sh IMHO has invalid JSON
("Expected ID string" error):

{"needs_tmpdir": 42,

# PATH="$PWD:$PWD/tests:$PATH" shell_loader_invalid_metadata.sh
Parse error at line 002

001: {
002:  {"needs_tmpdir": 42,
      ^
Expected ID string
tst_run_shell.c:508: TBROK: Invalid metadata

Kind regards,
Petr


More information about the ltp mailing list