summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa/runtime
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2017-01-13 10:47:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:03:57 +0000
commit077dc19445574457769eb4f231de97e8059cb75e (patch)
tree6219014f47d8737d6618a54b1df7a52ac60cd981 /meta/lib/oeqa/runtime
parent8c7335290cb00ed0683241249297ca573ebd353a (diff)
downloadopenembedded-core-077dc19445574457769eb4f231de97e8059cb75e.tar.gz
openembedded-core-077dc19445574457769eb4f231de97e8059cb75e.tar.bz2
openembedded-core-077dc19445574457769eb4f231de97e8059cb75e.zip
testimage.bbclass: Add package install feature
This allows to use the package install feature with the new OEQA framework. [YOCTO #10234] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r--meta/lib/oeqa/runtime/case.py9
-rw-r--r--meta/lib/oeqa/runtime/context.py12
2 files changed, 20 insertions, 1 deletions
diff --git a/meta/lib/oeqa/runtime/case.py b/meta/lib/oeqa/runtime/case.py
index 43f1b2f425..c1485c9860 100644
--- a/meta/lib/oeqa/runtime/case.py
+++ b/meta/lib/oeqa/runtime/case.py
@@ -2,7 +2,16 @@
# Released under the MIT license (see COPYING.MIT)
from oeqa.core.case import OETestCase
+from oeqa.utils.package_manager import install_package, uninstall_package
class OERuntimeTestCase(OETestCase):
# target instance set by OERuntimeTestLoader.
target = None
+
+ def _oeSetUp(self):
+ super(OERuntimeTestCase, self)._oeSetUp()
+ install_package(self)
+
+ def _oeTearDown(self):
+ super(OERuntimeTestCase, self)._oeTearDown()
+ uninstall_package(self)
diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py
index bc8abd0c4e..10b8b54809 100644
--- a/meta/lib/oeqa/runtime/context.py
+++ b/meta/lib/oeqa/runtime/context.py
@@ -15,12 +15,14 @@ class OERuntimeTestContext(OETestContext):
runtime_files_dir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "files")
- def __init__(self, td, logger, target, host_dumper, image_packages):
+ def __init__(self, td, logger, target,
+ host_dumper, image_packages, extract_dir):
super(OERuntimeTestContext, self).__init__(td, logger)
self.target = target
self.image_packages = image_packages
self.host_dumper = host_dumper
+ self.extract_dir = extract_dir
self._set_target_cmds()
def _set_target_cmds(self):
@@ -45,6 +47,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
default_server_ip = '192.168.7.1'
default_target_ip = '192.168.7.2'
default_host_dumper_dir = '/tmp/oe-saved-tests'
+ default_extract_dir = 'extract_dir'
def register_commands(self, logger, subparsers):
super(OERuntimeTestContextExecutor, self).register_commands(logger, subparsers)
@@ -72,6 +75,9 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
runtime_group.add_argument('--packages-manifest', action='store',
help="Package manifest of the image under test")
+ runtime_group.add_argument('--extract-dir', action='store',
+ help='Directory where extracted packages reside')
+
runtime_group.add_argument('--qemu-boot', action='store',
help="Qemu boot configuration, only needed when target_type is QEMU.")
@@ -126,4 +132,8 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
OERuntimeTestContextExecutor.readPackagesManifest(
args.packages_manifest)
+ self.tc_kwargs['init']['extract_dir'] = \
+ OERuntimeTestContextExecutor.readPackagesManifest(
+ args.extract_dir)
+
_executor_class = OERuntimeTestContextExecutor