Re: [Fuego] Time sync

Muk Anc <[email protected]> Wed, 27 Apr 2022 08:20:04 +0000
Newsgroups dev.linux.lists.fuego
Message-ID <SA0PR16MB3870216217314AE0DB81EAE1EDFA9@SA0PR16MB3870.namprd16.prod.outlook.com>
--_000_SA0PR16MB3870216217314AE0DB81EAE1EDFA9SA0PR16MB3870namp_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Hello Tim,
Thank you so much for setting this up. I will give this a try and update yo=
u in a few days.

I would also like to pose another question while we are at it.
I have an ADC on our DUT. I would like to read this ADC every second while =
a batch test is running. The batch test runs around 20 individual tests. I =
would like to start reading this ADC and show its readings on the console (=
I use the FTC command to trigger the batch test) at the beginning of the fi=
rst sub test, and stop when the batch test finishes, either successfully or=
 due to a failure of a sub test.

Currently, I have updated a few of the subtest=92s test script to additiona=
lly read the ADC and echo the output, but I can do this only for tests that=
 run for a long period of time, e.g. memtest. While memtest is running in t=
he background, I keep reading and outputting the ADC every second. What wou=
ld be the best way to decouple this?

Regards
Muktabh


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=3D550986> for Window=
s

From: Bird, Tim<mailto:[email protected]>
Sent: Friday, 22 April 2022 23:15
To: Muk Anc<mailto:[email protected]>; [email protected]<ma=
ilto:[email protected]>
Subject: RE: Time sync

Muk,

I decided to write a test to implement the feature you described.

It is called Functional.time_sync_from_host, and it is now available
in the fuego-core repository, if you'd like to use it.  If you do use it,
please let me know if it provides a solution for the issue you
described.

I just pushed it to the fuego-core repository, so you'll need to do
a 'git pull' to get it.

Alternatively, you can also see it online here:
https://bitbucket.org/fuegotest/fuego-core/src/master/tests/Functional.sync=
_time_from_host/

Regards,
 -- Tim



> -----Original Message-----
> From: Bird, Tim
>
> > -----Original Message-----
> > From: Fuego <[email protected]> On Behalf Of Muk =
Anc
> >
> > Hello all,
> > I am looking for some information about time syncing the fuego tests wi=
th DUT logs. Our DUT has a RTC, but loses time info on every
> > reboot. Is there a way I can set the time on the board from Fuego? This=
 will help us generate timestamped logs on DUT and thus sync the
> > board logs to the Fuego logs.
>
> This is possible inside Fuego.
>
> You can do something like this, from inside any test:
>
> cmd "date $(date +%m%d%H%M%Y.%S)"
>
> This will get the date from the host machine, and then executes date on t=
he DUT
> using the resulting string.  If the DUT is using NTP or systemd's timesyn=
cd, then
> this might not work.  (But I presume that's not the case if the board doe=
sn't
> have the correct time on boot).
>
> You can put this command at the end of the test_deploy() function in a fu=
ego_test.sh script,
> or maybe at the beginning of the test_run() function.
>
> This would cause the synchronization to happen for the test you put it in=
.  This will work
> if you have a pre-determined set of tests.  You could add this line to
> the first test your run after rebooting.  Or you could make a test specif=
ically to perform
> this operation, and run it before other tests.
>
> If you want to perform the time synchronization for every test, then ther=
e are ways to
> add this to an overlay function, and trigger it using a special value for=
 DISTRIB in the
> board file.
>
> This is a bit complicated, but let me know if you'd like to do this, and =
I'll write some
> instructions.
>
> I hope this helps.
>  -- Tim


--_000_SA0PR16MB3870216217314AE0DB81EAE1EDFA9SA0PR16MB3870namp_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style>
</head>
<body lang=3D"en-150" link=3D"blue" vlink=3D"#954F72" style=3D"word-wrap:br=
eak-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span lang=3D"EN-US">Hello Tim,<o:p></o:p></span></p=
>
<p class=3D"MsoNormal"><span lang=3D"EN-US">Thank you so much for setting t=
his up. I will give this a try and update you in a few days.<o:p></o:p></sp=
an></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">I would also like to pose anoth=
er question while we are at it.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">I have an ADC on our DUT. I wou=
ld like to read this ADC every second while a batch test is running. The ba=
tch test runs around 20 individual tests. I would like to start reading thi=
s ADC and show its readings on the console
 (I use the FTC command to trigger the batch test) at the beginning of the =
first sub test, and stop when the batch test finishes, either successfully =
or due to a failure of a sub test.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Currently, I have updated a few of the subtest=92s t=
est script to additionally read the ADC and echo the output, but I can do t=
his only for tests that run for a long period of time, e.g. memtest. While =
memtest is running in the background,
 I keep reading and outputting the ADC every second. What would be the best=
 way to decouple this?</p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Regards</p>
<p class=3D"MsoNormal">Muktabh</p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.com/fwlink=
/?LinkId=3D550986">
Mail</a> for Windows</p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<div style=3D"mso-element:para-border-div;border:none;border-top:solid #E1E=
1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class=3D"MsoNormal" style=3D"border:none;padding:0cm"><b>From: </b><a hr=
ef=3D"mailto:[email protected]">Bird, Tim</a><br>
<b>Sent: </b>Friday, 22 April 2022 23:15<br>
<b>To: </b><a href=3D"mailto:[email protected]">Muk Anc</a>; <a href=3D"m=
ailto:[email protected]">
[email protected]</a><br>
<b>Subject: </b>RE: Time sync</p>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt">Muk,<br>
<br>
I decided to write a test to implement the feature you described.<br>
<br>
It is called Functional.time_sync_from_host, and it is now available <br>
in the fuego-core repository, if you'd like to use it.&nbsp; If you do use =
it,<br>
please let me know if it provides a solution for the issue you<br>
described.<br>
<br>
I just pushed it to the fuego-core repository, so you'll need to do<br>
a 'git pull' to get it.<br>
<br>
Alternatively, you can also see it online here:<br>
<a href=3D"https://bitbucket.org/fuegotest/fuego-core/src/master/tests/Func=
tional.sync_time_from_host/">https://bitbucket.org/fuegotest/fuego-core/src=
/master/tests/Functional.sync_time_from_host/</a><br>
<br>
Regards,<br>
&nbsp;-- Tim<br>
<br>
<br>
<br>
&gt; -----Original Message-----<br>
&gt; From: Bird, Tim<br>
&gt; <br>
&gt; &gt; -----Original Message-----<br>
&gt; &gt; From: Fuego &lt;[email protected]&gt; On Be=
half Of Muk Anc<br>
&gt; &gt;<br>
&gt; &gt; Hello all,<br>
&gt; &gt; I am looking for some information about time syncing the fuego te=
sts with DUT logs. Our DUT has a RTC, but loses time info on every<br>
&gt; &gt; reboot. Is there a way I can set the time on the board from Fuego=
? This will help us generate timestamped logs on DUT and thus sync the<br>
&gt; &gt; board logs to the Fuego logs.<br>
&gt; <br>
&gt; This is possible inside Fuego.<br>
&gt; <br>
&gt; You can do something like this, from inside any test:<br>
&gt; <br>
&gt; cmd &quot;date $(date +%m%d%H%M%Y.%S)&quot;<br>
&gt; <br>
&gt; This will get the date from the host machine, and then executes date o=
n the DUT<br>
&gt; using the resulting string.&nbsp; If the DUT is using NTP or systemd's=
 timesyncd, then<br>
&gt; this might not work.&nbsp; (But I presume that's not the case if the b=
oard doesn't<br>
&gt; have the correct time on boot).<br>
&gt; <br>
&gt; You can put this command at the end of the test_deploy() function in a=
 fuego_test.sh script,<br>
&gt; or maybe at the beginning of the test_run() function.<br>
&gt; <br>
&gt; This would cause the synchronization to happen for the test you put it=
 in.&nbsp; This will work<br>
&gt; if you have a pre-determined set of tests.&nbsp; You could add this li=
ne to<br>
&gt; the first test your run after rebooting.&nbsp; Or you could make a tes=
t specifically to perform<br>
&gt; this operation, and run it before other tests.<br>
&gt; <br>
&gt; If you want to perform the time synchronization for every test, then t=
here are ways to<br>
&gt; add this to an overlay function, and trigger it using a special value =
for DISTRIB in the<br>
&gt; board file.<br>
&gt; <br>
&gt; This is a bit complicated, but let me know if you'd like to do this, a=
nd I'll write some<br>
&gt; instructions.<br>
&gt; <br>
&gt; I hope this helps.<br>
&gt;&nbsp; -- Tim<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>

--_000_SA0PR16MB3870216217314AE0DB81EAE1EDFA9SA0PR16MB3870namp_--