<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><div class="gmail_quote">Cyril Hrubis <span dir="ltr"><<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_default" style="font-size:small;display:inline">​[...]</div><br>
<br>
-int main(int ac, char **av)<br>
-{<br>
-       int lc;<br>
+       if (TEST_RETURN != 0) {<br>
+               tst_res(TFAIL | TTERRNO, "msgctl() returned %li", TEST_RETURN);<br>
+               return;<br>
+       }<br>
<br>
-       tst_parse_opts(ac, av, NULL, NULL);<br>
+       tst_res(TPASS, "msgctl(IPC_STAT)");<br>
<br>
-       setup();                /* global setup */<br>
+       if (buf.msg_stime == 0)<br>
+               tst_res(TPASS, "msg_stime = 0");<br>
+       else<br>
+               tst_res(TFAIL, "msg_stime = %lu", (unsigned long)buf.msg_stime);<br>
<br>
-       /* The following loop checks looping state if -i option given */<br>
+       if (buf.msg_rtime == 0)<br>
+               tst_res(TPASS, "msg_rtime = 0");<br>
+       else<br>
+               tst_res(TFAIL, "msg_rtime = %lu", (unsigned long)buf.msg_rtime);<br>
<br>
-       for (lc = 0; TEST_LOOPING(lc); lc++) {<br>
-               /* reset tst_count in case we are looping */<br>
-               tst_count = 0;<br>
+       if (buf.msg_ctime == creat_time || buf.msg_ctime == creat_time + 1) {</blockquote><div><div class="gmail_default">​<div class="gmail_default" style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">​I'm thinking that whether 1 second is enough for system shaking. ​If this program is running on an overload system, this maybe delay more than 1 second and test fails, is that a test defect?​</div><div class="gmail_default" style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Maybe gives more flexible as:</div><div class="gmail_default" style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">    if (buf.msg_ctime <= creat_time && buf.msg_ctime >= creat_time - 3) <br></div></div></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">
+               tst_res(TPASS, "msg_ctime = %lu, expected %lu",<br>
+                       (unsigned long)buf.msg_ctime, (unsigned long)creat_time);<br>
+       } else {<br>
+               tst_res(TPASS, "msg_ctime = %lu, expected %lu",<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">​seems typo here?  TFAIL</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">
+                       (unsigned long)buf.msg_ctime, (unsigned long)creat_time);<br>
+       }</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br></blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_default" style="font-size:small">​Beside that, I got this follow errors occasionally:</div><div class="gmail_default" style="font-size:small"></div></div><div><br></div><div><div class="gmail_default" style="font-size:small">​# ./msgctl01 </div><div class="gmail_default">tst_test.c:1015: INFO: Timeout per run is 0h 05m 00s</div><div class="gmail_default">tst_safe_sysv_ipc.c:51: BROK: msgctl01.c:137: msgget(1627794347, 7b0) failed: EEXIST​</div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div>
</div></div>