Message ID | 20180423094639.14612-8-mylene.josserand@bootlin.com |
---|---|
State | Changes Requested |
Delegated to: | Cyril Hrubis |
Headers | show |
Series | testcases: small improvements with TCONF | expand |
Hi! > diff --git a/testcases/commands/df/df01.sh b/testcases/commands/df/df01.sh > index fbf1e2f2a..147620020 100755 > --- a/testcases/commands/df/df01.sh > +++ b/testcases/commands/df/df01.sh > @@ -26,6 +26,8 @@ TST_PARSE_ARGS=parse_args > TST_NEEDS_ROOT=1 > TST_NEEDS_TMPDIR=1 > TST_NEEDS_DEVICE=1 > +TST_NEEDS_CMDS="stat --printf=%f" Does this work? Because when I do something as: $ command -v stat --nonexistent-option /usr/bin/stat $ echo $? 0
Hi, > > diff --git a/testcases/commands/df/df01.sh b/testcases/commands/df/df01.sh > > index fbf1e2f2a..147620020 100755 > > --- a/testcases/commands/df/df01.sh > > +++ b/testcases/commands/df/df01.sh > > @@ -26,6 +26,8 @@ TST_PARSE_ARGS=parse_args > > TST_NEEDS_ROOT=1 > > TST_NEEDS_TMPDIR=1 > > TST_NEEDS_DEVICE=1 > > +TST_NEEDS_CMDS="stat --printf=%f" > Does this work? Because when I do something as: > $ command -v stat --nonexistent-option > /usr/bin/stat > $ echo $? > 0 Checking whole output (not just binary file / script) presence in $PATH is what tst_verify_cmd in my patch [1] does. [1] https://patchwork.ozlabs.org/patch/892779/ Kind regards, Petr
Hi, On Mon, 23 Apr 2018 15:27:27 +0200 Petr Vorel <pvorel@suse.cz> wrote: > Hi, > > > > diff --git a/testcases/commands/df/df01.sh b/testcases/commands/df/df01.sh > > > index fbf1e2f2a..147620020 100755 > > > --- a/testcases/commands/df/df01.sh > > > +++ b/testcases/commands/df/df01.sh > > > @@ -26,6 +26,8 @@ TST_PARSE_ARGS=parse_args > > > TST_NEEDS_ROOT=1 > > > TST_NEEDS_TMPDIR=1 > > > TST_NEEDS_DEVICE=1 > > > +TST_NEEDS_CMDS="stat --printf=%f" > > > Does this work? Because when I do something as: > > > $ command -v stat --nonexistent-option > > /usr/bin/stat > > $ echo $? > > 0 > > Checking whole output (not just binary file / script) presence in $PATH is what > tst_verify_cmd in my patch [1] does. > > [1] https://patchwork.ozlabs.org/patch/892779/ > > > Kind regards, > Petr Indeed, I saw your patch just after I sent my series :) I will test your "tst_verify_cmd" but it seems to fit my needs. I will keep you updated. Best regards,
diff --git a/testcases/commands/df/df01.sh b/testcases/commands/df/df01.sh index fbf1e2f2a..147620020 100755 --- a/testcases/commands/df/df01.sh +++ b/testcases/commands/df/df01.sh @@ -26,6 +26,8 @@ TST_PARSE_ARGS=parse_args TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_NEEDS_DEVICE=1 +TST_NEEDS_CMDS="stat --printf=%f" + . tst_test.sh usage()
In case Busybox is used with minimal configuration, the option "--printf" is not available so the test is failing. Add this option in the needed commands to return a TCONF if it is not available. Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com> --- testcases/commands/df/df01.sh | 2 ++ 1 file changed, 2 insertions(+)