[gnome-continuous-yocto/gnomeostree-3.28-rocko: 3759/8267] selftest: base: new object member to store the DISTRO value



commit 009adf73fa8e300dd8807506352162f4c234639a
Author: Leonardo Sandoval <leonardo sandoval gonzalez linux intel com>
Date:   Fri Nov 18 11:27:19 2016 -0600

    selftest: base: new object member to store the DISTRO value
    
    Instead of quering it multiple times, query once and use it on
    test method skip checks. Also, rename current distro sstate object
    member to a more meaninful name.
    
    (From OE-Core rev: bde9d99575a63ad2d7fd5974ce6ce19aad9a8984)
    
    Signed-off-by: Leonardo Sandoval <leonardo sandoval gonzalez linux intel com>
    Signed-off-by: Ross Burton <ross burton intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 meta/lib/oeqa/selftest/base.py   |    1 +
 meta/lib/oeqa/selftest/sstate.py |   10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py
index 26c93f9..b477db3 100644
--- a/meta/lib/oeqa/selftest/base.py
+++ b/meta/lib/oeqa/selftest/base.py
@@ -41,6 +41,7 @@ class oeSelfTest(unittest.TestCase):
             self.testinc_path, self.testinc_bblayers_path,
             self.machineinc_path, self.localconf_backup,
             self.local_bblayers_backup]
+        self.distro = get_bb_var('DISTRO')
         super(oeSelfTest, self).__init__(methodName)
 
     def setUp(self):
diff --git a/meta/lib/oeqa/selftest/sstate.py b/meta/lib/oeqa/selftest/sstate.py
index 5989724..d27a45c 100644
--- a/meta/lib/oeqa/selftest/sstate.py
+++ b/meta/lib/oeqa/selftest/sstate.py
@@ -14,8 +14,8 @@ class SStateBase(oeSelfTest):
     def setUpLocal(self):
         self.temp_sstate_location = None
         self.sstate_path = get_bb_var('SSTATE_DIR')
-        self.distro = get_bb_var('NATIVELSBSTRING')
-        self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro)
+        self.hostdistro = get_bb_var('NATIVELSBSTRING')
+        self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
 
     # Creates a special sstate configuration with the option to add sstate mirrors
     def config_sstate(self, temp_sstate_location=False, add_local_mirrors=[]):
@@ -27,8 +27,8 @@ class SStateBase(oeSelfTest):
             self.append_config(config_temp_sstate)
             self.track_for_cleanup(temp_sstate_path)
         self.sstate_path = get_bb_var('SSTATE_DIR')
-        self.distro = get_bb_var('NATIVELSBSTRING')
-        self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro)
+        self.hostdistro = get_bb_var('NATIVELSBSTRING')
+        self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
 
         if add_local_mirrors:
             config_set_sstate_if_not_set = 'SSTATE_MIRRORS ?= ""'
@@ -42,7 +42,7 @@ class SStateBase(oeSelfTest):
     def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True):
         result = []
         for root, dirs, files in os.walk(self.sstate_path):
-            if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.distro, root):
+            if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.hostdistro, root):
                 for f in files:
                     if re.search(filename_regex, f):
                         result.append(f)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]