[LTP] [PATCH V3 08/10] syscalls/move_mount: New tests

Yang Xu
2020-02-26T03:34:20Z

Hi

> On 25-02-20, 14:57, Petr Vorel wrote:
>>> + TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
>>> + if (TST_RET == -1) {
>>> + SAFE_CLOSE(fd);
>>> + tst_res(TBROK | TERRNO, "fsconfig() failed");
>> These should be TFAIL otherwise it 1) breaks all tests 2) does not report any
>> result:
>>
>> move_mount02.c:37: BROK: fsopen() failed: SUCCESS (0)
>> tst_test.c:1051: BROK: Test 0 haven't reported results!
>
> I am a bit confused about TBROK and TFAIL to be honest. The test
> writing guideline says this:
>
> | 'TFAIL' | Test has failed.
> | 'TBROK' | Something has failed in test preparation phase.
>
> And so in my code I have been using TFAIL only for the failures for the
> actual syscalls that we are testing, like move_mount here. And I have
> been using TBROK for pretty much everything else
If using TBROK, it will terminate the program. So how can test the
remaining test?
Like move_mount02.c, if test "invalid-from-fd"and fsconfig failed, it
will exit. So how do you test "invalid-from-path"?

Also, using return after TBROK is meaningless.

Best Regards
Yang Xu
>
> Would be good if you and Cyril can explain what's the correct usage
> model for these is.
>