<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">You can use a similar trick in controllerconfig for fm_core<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Add something like this to controllerconfig/tests/__init__.py<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">try:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> import fm_core<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">except:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> import mock<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> import sys<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> sys.modules['fm_core'] = mock.Mock()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">The tox.ini paths also need to be adjusted.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">The tests themselves are failing due to version discrepencies (18.03 vs 18.04). I have not looked into this.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">For the rpm package, in Centos the rpm-python package needed to be yum installed and site-packages set to true in tox.ini.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I don’t have Ubuntu experience but from what I have read, Ubuntu uses Debian format instead of RPM so the code would likely need to be written differently to work in an Ubuntu env.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Al<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Sun, Austin [mailto:austin.sun@intel.com]
<br>
<b>Sent:</b> Friday, August 24, 2018 10:31 AM<br>
<b>To:</b> Bailey, Henry Albert (Al); An, Ran1; Liu, Tao; starlingx-discuss@lists.starlingx.io<br>
<b>Subject:</b> RE: [Starlingx-discuss] add unit test to zuul<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Hi AI and All:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.0pt"><span style="color:#1F497D">Thanks. <a href="https://review.openstack.org/#/c/595352/">https://review.openstack.org/#/c/595352/</a> was merged, but An ran is working on controlconfig , which is different unit
test with sysinv. <o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.0pt"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.0pt"><span style="color:#1F497D">Can it use similar fix for controlconfig ?
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.0pt"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.0pt"><span style="color:#1F497D">BTW: I met “ImportError: No module named rpm” in
<b>Ubuntu</b> platform for sysinv unit test. <o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.0pt"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.0pt"><span style="color:#1F497D">Do you know how to install python rpm package in Ubuntu ? I tried several ways , but none worked.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">BR<br>
Austin Sun. <o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="color:#1F497D"> </span></a><span style="color:#1F497D"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Bailey, Henry Albert (Al) [mailto:Al.Bailey@windriver.com]
<br>
<b>Sent:</b> Friday, August 24, 2018 9:19 PM<br>
<b>To:</b> An, Ran1 <ran1.an@intel.com>; Liu, Tao <Tao.Liu@windriver.com>; starlingx-discuss@lists.starlingx.io<br>
<b>Subject:</b> Re: [Starlingx-discuss] add unit test to zuul<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">You should be able to run tox –e py27 now since this commit was merged<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><a href="https://github.com/openstack/stx-config/commit/b9ce2626ff452d3c9ffc58cdbcac3c0d85b13716">https://github.com/openstack/stx-config/commit/b9ce2626ff452d3c9ffc58cdbcac3c0d85b13716</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Al<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> An, Ran1 [<a href="mailto:ran1.an@intel.com">mailto:ran1.an@intel.com</a>]
<br>
<b>Sent:</b> Thursday, August 23, 2018 10:15 PM<br>
<b>To:</b> Liu, Tao; <a href="mailto:starlingx-discuss@lists.starlingx.io">starlingx-discuss@lists.starlingx.io</a><br>
<b>Subject:</b> [Starlingx-discuss] add unit test to zuul<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi:<o:p></o:p></p>
<p class="MsoNormal"> I’m looking to add exist unit tests of controlconfig(under project stx-config) to zuul but 2 of them are fail now.
<o:p></o:p></p>
<p class="MsoNormal">The error note that can’t import module “fm_core” which seams be imported by commit
<a href="https://git.openstack.org/cgit/openstack/stx-fault/commit/fm-api/fm_api/fm_api.py?id=c8159ea6cbace0a23a7639fc41d5c73619e70704">
https://git.openstack.org/cgit/openstack/stx-fault/commit/fm-api/fm_api/fm_api.py?id=c8159ea6cbace0a23a7639fc41d5c73619e70704</a>.
<o:p></o:p></p>
<p class="MsoNormal"> Does anyone is on the way to fixing this? <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal">Ran An <o:p></o:p></p>
</div>
</body>
</html>