Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] oe-selftest: New object SStateBase cut off from SStateTests.
@ 2014-01-14 13:21 Corneliu Stoicescu
  2014-01-14 13:21 ` [PATCH 2/3] oe-selftest: renamed sstate.py module to sstatetests.py Corneliu Stoicescu
  2014-01-14 13:21 ` [PATCH 3/3] oe-selftest: separated the SStateBase and SStateTests in different modules Corneliu Stoicescu
  0 siblings, 2 replies; 3+ messages in thread
From: Corneliu Stoicescu @ 2014-01-14 13:21 UTC (permalink / raw)
  To: openembedded-core

- SStateBase object contains basic methods used to run sstate related tests
- SStateTests now contains only sstate-related tests

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
---
 meta/lib/oeqa/selftest/sstate.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/sstate.py b/meta/lib/oeqa/selftest/sstate.py
index 98c1426..a0489fe 100644
--- a/meta/lib/oeqa/selftest/sstate.py
+++ b/meta/lib/oeqa/selftest/sstate.py
@@ -8,7 +8,7 @@ import oeqa.utils.ftools as ftools
 from oeqa.selftest.base import oeSelfTest
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
 
-class SStateTests(oeSelfTest):
+class SStateBase(oeSelfTest):
 
     def setUpLocal(self):
         self.temp_sstate_location = None
@@ -51,6 +51,7 @@ class SStateTests(oeSelfTest):
                         result.append(f)
         return result
 
+class SStateTests(SStateBase):
 
     # Test sstate files creation and their location
     def run_test_sstate_creation(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True, should_pass=True):
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] oe-selftest: renamed sstate.py module to sstatetests.py
  2014-01-14 13:21 [PATCH 1/3] oe-selftest: New object SStateBase cut off from SStateTests Corneliu Stoicescu
@ 2014-01-14 13:21 ` Corneliu Stoicescu
  2014-01-14 13:21 ` [PATCH 3/3] oe-selftest: separated the SStateBase and SStateTests in different modules Corneliu Stoicescu
  1 sibling, 0 replies; 3+ messages in thread
From: Corneliu Stoicescu @ 2014-01-14 13:21 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
---
 .../oeqa/selftest/{sstate.py => sstatetests.py}    |    0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename meta/lib/oeqa/selftest/{sstate.py => sstatetests.py} (100%)

diff --git a/meta/lib/oeqa/selftest/sstate.py b/meta/lib/oeqa/selftest/sstatetests.py
similarity index 100%
rename from meta/lib/oeqa/selftest/sstate.py
rename to meta/lib/oeqa/selftest/sstatetests.py
-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3/3] oe-selftest: separated the SStateBase and SStateTests in different modules
  2014-01-14 13:21 [PATCH 1/3] oe-selftest: New object SStateBase cut off from SStateTests Corneliu Stoicescu
  2014-01-14 13:21 ` [PATCH 2/3] oe-selftest: renamed sstate.py module to sstatetests.py Corneliu Stoicescu
@ 2014-01-14 13:21 ` Corneliu Stoicescu
  1 sibling, 0 replies; 3+ messages in thread
From: Corneliu Stoicescu @ 2014-01-14 13:21 UTC (permalink / raw)
  To: openembedded-core

- SStateBase now has its own module to be imported by itself by other modules like sstatetests.py

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
---
 meta/lib/oeqa/selftest/sstate.py      |   53 +++++++++++++++++++++++++++++++++
 meta/lib/oeqa/selftest/sstatetests.py |   43 +-------------------------
 2 files changed, 54 insertions(+), 42 deletions(-)
 create mode 100644 meta/lib/oeqa/selftest/sstate.py

diff --git a/meta/lib/oeqa/selftest/sstate.py b/meta/lib/oeqa/selftest/sstate.py
new file mode 100644
index 0000000..5989724
--- /dev/null
+++ b/meta/lib/oeqa/selftest/sstate.py
@@ -0,0 +1,53 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+
+
+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)
+
+    # Creates a special sstate configuration with the option to add sstate mirrors
+    def config_sstate(self, temp_sstate_location=False, add_local_mirrors=[]):
+        self.temp_sstate_location = temp_sstate_location
+
+        if self.temp_sstate_location:
+            temp_sstate_path = os.path.join(self.builddir, "temp_sstate_%s" % datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
+            config_temp_sstate = "SSTATE_DIR = \"%s\"" % temp_sstate_path
+            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)
+
+        if add_local_mirrors:
+            config_set_sstate_if_not_set = 'SSTATE_MIRRORS ?= ""'
+            self.append_config(config_set_sstate_if_not_set)
+            for local_mirror in add_local_mirrors:
+                self.assertFalse(os.path.join(local_mirror) == os.path.join(self.sstate_path), msg='Cannot add the current sstate path as a sstate mirror')
+                config_sstate_mirror = "SSTATE_MIRRORS += \"file://.* file:///%s/PATH\"" % local_mirror
+                self.append_config(config_sstate_mirror)
+
+    # Returns a list containing sstate files
+    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):
+                for f in files:
+                    if re.search(filename_regex, f):
+                        result.append(f)
+            if distro_nonspecific and re.search("%s/[a-z0-9]{2}$" % self.sstate_path, root):
+                for f in files:
+                    if re.search(filename_regex, f):
+                        result.append(f)
+        return result
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index a0489fe..4b2c26d 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -7,49 +7,8 @@ import shutil
 import oeqa.utils.ftools as ftools
 from oeqa.selftest.base import oeSelfTest
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.selftest.sstate import SStateBase
 
-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)
-
-    # Creates a special sstate configuration with the option to add sstate mirrors
-    def config_sstate(self, temp_sstate_location=False, add_local_mirrors=[]):
-        self.temp_sstate_location = temp_sstate_location
-
-        if self.temp_sstate_location:
-            temp_sstate_path = os.path.join(self.builddir, "temp_sstate_%s" % datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
-            config_temp_sstate = "SSTATE_DIR = \"%s\"" % temp_sstate_path
-            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)
-
-        if add_local_mirrors:
-            config_set_sstate_if_not_set = 'SSTATE_MIRRORS ?= ""'
-            self.append_config(config_set_sstate_if_not_set)
-            for local_mirror in add_local_mirrors:
-                self.assertFalse(os.path.join(local_mirror) == os.path.join(self.sstate_path), msg='Cannot add the current sstate path as a sstate mirror')
-                config_sstate_mirror = "SSTATE_MIRRORS += \"file://.* file:///%s/PATH\"" % local_mirror
-                self.append_config(config_sstate_mirror)
-
-    # Returns a list containing sstate files
-    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):
-                for f in files:
-                    if re.search(filename_regex, f):
-                        result.append(f)
-            if distro_nonspecific and re.search("%s/[a-z0-9]{2}$" % self.sstate_path, root):
-                for f in files:
-                    if re.search(filename_regex, f):
-                        result.append(f)
-        return result
 
 class SStateTests(SStateBase):
 
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-14 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 13:21 [PATCH 1/3] oe-selftest: New object SStateBase cut off from SStateTests Corneliu Stoicescu
2014-01-14 13:21 ` [PATCH 2/3] oe-selftest: renamed sstate.py module to sstatetests.py Corneliu Stoicescu
2014-01-14 13:21 ` [PATCH 3/3] oe-selftest: separated the SStateBase and SStateTests in different modules Corneliu Stoicescu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox