ltp icon indicating copy to clipboard operation
ltp copied to clipboard

fs_bind* test cases reporting TBROK

Open Mona-Bagare opened this issue 1 year ago • 5 comments

fs_bind* test cases were either failing or broken

fs_bind_rbind36 1 TBROK: Test didn't report any results fs_bind02 1 TBROK: Test didn't report any results fs_bind24 1 TBROK: Test didn't report any results

The following code block in the path /testcases/kernel/fs/fs_bind/fs_bind_lib.sh


232 fs_bind_test()
233 {
234         _fs_bind_setup_test
235
236         if type ${FS_BIND_TESTFUNC}1 > /dev/null 2>&1; then
237                 "$FS_BIND_TESTFUNC$_tst_i" $1
238         else
239                 "$FS_BIND_TESTFUNC" $1
240         fi
241
242         _fs_bind_cleanup_test
243 }

After the following change sthe tests are passing

232 fs_bind_test()
233 {
234         _fs_bind_setup_test
235
236         "$FS_BIND_TESTFUNC" $1
237         if type ${FS_BIND_TESTFUNC}1 > /dev/null 2>&1; then
238                 "$FS_BIND_TESTFUNC$_tst_i" $1
239         fi
240
241         _fs_bind_cleanup_test
242 }
243

Mona-Bagare avatar May 23 '23 10:05 Mona-Bagare

@metan-ucw please update

Mona-Bagare avatar May 26 '23 10:05 Mona-Bagare

The change does not look right, you are removing else branch that is supposedly not used at all. Is this really the change that fixes the tests for you?

metan-ucw avatar Jun 27 '23 08:06 metan-ucw

Yes.

232 fs_bind_test()
233 {
234         _fs_bind_setup_test
235
236         if type ${FS_BIND_TESTFUNC}1 > /dev/null 2>&1; then
237                 "$FS_BIND_TESTFUNC$_tst_i" $1
238         else
239                 "$FS_BIND_TESTFUNC" $1
240         fi
241
242         _fs_bind_cleanup_test
243 }

'if' code block works properly only when there are multiple test functions within a testcase. Ex: 'fs_bind_regression.sh' has three test functions (namely test1(), test2(), test3()) within one testcase. In 'fs_bind testsuite' there are 94 out of 95 testcases have only one test function which doesn't get executed, they are broken(TBROK) and not producing complete results.

When 'else' statement is removed, the other 94 testcases also get chance to execute completely and produce a definative results. I have attached the result logs generated before the code correction and after the code correction for your reference.

Before_correction_execution_status.txt After correction_execution_status.txt

Mona-Bagare avatar Jun 27 '23 17:06 Mona-Bagare

This issue is similar to https://github.com/linux-test-project/ltp/issues/1035 There are 94 testcases, instead of changing the test name in each testcase I have modified the fs_bind_lib.sh file in a way to fix the issue. please go through the attached logs.

Mona-Bagare avatar Dec 05 '23 10:12 Mona-Bagare

@metan-ucw or @pevik can you please take a look?

Mona-Bagare avatar Dec 06 '23 06:12 Mona-Bagare