<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial" size="2"><span style="font-size:10pt;">
<div>Hi Oleksij, </div>
<div> </div>
<div>Some observations from our side: </div>
<ul style="margin:0;padding-left:54pt;">
<li>In other to run <b>message_queue_test_02_snd</b>, <b>message_queue_test_02_rcv</b>, <b>message_queue_test_02_ctl</b> successfully, we need to run <font color="#0070C0"><b>message_queue_test_02_get</b></font><font color="#00B0F0"><b> </b></font>before. </li></ul>
<div style="text-indent:36pt;"> Because <font color="#0070C0"><b>message_queue_test_02_get</b></font><font color="#00B0F0"><b> </b></font>will create file <b>/tmp/message_queue_test</b><b> </b>as well as<b> </b>create <b>generate message queue identifier</b>
which will be used in the other three.</div>
<ul style="margin:0;padding-left:54pt;">
<li><b>message_queue_test_02_snd</b>, <b>message_queue_test_02_rcv</b>, <b>message_queue_test_02_ctl</b> doesn’t work with –f to specify another location for project name <b>in case</b> the message queue identifier not yet generated along with the file</li></ul>
<div> </div>
<div><font color="#0070C0"><b>message_queue_test_02_get</b><b>.c</b></font></div>
<div> </div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>int</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> </span></font><font face="Consolas" size="2"><span style="font-size:10pt;"><b>main</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;">(</span></font><font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>int</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;">
argc, </span></font><font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>char</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> **argv)</span></font><font face="Consolas" size="2"><span style="font-size:10pt;">,</span></font></span></font></div>
<div><font face="Consolas">{</font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2"><span style="font-size:10pt;"><u>key_t</u></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> key; </span></font><font face="Consolas" size="2" color="#3F7F5F"><span style="font-size:10pt;">/*
Unique key */</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>int</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> msqid; </span></font><font face="Consolas" size="2" color="#3F7F5F"><span style="font-size:10pt;">/*
Message queue identifier */</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>int</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> fd; </span></font><font face="Consolas" size="2" color="#3F7F5F"><span style="font-size:10pt;">/*
</span></font><font face="Consolas" size="2" color="#3F7F5F"><span style="font-size:10pt;"><u>Temp</u></span></font><font face="Consolas" size="2" color="#3F7F5F"><span style="font-size:10pt;"> file descriptor */</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2"><span style="font-size:10pt;"><u>mode_t</u></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> mode = 0777; </span></font><font face="Consolas" size="2" color="#3F7F5F"><span style="font-size:10pt;">/*
Default mode bits */</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#3F7F5F"><span style="font-size:10pt;">/*</span></font></span></font></div>
<div><font face="Calibri" size="2" color="#3F7F5F"><span style="font-size:11pt;"> <font face="Consolas" size="2"><span style="font-size:10pt;"> * Parse command line options</span></font></span></font></div>
<div><font face="Calibri" size="2" color="#3F7F5F"><span style="font-size:11pt;"> <font face="Consolas" size="2"><span style="font-size:10pt;"> */</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2"><span style="font-size:10pt;">parse_args(argc, argv);</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>i</b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b>f</b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b>
((fd = open(</b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;background-color:silver;"><b>project_name</b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b>, </b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b><u>O_CREAT</u></b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b>
| </b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b><u>O_RDWR</u></b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b>, mode)) < 0)</b></span></font></span></font></div>
<div><font face="Consolas" color="#0070C0"> <b>sys_error("open failed", __LINE__);</b></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>if</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> (close(fd) < 0)</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2"><span style="font-size:10pt;">sys_error(</span></font><font face="Consolas" size="2" color="#2A00FF"><span style="font-size:10pt;">"close failed"</span></font><font face="Consolas" size="2"><span style="font-size:10pt;">,
__LINE__);</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>if</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> ((key = ftok(</span></font><font face="Consolas" size="2"><span style="font-size:10pt;background-color:silver;">project_name</span></font><font face="Consolas" size="2"><span style="font-size:10pt;">,
project_id)) < 0)</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2"><span style="font-size:10pt;">sys_error(</span></font><font face="Consolas" size="2" color="#2A00FF"><span style="font-size:10pt;">"</span></font><font face="Consolas" size="2" color="#2A00FF"><span style="font-size:10pt;"><u>ftok</u></span></font><font face="Consolas" size="2" color="#2A00FF"><span style="font-size:10pt;">
failed"</span></font><font face="Consolas" size="2"><span style="font-size:10pt;">, __LINE__);</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b>if</b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b> ((msqid
= msgget(key, </b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b><u>IPC_CREAT</u></b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b> | </b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b><u>S_IRUSR</u></b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b>
| </b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b><u>S_IWUSR</u></b></span></font><font face="Consolas" size="2" color="#0070C0"><span style="font-size:10pt;"><b>)) < 0)</b></span></font></span></font></div>
<div><font face="Consolas" color="#0070C0"> <b>sys_error("</b><b><u>msgget</u></b><b> failed", __LINE__);</b></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2"><span style="font-size:10pt;">printf(</span></font><font face="Consolas" size="2" color="#2A00FF"><span style="font-size:10pt;">"%d\n"</span></font><font face="Consolas" size="2"><span style="font-size:10pt;">,
msqid);</span></font></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> <font face="Consolas" size="2" color="#7F0055"><span style="font-size:10pt;"><b>return</b></span></font><font face="Consolas" size="2"><span style="font-size:10pt;"> (0);</span></font></span></font></div>
<div><font face="Consolas">}</font></div>
<div> </div>
<div> </div>
<div>Trân trọng / Best regards</div>
<div> </div>
<div>Nga Hoang Thi Thuy</div>
<div>RBVH/ENG2 </div>
<div> </div>
<div>Tel. +49(711)8113624527 </div>
<div> </div>
<div> </div>
<div> </div>
<div>-----Original Message-----<br>
From: FIXED-TERM Rempel Oleksij (CM/ESO3) <br>
Sent: Thursday, July 07, 2016 8:05 PM<br>
To: ltp@lists.linux.it; Le Cong Binh (RBVH/ENG2) <Binh.LeCong@vn.bosch.com>; Hoang Thi Thuy Nga (RBVH/ENG2) <Nga.HoangThiThuy@vn.bosch.com><br>
Subject: Re: [LTP] updating message_queue_test_02_*</div>
<div> </div>
<div>On 07.07.2016 13:55, fixed-term.Oleksij.Rempel wrote:</div>
<div>> Hallo all,</div>
<div>> </div>
<div>> it is kind of a duplication of this case:</div>
<div>> <a href="https://github.com/linux-test-project/ltp/issues/75">https://github.com/linux-test-project/ltp/issues/75</a></div>
<div>> </div>
<div>> some of message_queue_test_02_* are fail on our configuration, it looks</div>
<div>> like the reason is hardcoded tmp path, which is different in our test setup.</div>
<div>> </div>
<div>> Looks like this tests should be updated to use current ltp bindings..</div>
<div>> which should also fix this issue. Do any one already working on it? If</div>
<div>> not, me or some of us will try to do it.</div>
<div>> </div>
<div> </div>
<div>hm...</div>
<div>to execute *message_queue_test_02_rcv* properly, first should be</div>
<div>*message_queue_test_02_snd* executed. And most important, target should</div>
<div>not be reseted after message_queue_test_02_snd. If this happens,</div>
<div>message_queue_test_02_rcv will hang forever.</div>
<div>It is not looks like proper behaviour (it is not theoretical assumption.).</div>
<div> </div>
<div>May be message_queue_test_02_rcv should be wrapped by a script which</div>
<div>will start rcv in background and then send after short sleep?</div>
<div>And some how make sure that message_queue_test_02_rcv wont wait forever?</div>
<div> </div>
<div>Any comments?</div>
<div> </div>
</span></font>
</body>
</html>