<div dir="ltr"><div>From: Yicheng Qin &lt;<a href="mailto:yichengq@google.com">yichengq@google.com</a>&gt;</div><div>Subject: [PATCH] test/zdtm: skip failed individual tests instead of exiting</div><div><br></div><div>This ensures that all tests can be run in one pass, which can provide</div>
<div>better overview of test result.</div><div><br></div><div>Signed-off-by: Yicheng Qin &lt;<a href="mailto:yichengq@google.com">yichengq@google.com</a>&gt;</div><div>---</div><div> test/zdtm.sh | 21 ++++++++++++++++++---</div>
<div> 1 file changed, 18 insertions(+), 3 deletions(-)</div><div><br></div><div>diff --git a/test/zdtm.sh b/test/zdtm.sh</div><div>index 6db2bf0..094ea53 100755</div><div>--- a/test/zdtm.sh</div><div>+++ b/test/zdtm.sh</div>
<div>@@ -174,6 +174,7 @@ PAGE_SERVER=0</div><div> PS_PORT=12345</div><div> TCPDUMP_PID=</div><div> NS_TEST_ONLY=0</div><div>+EXIT_VALUE=0</div><div> </div><div> check_mainstream()</div><div> {</div><div>@@ -439,7 +440,7 @@ EOF</div>
<div> <span class="" style="white-space:pre">                </span># with some error code, or checkpoint is complete but return</div><div> <span class="" style="white-space:pre">                </span># code is non-zero because of post dump action.</div>
<div> <span class="" style="white-space:pre">                </span>if [ &quot;$retcode&quot; -ne 0 ] &amp;&amp; [[ &quot;$retcode&quot; -ne 32 || -z &quot;$dump_only&quot; ]]; then</div><div>-<span class="" style="white-space:pre">                        </span>echo WARNING: $tname returned $retcode and left running for debug needs</div>
<div>+<span class="" style="white-space:pre">                        </span>echo WARNING: $tname failed and returned $retcode</div><div> <span class="" style="white-space:pre">                        </span>return 1</div><div> <span class="" style="white-space:pre">                </span>fi</div>
<div> </div><div>@@ -553,7 +554,14 @@ case_error()</div><div> </div><div> <span class="" style="white-space:pre">        </span>echo &quot;==================== ERROR OVER ====================&quot; &gt;&amp;2</div><div> </div><div>
-<span class="" style="white-space:pre">        </span>exit 1</div><div>+<span class="" style="white-space:pre">        </span># cleanout failed test to prepare for next one</div><div>+<span class="" style="white-space:pre">        </span>local tname=`basename $test`</div>
<div>+<span class="" style="white-space:pre">        </span>local tdir=`dirname $test`</div><div>+<span class="" style="white-space:pre">        </span>killall -9 $tname &gt; /dev/null 2&gt;&amp;1</div><div>+<span class="" style="white-space:pre">        </span>make -C $tdir $tname.cleanout</div>
<div>+</div><div>+<span class="" style="white-space:pre">        </span># record the error</div><div>+<span class="" style="white-space:pre">        </span>EXIT_VALUE=1</div><div> }</div><div> </div><div> checkout()</div><div>@@ -664,6 +672,12 @@ if [ $# -eq 0 ]; then</div>
<div> <span class="" style="white-space:pre">        </span>for t in $IPC_TEST_LIST; do</div><div> <span class="" style="white-space:pre">                </span>run_test $t -n ipc || case_error $t</div><div> <span class="" style="white-space:pre">        </span>done</div>
<div>+</div><div>+<span class="" style="white-space:pre">        </span>if [ $EXIT_VALUE -eq 0 ]; then</div><div>+<span class="" style="white-space:pre">                </span>echo ZDTM tests PASS.</div><div>+<span class="" style="white-space:pre">        </span>else</div>
<div>+<span class="" style="white-space:pre">                </span>echo ZDTM tests FAIL.</div><div>+<span class="" style="white-space:pre">        </span>fi</div><div> elif [ &quot;$1&quot; = &quot;-l&quot; ]; then</div><div> <span class="" style="white-space:pre">        </span>echo $TEST_LIST $UTS_TEST_LIST $MNT_TEST_LIST $IPC_TEST_LIST | tr &#39; &#39; &#39;\n&#39;</div>
<div> elif [ &quot;$1&quot; = &quot;-g&quot; ]; then</div><div>@@ -711,4 +725,5 @@ else</div><div> <span class="" style="white-space:pre">        </span>fi</div><div> fi</div><div> </div><div>-[ -n &quot;$TMP_TREE&quot; ] &amp;&amp; rm -rf $TMP_TREE || exit 0</div>
<div>+[ -n &quot;$TMP_TREE&quot; ] &amp;&amp; rm -rf $TMP_TREE</div><div>+exit $EXIT_VALUE</div><div>-- </div><div>1.8.3</div><div><br></div></div>