Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: mariano.lopez@linux.intel.com,
	openembedded-core@lists.openembedded.org,
	Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: Re: [PATCH] oeqa/runexported.py: Fix exported test
Date: Mon, 11 Apr 2016 10:57:53 -0500	[thread overview]
Message-ID: <570BC981.3000603@linux.intel.com> (raw)
In-Reply-To: <570BBF16.7000001@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 4139 bytes --]

+ RP to integrate this patch before release 2.1

On 04/11/2016 10:13 AM, Aníbal Limón wrote:
> Also will be a good idea to add testing for this functionality to avoid
> future broke.
> 
> Mariano could you load the bug for this task?
> 
> Best regards,
> 	alimon
> 
> On 04/11/2016 01:55 AM, mariano.lopez@linux.intel.com wrote:
>> From: Mariano Lopez <mariano.lopez@linux.intel.com>
>>
>> With the changes introduced to test the eSDK
>> the runexported test failed during the execution.
>>
>> This change fix runexported test in the least invasive
>> way, because of the release cycle.
>>
>> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
> Acked-by: Aníbal Limón <anibal.limon@linux.intel.com>
> 
>> ---
>>  meta/lib/oeqa/oetest.py         |  6 +++++-
>>  meta/lib/oeqa/runexported.py    | 19 ++++++++++---------
>>  meta/lib/oeqa/utils/commands.py |  6 +++++-
>>  3 files changed, 20 insertions(+), 11 deletions(-)
>>
>> diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
>> index fc1e8b5..8eb84ed 100644
>> --- a/meta/lib/oeqa/oetest.py
>> +++ b/meta/lib/oeqa/oetest.py
>> @@ -19,7 +19,11 @@ except ImportError:
>>  import logging
>>  
>>  import oeqa.runtime
>> -import oeqa.sdkext
>> +# Exported test doesn't require sdkext
>> +try:
>> +    import oeqa.sdkext
>> +except ImportError:
>> +    pass
>>  from oeqa.utils.decorators import LogResults, gettag, getResults
>>  from oeqa.utils import avoid_paths_in_environ
>>  
>> diff --git a/meta/lib/oeqa/runexported.py b/meta/lib/oeqa/runexported.py
>> index e9a2912..cc89e13 100755
>> --- a/meta/lib/oeqa/runexported.py
>> +++ b/meta/lib/oeqa/runexported.py
>> @@ -30,7 +30,7 @@ except ImportError:
>>  
>>  sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa")))
>>  
>> -from oeqa.oetest import runTests
>> +from oeqa.oetest import TestContext
>>  from oeqa.utils.sshcontrol import SSHControl
>>  from oeqa.utils.dump import get_host_dumper
>>  
>> @@ -49,7 +49,7 @@ class FakeTarget(object):
>>      def exportStart(self):
>>          self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
>>          sshloglink = os.path.join(self.testdir, "ssh_target_log")
>> -        if os.path.exists(sshloglink):
>> +        if os.path.lexists(sshloglink):
>>              os.remove(sshloglink)
>>          os.symlink(self.sshlog, sshloglink)
>>          print("SSH log file: %s" %  self.sshlog)
>> @@ -69,10 +69,9 @@ class MyDataDict(dict):
>>      def getVar(self, key, unused = None):
>>          return self.get(key, "")
>>  
>> -class TestContext(object):
>> -    def __init__(self):
>> -        self.d = None
>> -        self.target = None
>> +class ExportTestContext(TestContext):
>> +    def __init__(self, d):
>> +        self.d = d
>>  
>>  def main():
>>  
>> @@ -121,7 +120,9 @@ def main():
>>      host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"]
>>      host_dumper.cmds = loaded["host_dumper"]["cmds"]
>>  
>> -    tc = TestContext()
>> +    target.exportStart()
>> +    tc = ExportTestContext(d)
>> +
>>      setattr(tc, "d", d)
>>      setattr(tc, "target", target)
>>      setattr(tc, "host_dumper", host_dumper)
>> @@ -129,8 +130,8 @@ def main():
>>          if key != "d" and key != "target" and key != "host_dumper":
>>              setattr(tc, key, loaded[key])
>>  
>> -    target.exportStart()
>> -    runTests(tc)
>> +    tc.loadTests()
>> +    tc.runTests()
>>  
>>      return 0
>>  
>> diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
>> index 32e001c..48f6441 100644
>> --- a/meta/lib/oeqa/utils/commands.py
>> +++ b/meta/lib/oeqa/utils/commands.py
>> @@ -18,7 +18,11 @@ from oeqa.utils import CommandError
>>  from oeqa.utils import ftools
>>  import re
>>  import contextlib
>> -import bb
>> +# Export test doesn't require bb
>> +try:
>> +    import bb
>> +except ImportError:
>> +    pass
>>  
>>  class Command(object):
>>      def __init__(self, command, bg=False, timeout=None, data=None, **options):
>>
> 
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2016-04-11 15:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11  6:55 [PATCH] oeqa/runexported.py: Fix exported test mariano.lopez
2016-04-11 15:13 ` Aníbal Limón
2016-04-11 15:57   ` Aníbal Limón [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=570BC981.3000603@linux.intel.com \
    --to=anibal.limon@linux.intel.com \
    --cc=mariano.lopez@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox