<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Petr Vorel <<a href="mailto:pvorel@suse.cz">pvorel@suse.cz</a>> wrote:<br></div><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail_default" style="font-size:small">...</span><br>
<br>
> > old api, not sure why exactly it was removed in the new one...<br>
> It was designed from scratch I guess.<br>
> But this patch makes sense to me, I'll test it tomorrow.<br>
<br>
Actually, I now consider a bit cleaner and safer solution to *not* use eval<br>
and require test to specify function. E.g.:<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Why not use eval for that? It helps us to perform more commands directly without wrap into function.</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
+retry_fnc()<br>
+{<br>
+ tst_rhost_run -c 'ss -ltp' | grep -q "$port.*testsf"<br>
+}<br>
+<br>
do_setup()<br>
{<br>
<br>
@@ -28,7 +33,7 @@ do_setup()<br>
tst_rhost_run -s -b -c "$server $(tst_ipaddr rhost) $port"<br>
server_started=1<br>
tst_res TINFO "wait for the server to start"<br>
- sleep 1<br>
+ TST_RETRY_FUNC retry_fnc 0<br>
}<br>
<br>
Instead of simple:<br>
<br>
do_setup()<br>
@@ -28,7 +28,7 @@ do_setup()<br>
tst_rhost_run -s -b -c "$server $(tst_ipaddr rhost) $port"<br>
server_started=1<br>
tst_res TINFO "wait for the server to start"<br>
- sleep 1<br>
+ TST_RETRY_FUNC "tst_rhost_run -c 'ss -ltp' | grep -q '$port.*testsf'" 0<br>
}<br>
<br>
But I don't have strong opinion on it.<br>
Cyril, Li, any preference?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">If no more strict reasons I prefer to go the simpler way. And there is no need to wrap a retry_fun() I think.</div></div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>