summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/case.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/case.py')
-rw-r--r--meta/lib/oeqa/selftest/case.py30
1 files changed, 1 insertions, 29 deletions
diff --git a/meta/lib/oeqa/selftest/case.py b/meta/lib/oeqa/selftest/case.py
index ac3308d8a4..dcad4f76ec 100644
--- a/meta/lib/oeqa/selftest/case.py
+++ b/meta/lib/oeqa/selftest/case.py
@@ -6,7 +6,6 @@
6 6
7import sys 7import sys
8import os 8import os
9import shutil
10import glob 9import glob
11import errno 10import errno
12from unittest.util import safe_repr 11from unittest.util import safe_repr
@@ -30,9 +29,7 @@ class OESelftestTestCase(OETestCase):
30 cls.builddir = cls.tc.config_paths['builddir'] 29 cls.builddir = cls.tc.config_paths['builddir']
31 30
32 cls.localconf_path = cls.tc.config_paths['localconf'] 31 cls.localconf_path = cls.tc.config_paths['localconf']
33 cls.localconf_backup = cls.tc.config_paths['localconf_class_backup']
34 cls.local_bblayers_path = cls.tc.config_paths['bblayers'] 32 cls.local_bblayers_path = cls.tc.config_paths['bblayers']
35 cls.local_bblayers_backup = cls.tc.config_paths['bblayers_class_backup']
36 33
37 cls.testinc_path = os.path.join(cls.tc.config_paths['builddir'], 34 cls.testinc_path = os.path.join(cls.tc.config_paths['builddir'],
38 "conf/selftest.inc") 35 "conf/selftest.inc")
@@ -43,8 +40,7 @@ class OESelftestTestCase(OETestCase):
43 40
44 cls._track_for_cleanup = [ 41 cls._track_for_cleanup = [
45 cls.testinc_path, cls.testinc_bblayers_path, 42 cls.testinc_path, cls.testinc_bblayers_path,
46 cls.machineinc_path, cls.localconf_backup, 43 cls.machineinc_path]
47 cls.local_bblayers_backup]
48 44
49 cls.add_include() 45 cls.add_include()
50 46
@@ -102,30 +98,6 @@ class OESelftestTestCase(OETestCase):
102 def setUp(self): 98 def setUp(self):
103 super(OESelftestTestCase, self).setUp() 99 super(OESelftestTestCase, self).setUp()
104 os.chdir(self.builddir) 100 os.chdir(self.builddir)
105 # Check if local.conf or bblayers.conf files backup exists
106 # from a previous failed test and restore them
107 if os.path.isfile(self.localconf_backup) or os.path.isfile(
108 self.local_bblayers_backup):
109 self.logger.debug("\
110Found a local.conf and/or bblayers.conf backup from a previously aborted test.\
111Restoring these files now, but tests should be re-executed from a clean environment\
112to ensure accurate results.")
113 try:
114 shutil.copyfile(self.localconf_backup, self.localconf_path)
115 except OSError as e:
116 if e.errno != errno.ENOENT:
117 raise
118 try:
119 shutil.copyfile(self.local_bblayers_backup,
120 self.local_bblayers_path)
121 except OSError as e:
122 if e.errno != errno.ENOENT:
123 raise
124 else:
125 # backup local.conf and bblayers.conf
126 shutil.copyfile(self.localconf_path, self.localconf_backup)
127 shutil.copyfile(self.local_bblayers_path, self.local_bblayers_backup)
128 self.logger.debug("Creating local.conf and bblayers.conf backups.")
129 # we don't know what the previous test left around in config or inc files 101 # we don't know what the previous test left around in config or inc files
130 # if it failed so we need a fresh start 102 # if it failed so we need a fresh start
131 try: 103 try: