diff options
author | Corneliu Stoicescu <corneliux.stoicescu@intel.com> | 2014-01-14 14:21:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-16 12:18:52 +0000 |
commit | cfd1520b4b492ab27b2900ba3510abe6f288097e (patch) | |
tree | 66b2cb3af6b404cf83ecb18fa73ac24d76d2dd94 /meta/lib/oeqa/selftest/sstatetests.py | |
parent | 9229f253224c9003a530941ccd97fdc41702b748 (diff) | |
download | poky-cfd1520b4b492ab27b2900ba3510abe6f288097e.tar.gz |
oe-selftest: separated the SStateBase and SStateTests in different modules
- SStateBase now has its own module to be imported by itself by other modules like sstatetests.py
(From OE-Core rev: 8163854adf87ac42a8f08ee25685d0ce1efb4724)
Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/sstatetests.py')
-rw-r--r-- | meta/lib/oeqa/selftest/sstatetests.py | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py index a0489fe4f1..4b2c26d0c1 100644 --- a/meta/lib/oeqa/selftest/sstatetests.py +++ b/meta/lib/oeqa/selftest/sstatetests.py | |||
@@ -7,49 +7,8 @@ import shutil | |||
7 | import oeqa.utils.ftools as ftools | 7 | import oeqa.utils.ftools as ftools |
8 | from oeqa.selftest.base import oeSelfTest | 8 | from oeqa.selftest.base import oeSelfTest |
9 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer | 9 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer |
10 | from oeqa.selftest.sstate import SStateBase | ||
10 | 11 | ||
11 | class SStateBase(oeSelfTest): | ||
12 | |||
13 | def setUpLocal(self): | ||
14 | self.temp_sstate_location = None | ||
15 | self.sstate_path = get_bb_var('SSTATE_DIR') | ||
16 | self.distro = get_bb_var('NATIVELSBSTRING') | ||
17 | self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro) | ||
18 | |||
19 | # Creates a special sstate configuration with the option to add sstate mirrors | ||
20 | def config_sstate(self, temp_sstate_location=False, add_local_mirrors=[]): | ||
21 | self.temp_sstate_location = temp_sstate_location | ||
22 | |||
23 | if self.temp_sstate_location: | ||
24 | temp_sstate_path = os.path.join(self.builddir, "temp_sstate_%s" % datetime.datetime.now().strftime('%Y%m%d%H%M%S')) | ||
25 | config_temp_sstate = "SSTATE_DIR = \"%s\"" % temp_sstate_path | ||
26 | self.append_config(config_temp_sstate) | ||
27 | self.track_for_cleanup(temp_sstate_path) | ||
28 | self.sstate_path = get_bb_var('SSTATE_DIR') | ||
29 | self.distro = get_bb_var('NATIVELSBSTRING') | ||
30 | self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro) | ||
31 | |||
32 | if add_local_mirrors: | ||
33 | config_set_sstate_if_not_set = 'SSTATE_MIRRORS ?= ""' | ||
34 | self.append_config(config_set_sstate_if_not_set) | ||
35 | for local_mirror in add_local_mirrors: | ||
36 | self.assertFalse(os.path.join(local_mirror) == os.path.join(self.sstate_path), msg='Cannot add the current sstate path as a sstate mirror') | ||
37 | config_sstate_mirror = "SSTATE_MIRRORS += \"file://.* file:///%s/PATH\"" % local_mirror | ||
38 | self.append_config(config_sstate_mirror) | ||
39 | |||
40 | # Returns a list containing sstate files | ||
41 | def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True): | ||
42 | result = [] | ||
43 | for root, dirs, files in os.walk(self.sstate_path): | ||
44 | if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.distro, root): | ||
45 | for f in files: | ||
46 | if re.search(filename_regex, f): | ||
47 | result.append(f) | ||
48 | if distro_nonspecific and re.search("%s/[a-z0-9]{2}$" % self.sstate_path, root): | ||
49 | for f in files: | ||
50 | if re.search(filename_regex, f): | ||
51 | result.append(f) | ||
52 | return result | ||
53 | 12 | ||
54 | class SStateTests(SStateBase): | 13 | class SStateTests(SStateBase): |
55 | 14 | ||