summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/oetest.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/oetest.py')
-rw-r--r--meta/lib/oeqa/oetest.py38
1 files changed, 24 insertions, 14 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 3ed5bb8c2b..bef9ac4961 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -331,14 +331,13 @@ class TestContext(object):
331 331
332 return runner.run(self.suite) 332 return runner.run(self.suite)
333 333
334class ImageTestContext(TestContext): 334class RuntimeTestContext(TestContext):
335 def __init__(self, d, target, host_dumper): 335 def __init__(self, d, target):
336 super(ImageTestContext, self).__init__(d) 336 super(RuntimeTestContext, self).__init__(d)
337 337
338 self.tagexp = d.getVar("TEST_SUITES_TAGS", True) 338 self.tagexp = d.getVar("TEST_SUITES_TAGS", True)
339 339
340 self.target = target 340 self.target = target
341 self.host_dumper = host_dumper
342 341
343 manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), 342 manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),
344 d.getVar("IMAGE_LINK_NAME", True) + ".manifest") 343 d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
@@ -352,15 +351,6 @@ class ImageTestContext(TestContext):
352 else: 351 else:
353 self.pkgmanifest = "" 352 self.pkgmanifest = ""
354 353
355 self.sigterm = False
356 self.origsigtermhandler = signal.getsignal(signal.SIGTERM)
357 signal.signal(signal.SIGTERM, self._sigterm_exception)
358
359 def _sigterm_exception(self, signum, stackframe):
360 bb.warn("TestImage received SIGTERM, shutting down...")
361 self.sigterm = True
362 self.target.stop()
363
364 def _get_test_namespace(self): 354 def _get_test_namespace(self):
365 return "runtime" 355 return "runtime"
366 356
@@ -382,9 +372,29 @@ class ImageTestContext(TestContext):
382 return [t for t in self.d.getVar("TEST_SUITES", True).split() if t != "auto"] 372 return [t for t in self.d.getVar("TEST_SUITES", True).split() if t != "auto"]
383 373
384 def loadTests(self): 374 def loadTests(self):
385 super(ImageTestContext, self).loadTests() 375 super(RuntimeTestContext, self).loadTests()
386 setattr(oeRuntimeTest, "pscmd", "ps -ef" if oeTest.hasPackage("procps") else "ps") 376 setattr(oeRuntimeTest, "pscmd", "ps -ef" if oeTest.hasPackage("procps") else "ps")
387 377
378class ImageTestContext(RuntimeTestContext):
379 def __init__(self, d, target, host_dumper):
380 super(ImageTestContext, self).__init__(d, target)
381
382 self.host_dumper = host_dumper
383
384 self.sigterm = False
385 self.origsigtermhandler = signal.getsignal(signal.SIGTERM)
386 signal.signal(signal.SIGTERM, self._sigterm_exception)
387
388 def _sigterm_exception(self, signum, stackframe):
389 bb.warn("TestImage received SIGTERM, shutting down...")
390 self.sigterm = True
391 self.target.stop()
392
393class ExportTestContext(RuntimeTestContext):
394 def __init__(self, d, target):
395 super(ExportTestContext, self).__init__(d, target)
396 self.sigterm = None
397
388class SDKTestContext(TestContext): 398class SDKTestContext(TestContext):
389 def __init__(self, d, sdktestdir, sdkenv, tcname, *args): 399 def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
390 super(SDKTestContext, self).__init__(d) 400 super(SDKTestContext, self).__init__(d)