Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 47833ca

Browse files
committed
Merge pull request #10 from ostroproject/revert-4-ostro_work_around
Revert "meta-iotqa: a work around methods to fit upstream changes"
2 parents 3a6e94d + 45553b4 commit 47833ca

File tree

1 file changed

+5
-60
lines changed

1 file changed

+5
-60
lines changed

lib/runtest.py

Lines changed: 5 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -19,65 +19,13 @@
1919
from optparse import OptionParser
2020
from oeqa.oetest import oeTest
2121
from oeqa.oetest import oeRuntimeTest
22-
from oeqa.oetest import TestContext as OETestContext
22+
from oeqa.oetest import runTests
23+
from oeqa.runexported import FakeTarget
24+
from oeqa.runexported import MyDataDict
25+
from oeqa.runexported import TestContext
2326
from oeqa.utils.sshcontrol import SSHControl
2427
from oeqa.utils.decorators import gettag
2528

26-
class FakeTarget(object):
27-
def __init__(self, d):
28-
self.connection = None
29-
self.ip = None
30-
self.server_ip = None
31-
self.datetime = time.strftime('%Y%m%d%H%M%S',time.gmtime())
32-
self.testdir = d.getVar("TEST_LOG_DIR", True)
33-
self.pn = d.getVar("PN", True)
34-
35-
def exportStart(self):
36-
self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
37-
sshloglink = os.path.join(self.testdir, "ssh_target_log")
38-
if os.path.exists(sshloglink):
39-
os.remove(sshloglink)
40-
os.symlink(self.sshlog, sshloglink)
41-
print("SSH log file: %s" % self.sshlog)
42-
self.connection = SSHControl(self.ip, logfile=self.sshlog)
43-
44-
def run(self, cmd, timeout=None):
45-
return self.connection.run(cmd, timeout)
46-
47-
def copy_to(self, localpath, remotepath):
48-
return self.connection.copy_to(localpath, remotepath)
49-
50-
def copy_from(self, remotepath, localpath):
51-
return self.connection.copy_from(remotepath, localpath)
52-
53-
54-
class MyDataDict(dict):
55-
def getVar(self, key, unused = None):
56-
return self.get(key, "")
57-
58-
class TestContext(object):
59-
def __init__(self):
60-
self.d = None
61-
self.target = None
62-
63-
class RuntestTestContext(OETestContext):
64-
def __init__(self, tc):
65-
d = tc.d
66-
super(RuntestTestContext, self).__init__(d)
67-
self.pkgmanifest = tc.pkgmanifest
68-
self.target = tc.target
69-
self.tagexp = tc.tagexp
70-
self.imagefeatures = tc.imagefeatures
71-
self.distrofeatures = tc.distrofeatures
72-
def _get_test_suites(self):
73-
return self.d.getVar("testslist", True)
74-
def _get_tests_list(self, bbpath):
75-
return self.testsuites
76-
def _get_test_suites_required(self):
77-
return self.testsuites
78-
def loadTests(self):
79-
super(RuntestTestContext, self).loadTests()
80-
setattr(oeRuntimeTest, "pscmd", "ps -ef" if oeTest.hasPackage("procps") else "ps")
8129
try:
8230
import simplejson as json
8331
except ImportError:
@@ -188,7 +136,6 @@ def main():
188136
d["BUILD_ARCH"] = "x86_64" if not navarch else navarch
189137
if options.nativearch:
190138
d["BUILD_ARCH"] = options.nativearch
191-
d["testslist"] = tc.testslist
192139
setattr(tc, "d", d)
193140

194141
#inject build package manifest
@@ -208,9 +155,7 @@ def main():
208155

209156
target.exportStart()
210157
setattr(tc, "tagexp", options.tag)
211-
runner = RuntestTestContext(tc)
212-
runner.loadTests()
213-
runner.runTests()
158+
runTests(tc)
214159

215160
return 0
216161

0 commit comments

Comments
 (0)