diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/context.py')
-rw-r--r-- | meta/lib/oeqa/selftest/context.py | 47 |
1 files changed, 3 insertions, 44 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index cd893261d3..409698d57c 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py | |||
@@ -9,9 +9,7 @@ import time | |||
9 | import glob | 9 | import glob |
10 | import sys | 10 | import sys |
11 | import importlib | 11 | import importlib |
12 | import signal | ||
13 | import subprocess | 12 | import subprocess |
14 | from shutil import copyfile | ||
15 | from random import choice | 13 | from random import choice |
16 | 14 | ||
17 | import oeqa | 15 | import oeqa |
@@ -185,26 +183,10 @@ class OESelftestTestContextExecutor(OETestContextExecutor): | |||
185 | 183 | ||
186 | builddir = os.environ.get("BUILDDIR") | 184 | builddir = os.environ.get("BUILDDIR") |
187 | self.tc_kwargs['init']['config_paths'] = {} | 185 | self.tc_kwargs['init']['config_paths'] = {} |
188 | self.tc_kwargs['init']['config_paths']['testlayer_path'] = \ | 186 | self.tc_kwargs['init']['config_paths']['testlayer_path'] = get_test_layer() |
189 | get_test_layer() | ||
190 | self.tc_kwargs['init']['config_paths']['builddir'] = builddir | 187 | self.tc_kwargs['init']['config_paths']['builddir'] = builddir |
191 | self.tc_kwargs['init']['config_paths']['localconf'] = \ | 188 | self.tc_kwargs['init']['config_paths']['localconf'] = os.path.join(builddir, "conf/local.conf") |
192 | os.path.join(builddir, "conf/local.conf") | 189 | self.tc_kwargs['init']['config_paths']['bblayers'] = os.path.join(builddir, "conf/bblayers.conf") |
193 | self.tc_kwargs['init']['config_paths']['localconf_backup'] = \ | ||
194 | os.path.join(builddir, "conf/local.conf.orig") | ||
195 | self.tc_kwargs['init']['config_paths']['localconf_class_backup'] = \ | ||
196 | os.path.join(builddir, "conf/local.conf.bk") | ||
197 | self.tc_kwargs['init']['config_paths']['bblayers'] = \ | ||
198 | os.path.join(builddir, "conf/bblayers.conf") | ||
199 | self.tc_kwargs['init']['config_paths']['bblayers_backup'] = \ | ||
200 | os.path.join(builddir, "conf/bblayers.conf.orig") | ||
201 | self.tc_kwargs['init']['config_paths']['bblayers_class_backup'] = \ | ||
202 | os.path.join(builddir, "conf/bblayers.conf.bk") | ||
203 | |||
204 | copyfile(self.tc_kwargs['init']['config_paths']['localconf'], | ||
205 | self.tc_kwargs['init']['config_paths']['localconf_backup']) | ||
206 | copyfile(self.tc_kwargs['init']['config_paths']['bblayers'], | ||
207 | self.tc_kwargs['init']['config_paths']['bblayers_backup']) | ||
208 | 190 | ||
209 | def tag_filter(tags): | 191 | def tag_filter(tags): |
210 | if args.exclude_tags: | 192 | if args.exclude_tags: |
@@ -329,18 +311,9 @@ class OESelftestTestContextExecutor(OETestContextExecutor): | |||
329 | 311 | ||
330 | return rc | 312 | return rc |
331 | 313 | ||
332 | def _signal_clean_handler(self, signum, frame): | ||
333 | if self.ourpid == os.getpid(): | ||
334 | sys.exit(1) | ||
335 | |||
336 | def run(self, logger, args): | 314 | def run(self, logger, args): |
337 | self._process_args(logger, args) | 315 | self._process_args(logger, args) |
338 | 316 | ||
339 | # Setup a SIGTERM handler to allow restoration of files like local.conf and bblayers.conf | ||
340 | # but don't interfer with other processes | ||
341 | self.ourpid = os.getpid() | ||
342 | signal.signal(signal.SIGTERM, self._signal_clean_handler) | ||
343 | |||
344 | rc = None | 317 | rc = None |
345 | try: | 318 | try: |
346 | if args.machine: | 319 | if args.machine: |
@@ -369,20 +342,6 @@ class OESelftestTestContextExecutor(OETestContextExecutor): | |||
369 | rc = self._internal_run(logger, args) | 342 | rc = self._internal_run(logger, args) |
370 | finally: | 343 | finally: |
371 | config_paths = self.tc_kwargs['init']['config_paths'] | 344 | config_paths = self.tc_kwargs['init']['config_paths'] |
372 | if os.path.exists(config_paths['localconf_backup']): | ||
373 | copyfile(config_paths['localconf_backup'], | ||
374 | config_paths['localconf']) | ||
375 | os.remove(config_paths['localconf_backup']) | ||
376 | |||
377 | if os.path.exists(config_paths['bblayers_backup']): | ||
378 | copyfile(config_paths['bblayers_backup'], | ||
379 | config_paths['bblayers']) | ||
380 | os.remove(config_paths['bblayers_backup']) | ||
381 | |||
382 | if os.path.exists(config_paths['localconf_class_backup']): | ||
383 | os.remove(config_paths['localconf_class_backup']) | ||
384 | if os.path.exists(config_paths['bblayers_class_backup']): | ||
385 | os.remove(config_paths['bblayers_class_backup']) | ||
386 | 345 | ||
387 | output_link = os.path.join(os.path.dirname(args.output_log), | 346 | output_link = os.path.join(os.path.dirname(args.output_log), |
388 | "%s-results.log" % self.name) | 347 | "%s-results.log" % self.name) |