On 4/1/21 5:38 AM, Eryu Guan wrote: > On Wed, Mar 31, 2021 at 12:00:02AM +0200, Pavel Reichl wrote: >> Add helper functions that ensure that test is only executed on file >> systems that implement chown, chmod and symbolic links. >> >> Fixed test are: generic/{87,88,125,126,128,193,314,317,355,597,598} >> >> Signed-off-by: Pavel Reichl <preichl@xxxxxxxxxx> >> --- >> common/rc | 27 +++++++++++++++++++++++++++ >> tests/generic/087 | 1 + >> tests/generic/088 | 1 + >> tests/generic/125 | 1 + >> tests/generic/126 | 1 + >> tests/generic/128 | 1 + >> tests/generic/193 | 1 + >> tests/generic/314 | 1 + >> tests/generic/317 | 1 + >> tests/generic/355 | 1 + >> tests/generic/597 | 1 + >> tests/generic/598 | 1 + >> 12 files changed, 38 insertions(+) >> >> diff --git a/common/rc b/common/rc >> index 0ce3cb0d..9cdfe21c 100644 >> --- a/common/rc >> +++ b/common/rc >> @@ -2129,6 +2129,33 @@ _require_user() >> [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands." >> } >> >> +# check for a chown support >> +# >> +_require_chown() >> +{ >> + if [ "$FSTYP" = "exfat" ]; then >> + _notrun "chown is not supported on $FSTYP" >> + fi >> +} >> + >> +# check for a chmod support >> +# >> +_require_chmod() >> +{ >> + if [ "$FSTYP" = "exfat" ]; then >> + _notrun "chmod is not supported on $FSTYP" >> + fi >> +} >> + > > Does chown/chmod fail on exfat? Like the existing _require_symlink() > implementation and many other _require rules, we try to actually do the > action on $TEST_DIR, and check if command succeeds to see if the action > is supported by current $FSTYP. Is it possible for exfat to do the same > check? > > We only use whitelist if it's impossible to do such check. > > Thanks, > Eryu > Hi, it does fail. It was actually my original intention to write the _require*() so it would check if the command succeeds as you are suggesting. However, Eric and Dave were worried that adding more _require*() through the tests would lead to further slowing test execution. This worry actually makes sense to me. Is there a significant benefit of testing the support vs. maintaining check based on FSTYP variable? I guess doing the check saves us from the need to update the code when new file-system is added, however actually doing the check increases time of test execution (but I haven't done any measurements yet - it's just my guess). I really don't mind doing it either way and I'm happy to change the code - I'm just trying to explain :-) Thanks for the comment. Have a nice day.