<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 30, 2019 at 5:10 PM Caspar Zhang <<a href="mailto:caspar@linux.alibaba.com">caspar@linux.alibaba.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">TCONF should also be one of exit statuses in a single test, else the<br>
output of TST_COUNT in shell tests could be wrong.<br>
<br>
Wrong:<br>
<<<test_output>>><br>
memcg_use_hierarchy_test 1 TINFO: Starting test 1<br>
memcg_use_hierarchy_test 1 TINFO: set /dev/memcg/memory.use_hierarchy to 0 failed<br>
memcg_use_hierarchy_test 1 TPASS: process 28658 is killed<br>
memcg_use_hierarchy_test 2 TINFO: Starting test 2<br>
memcg_use_hierarchy_test 2 TINFO: set /dev/memcg/memory.use_hierarchy to 0 failed<br>
memcg_use_hierarchy_test 2 TCONF: memory.use_hierarchy already been 1, blame systemd, skip<br>
memcg_use_hierarchy_test 2 TINFO: Starting test 3<br>
memcg_use_hierarchy_test 2 TINFO: set /dev/memcg/memory.use_hierarchy to 0 failed<br>
memcg_use_hierarchy_test 2 TPASS: echo 0 > subgroup/memory.use_hierarchy failed as expected<br>
<<<execution_status>>><br>
<br>
Right:<br>
<<<test_output>>><br>
memcg_use_hierarchy_test 1 TINFO: Starting test 1<br>
memcg_use_hierarchy_test 1 TINFO: set /dev/memcg/memory.use_hierarchy to 0 failed<br>
memcg_use_hierarchy_test 1 TPASS: process 26825 is killed<br>
memcg_use_hierarchy_test 2 TINFO: Starting test 2<br>
memcg_use_hierarchy_test 2 TINFO: set /dev/memcg/memory.use_hierarchy to 0 failed<br>
memcg_use_hierarchy_test 2 TCONF: memory.use_hierarchy already been 1, blame systemd, skip<br>
memcg_use_hierarchy_test 3 TINFO: Starting test 3<br>
memcg_use_hierarchy_test 3 TINFO: set /dev/memcg/memory.use_hierarchy to 0 failed<br>
memcg_use_hierarchy_test 3 TPASS: echo 0 > subgroup/memory.use_hierarchy failed as expected<br>
<<<execution_status>>><br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">This is a good catch, but maybe it's not wise to simply regard the TCONF as a single test, because there are many system-config detections in setup() function, that will make LTP gives <span style="color:rgb(51,51,51);font-size:14px">a mendacious report on the test numbers if applying this patch.</span></div><br></div><div><div class="gmail_default" style="font-size:small">e.g.</div><br></div><div><div class="gmail_default" style="font-size:small">if tst_kvcmp -lt "3.10"; then</div> <span class="gmail_default" style="font-size:small"> </span>tst_brk TCONF "test must be run with kernel 3.10 or newer"<br> fi<br><div class="gmail_default" style="font-size:small"></div><div class="gmail_default" style="font-size:small">if dir path not exist; then</div><div class="gmail_default" style="font-size:small"> tst_brk TCONF "system does not have xxxx/"</div><div class="gmail_default" style="font-size:small">fi</div><div class="gmail_default" style="font-size:small"></div><div class="gmail_default" style="font-size:small">and so on...</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Signed-off-by: Caspar Zhang <<a href="mailto:caspar@linux.alibaba.com" target="_blank">caspar@linux.alibaba.com</a>><br>
---<br>
testcases/lib/test.sh | 3 +--<br>
1 file changed, 1 insertion(+), 2 deletions(-)<br>
<br>
diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh<br>
index 670248ee5..ade8fcdff 100644<br>
--- a/testcases/lib/test.sh<br>
+++ b/testcases/lib/test.sh<br>
@@ -58,8 +58,7 @@ tst_resm()<br>
echo " $@"<br>
<br>
case "$ret" in<br>
- TPASS|TFAIL)<br>
- TST_COUNT=$((TST_COUNT+1));;<br>
+ TPASS|TFAIL|TCONF) TST_COUNT=$((TST_COUNT+1));;<br>
esac<br>
}<br>
<br>
-- <br>
2.21.0<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/listinfo/ltp</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>