summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2017-01-18 13:19:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:21 +0000
commit1cc2bac7ecb5108096eb72710d2ca183b6cfe785 (patch)
tree0f56d401d2b8404fd269b35dcd7ccfd594665226 /meta
parent58789be270c903bf75c1946a4c626b37a5bcdc72 (diff)
downloadpoky-1cc2bac7ecb5108096eb72710d2ca183b6cfe785.tar.gz
oeqa/runtime/context.py: Add defaults for runtime context
This adds default values to OERuntimeTestContextExecutor class in order to make easier the execution of exported test that were generated with testexport class. [YOCTO #10686] (From OE-Core rev: c78aeaac3b75610bada62b138c9670815a07ee80) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/runtime/context.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py
index 10b8b54809..e5e0141c2a 100644
--- a/meta/lib/oeqa/runtime/context.py
+++ b/meta/lib/oeqa/runtime/context.py
@@ -42,12 +42,15 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
42 default_cases = os.path.join(os.path.abspath(os.path.dirname(__file__)), 42 default_cases = os.path.join(os.path.abspath(os.path.dirname(__file__)),
43 'cases') 43 'cases')
44 default_data = None 44 default_data = None
45 default_test_data = 'data/testdata.json'
46 default_tests = ''
45 47
46 default_target_type = 'simpleremote' 48 default_target_type = 'simpleremote'
49 default_manifest = 'data/manifest'
47 default_server_ip = '192.168.7.1' 50 default_server_ip = '192.168.7.1'
48 default_target_ip = '192.168.7.2' 51 default_target_ip = '192.168.7.2'
49 default_host_dumper_dir = '/tmp/oe-saved-tests' 52 default_host_dumper_dir = '/tmp/oe-saved-tests'
50 default_extract_dir = 'extract_dir' 53 default_extract_dir = 'packages/extracted'
51 54
52 def register_commands(self, logger, subparsers): 55 def register_commands(self, logger, subparsers):
53 super(OERuntimeTestContextExecutor, self).register_commands(logger, subparsers) 56 super(OERuntimeTestContextExecutor, self).register_commands(logger, subparsers)
@@ -73,10 +76,14 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
73 % self.default_host_dumper_dir) 76 % self.default_host_dumper_dir)
74 77
75 runtime_group.add_argument('--packages-manifest', action='store', 78 runtime_group.add_argument('--packages-manifest', action='store',
76 help="Package manifest of the image under test") 79 default=self.default_manifest,
80 help="Package manifest of the image under testi, default: %s" \
81 % self.default_manifest)
77 82
78 runtime_group.add_argument('--extract-dir', action='store', 83 runtime_group.add_argument('--extract-dir', action='store',
79 help='Directory where extracted packages reside') 84 default=self.default_extract_dir,
85 help='Directory where extracted packages reside, default: %s' \
86 % self.default_extract_dir)
80 87
81 runtime_group.add_argument('--qemu-boot', action='store', 88 runtime_group.add_argument('--qemu-boot', action='store',
82 help="Qemu boot configuration, only needed when target_type is QEMU.") 89 help="Qemu boot configuration, only needed when target_type is QEMU.")
@@ -97,7 +104,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
97 104
98 @staticmethod 105 @staticmethod
99 def readPackagesManifest(manifest): 106 def readPackagesManifest(manifest):
100 if not os.path.exists(manifest): 107 if not manifest or not os.path.exists(manifest):
101 raise OSError("Manifest file not exists: %s" % manifest) 108 raise OSError("Manifest file not exists: %s" % manifest)
102 109
103 image_packages = set() 110 image_packages = set()
@@ -124,16 +131,13 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
124 131
125 self.tc_kwargs['init']['target'] = \ 132 self.tc_kwargs['init']['target'] = \
126 OERuntimeTestContextExecutor.getTarget(args.target_type, 133 OERuntimeTestContextExecutor.getTarget(args.target_type,
127 args.target_ip, args.server_ip, **target_kwargs) 134 None, args.target_ip, args.server_ip, **target_kwargs)
128 self.tc_kwargs['init']['host_dumper'] = \ 135 self.tc_kwargs['init']['host_dumper'] = \
129 OERuntimeTestContextExecutor.getHostDumper(None, 136 OERuntimeTestContextExecutor.getHostDumper(None,
130 args.host_dumper_dir) 137 args.host_dumper_dir)
131 self.tc_kwargs['init']['image_packages'] = \ 138 self.tc_kwargs['init']['image_packages'] = \
132 OERuntimeTestContextExecutor.readPackagesManifest( 139 OERuntimeTestContextExecutor.readPackagesManifest(
133 args.packages_manifest) 140 args.packages_manifest)
134 141 self.tc_kwargs['init']['extract_dir'] = args.extract_dir
135 self.tc_kwargs['init']['extract_dir'] = \
136 OERuntimeTestContextExecutor.readPackagesManifest(
137 args.extract_dir)
138 142
139_executor_class = OERuntimeTestContextExecutor 143_executor_class = OERuntimeTestContextExecutor