mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-05 05:04:44 +02:00
oeqa/sstatetests: Fix NATIVELSBSTRING handling
The NATIVELSBSTRING variable changes value once a BuildStarted event occurs in a build directory. This meant running some of the tests directly in a fresh build directory would fail but they'd pass when run as a group of tests. This is clearly suboptimal. Move the NATIVELSBSTRING handling to a location where the value is consistent and a comment about the interesting behaviour of the variable so it hopefully doesn't catch out others in future. (From OE-Core rev: e1c46fdb44fed18909d9ff4b43b4e445c5a22d33) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
ba290e7ec8
commit
6e32bd92ef
|
@ -27,17 +27,15 @@ class SStateBase(OESelftestTestCase):
|
|||
def setUpLocal(self):
|
||||
super(SStateBase, self).setUpLocal()
|
||||
self.temp_sstate_location = None
|
||||
needed_vars = ['SSTATE_DIR', 'NATIVELSBSTRING', 'TCLIBC', 'TUNE_ARCH',
|
||||
needed_vars = ['SSTATE_DIR', 'TCLIBC', 'TUNE_ARCH',
|
||||
'TOPDIR', 'TARGET_VENDOR', 'TARGET_OS']
|
||||
bb_vars = get_bb_vars(needed_vars)
|
||||
self.sstate_path = bb_vars['SSTATE_DIR']
|
||||
self.hostdistro = bb_vars['NATIVELSBSTRING']
|
||||
self.tclibc = bb_vars['TCLIBC']
|
||||
self.tune_arch = bb_vars['TUNE_ARCH']
|
||||
self.topdir = bb_vars['TOPDIR']
|
||||
self.target_vendor = bb_vars['TARGET_VENDOR']
|
||||
self.target_os = bb_vars['TARGET_OS']
|
||||
self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
|
||||
|
||||
def track_for_cleanup(self, path):
|
||||
if not keep_temp_files:
|
||||
|
@ -52,10 +50,7 @@ class SStateBase(OESelftestTestCase):
|
|||
config_temp_sstate = "SSTATE_DIR = \"%s\"" % temp_sstate_path
|
||||
self.append_config(config_temp_sstate)
|
||||
self.track_for_cleanup(temp_sstate_path)
|
||||
bb_vars = get_bb_vars(['SSTATE_DIR', 'NATIVELSBSTRING'])
|
||||
self.sstate_path = bb_vars['SSTATE_DIR']
|
||||
self.hostdistro = bb_vars['NATIVELSBSTRING']
|
||||
self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
|
||||
self.sstate_path = get_bb_var('SSTATE_DIR')
|
||||
|
||||
if add_local_mirrors:
|
||||
config_set_sstate_if_not_set = 'SSTATE_MIRRORS ?= ""'
|
||||
|
@ -65,8 +60,16 @@ class SStateBase(OESelftestTestCase):
|
|||
config_sstate_mirror = "SSTATE_MIRRORS += \"file://.* file:///%s/PATH\"" % local_mirror
|
||||
self.append_config(config_sstate_mirror)
|
||||
|
||||
def set_hostdistro(self):
|
||||
# This needs to be read after a BuildStarted event in case it gets changed by event
|
||||
# handling in uninative.bbclass
|
||||
self.hostdistro = get_bb_var('NATIVELSBSTRING')
|
||||
self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
|
||||
|
||||
# Returns a list containing sstate files
|
||||
def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True):
|
||||
self.set_hostdistro()
|
||||
|
||||
result = []
|
||||
for root, dirs, files in os.walk(self.sstate_path):
|
||||
if distro_specific and re.search(r"%s/%s/[a-z0-9]{2}/[a-z0-9]{2}$" % (self.sstate_path, self.hostdistro), root):
|
||||
|
@ -153,6 +156,8 @@ class SStateBase(OESelftestTestCase):
|
|||
|
||||
bitbake(['-ccleansstate'] + targets)
|
||||
|
||||
self.set_hostdistro()
|
||||
|
||||
bitbake(targets)
|
||||
results = self.search_sstate('|'.join(map(str, [s + r'.*?\.tar.zst$' for s in targets])), distro_specific=False, distro_nonspecific=True)
|
||||
filtered_results = []
|
||||
|
|
Loading…
Reference in New Issue
Block a user