1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

oeqa/runexported.py: Fix exported test

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.

(From OE-Core rev: da0abb9679cb1fd639859a2fdbd82101d0a81259)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Mariano Lopez
2016-04-11 06:55:35 +00:00
committed by Richard Purdie
parent 85dbd7bf9e
commit d27ca36e2a
3 changed files with 20 additions and 11 deletions
+5 -1
View File
@@ -19,7 +19,11 @@ except ImportError:
import logging import logging
import oeqa.runtime 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.decorators import LogResults, gettag, getResults
from oeqa.utils import avoid_paths_in_environ from oeqa.utils import avoid_paths_in_environ
+10 -9
View File
@@ -30,7 +30,7 @@ except ImportError:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))) 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.sshcontrol import SSHControl
from oeqa.utils.dump import get_host_dumper from oeqa.utils.dump import get_host_dumper
@@ -49,7 +49,7 @@ class FakeTarget(object):
def exportStart(self): def exportStart(self):
self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime) self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
sshloglink = os.path.join(self.testdir, "ssh_target_log") sshloglink = os.path.join(self.testdir, "ssh_target_log")
if os.path.exists(sshloglink): if os.path.lexists(sshloglink):
os.remove(sshloglink) os.remove(sshloglink)
os.symlink(self.sshlog, sshloglink) os.symlink(self.sshlog, sshloglink)
print("SSH log file: %s" % self.sshlog) print("SSH log file: %s" % self.sshlog)
@@ -69,10 +69,9 @@ class MyDataDict(dict):
def getVar(self, key, unused = None): def getVar(self, key, unused = None):
return self.get(key, "") return self.get(key, "")
class TestContext(object): class ExportTestContext(TestContext):
def __init__(self): def __init__(self, d):
self.d = None self.d = d
self.target = None
def main(): def main():
@@ -121,7 +120,9 @@ def main():
host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"] host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"]
host_dumper.cmds = loaded["host_dumper"]["cmds"] host_dumper.cmds = loaded["host_dumper"]["cmds"]
tc = TestContext() target.exportStart()
tc = ExportTestContext(d)
setattr(tc, "d", d) setattr(tc, "d", d)
setattr(tc, "target", target) setattr(tc, "target", target)
setattr(tc, "host_dumper", host_dumper) setattr(tc, "host_dumper", host_dumper)
@@ -129,8 +130,8 @@ def main():
if key != "d" and key != "target" and key != "host_dumper": if key != "d" and key != "target" and key != "host_dumper":
setattr(tc, key, loaded[key]) setattr(tc, key, loaded[key])
target.exportStart() tc.loadTests()
runTests(tc) tc.runTests()
return 0 return 0
+5 -1
View File
@@ -18,7 +18,11 @@ from oeqa.utils import CommandError
from oeqa.utils import ftools from oeqa.utils import ftools
import re import re
import contextlib import contextlib
import bb # Export test doesn't require bb
try:
import bb
except ImportError:
pass
class Command(object): class Command(object):
def __init__(self, command, bg=False, timeout=None, data=None, **options): def __init__(self, command, bg=False, timeout=None, data=None, **options):