Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix setUp and tearDown for runtime tests
@ 2015-10-15  6:29 mariano.lopez
  2015-10-15  6:29 ` [PATCH 1/2] oetest: Add tearDownLocal class mariano.lopez
  2015-10-15  6:29 ` [PATCH 2/2] oeqa/runtime: Fix setUp and tearDown methods mariano.lopez
  0 siblings, 2 replies; 3+ messages in thread
From: mariano.lopez @ 2015-10-15  6:29 UTC (permalink / raw)
  To: openembedded-core

From: Mariano Lopez <mariano.lopez@linux.intel.com>

Some runtime tests will overwrite the setUp and tearDown methods
and this will cause the parent's method to not run at all. These
changes will fix the setUp and tearDown methods for the child classes.
 
The following changes since commit d302c98822efe2cb78a63b620aed1b94b4ed4a68:

  bitbake: toaster: Fix missing tooltips from layers on project configuration page (2015-10-13 15:35:49 +0300)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib mariano/bug8465
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=mariano/bug8465

Mariano Lopez (2):
  oetest: Add tearDownLocal class
  oeqa/runtime: Fix setUp and tearDown methods

 meta/lib/oeqa/oetest.py               | 6 ++++++
 meta/lib/oeqa/runtime/_ptest.py       | 2 +-
 meta/lib/oeqa/runtime/date.py         | 4 ++--
 meta/lib/oeqa/runtime/kernelmodule.py | 4 ++--
 meta/lib/oeqa/runtime/scanelf.py      | 2 +-
 5 files changed, 12 insertions(+), 6 deletions(-)

-- 
1.8.4.5



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

* [PATCH 1/2] oetest: Add tearDownLocal class
  2015-10-15  6:29 [PATCH 0/2] Fix setUp and tearDown for runtime tests mariano.lopez
@ 2015-10-15  6:29 ` mariano.lopez
  2015-10-15  6:29 ` [PATCH 2/2] oeqa/runtime: Fix setUp and tearDown methods mariano.lopez
  1 sibling, 0 replies; 3+ messages in thread
From: mariano.lopez @ 2015-10-15  6:29 UTC (permalink / raw)
  To: openembedded-core

From: Mariano Lopez <mariano.lopez@linux.intel.com>

In the current state there are some runtime test that
don't run the tearDown method fromm oeRuntimeTest class
because the tearDown class is overwritten in the child
class.

This change adds tearDownLocal method in oeRuntimeTest
class that will run after tearDown. This method can be
overwritten in the child classes to implement specific
test functionality.

[YOCTO #8465]

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
---
 meta/lib/oeqa/oetest.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index e3bbc46..6f9edec 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -196,6 +196,12 @@ class oeRuntimeTest(oeTest):
             print ("%s dump data stored in %s" % (self._testMethodName,
                      self.tc.host_dumper.dump_dir))
 
+        self.tearDownLocal()
+
+    # Method to be run after tearDown and implemented by child classes
+    def tearDownLocal(self):
+        pass
+
     #TODO: use package_manager.py to install packages on any type of image
     def install_packages(self, packagelist):
         for package in packagelist:
-- 
1.8.4.5



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

* [PATCH 2/2] oeqa/runtime: Fix setUp and tearDown methods
  2015-10-15  6:29 [PATCH 0/2] Fix setUp and tearDown for runtime tests mariano.lopez
  2015-10-15  6:29 ` [PATCH 1/2] oetest: Add tearDownLocal class mariano.lopez
@ 2015-10-15  6:29 ` mariano.lopez
  1 sibling, 0 replies; 3+ messages in thread
From: mariano.lopez @ 2015-10-15  6:29 UTC (permalink / raw)
  To: openembedded-core

From: Mariano Lopez <mariano.lopez@linux.intel.com>

Currently some of the runtime test overwrites
the setUp and tearDown methods provided by
oeRuntimeTest, this will avoid some checks
required when running the test suit.

This patch changes the setUp and tearDown methods
for their local counterparts, so when these
tests are called, it will run the parent setUp
and tearDown and also the local ones.

[YOCTO #8465]

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
---
 meta/lib/oeqa/runtime/_ptest.py       | 2 +-
 meta/lib/oeqa/runtime/date.py         | 4 ++--
 meta/lib/oeqa/runtime/kernelmodule.py | 4 ++--
 meta/lib/oeqa/runtime/scanelf.py      | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/lib/oeqa/runtime/_ptest.py b/meta/lib/oeqa/runtime/_ptest.py
index 81c9c43..0621028 100644
--- a/meta/lib/oeqa/runtime/_ptest.py
+++ b/meta/lib/oeqa/runtime/_ptest.py
@@ -98,7 +98,7 @@ class PtestRunnerTest(oeRuntimeTest):
 
         return complementary_pkgs.split()
 
-    def setUp(self):
+    def setUpLocal(self):
         self.ptest_log = os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR",True), "ptest-%s.log" % oeRuntimeTest.tc.d.getVar('DATETIME', True))
 
     @skipUnlessPassed('test_ssh')
diff --git a/meta/lib/oeqa/runtime/date.py b/meta/lib/oeqa/runtime/date.py
index 3a8fe84..447987e 100644
--- a/meta/lib/oeqa/runtime/date.py
+++ b/meta/lib/oeqa/runtime/date.py
@@ -4,11 +4,11 @@ import re
 
 class DateTest(oeRuntimeTest):
 
-    def setUp(self):
+    def setUpLocal(self):
         if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
             self.target.run('systemctl stop systemd-timesyncd')
 
-    def tearDown(self):
+    def tearDownLocal(self):
         if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
             self.target.run('systemctl start systemd-timesyncd')
 
diff --git a/meta/lib/oeqa/runtime/kernelmodule.py b/meta/lib/oeqa/runtime/kernelmodule.py
index 2e81720..38ca184 100644
--- a/meta/lib/oeqa/runtime/kernelmodule.py
+++ b/meta/lib/oeqa/runtime/kernelmodule.py
@@ -10,7 +10,7 @@ def setUpModule():
 
 class KernelModuleTest(oeRuntimeTest):
 
-    def setUp(self):
+    def setUpLocal(self):
         self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod.c"), "/tmp/hellomod.c")
         self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod_makefile"), "/tmp/Makefile")
 
@@ -30,5 +30,5 @@ class KernelModuleTest(oeRuntimeTest):
             (status, output) = self.target.run(cmd, 900)
             self.assertEqual(status, 0, msg="\n".join([cmd, output]))
 
-    def tearDown(self):
+    def tearDownLocal(self):
         self.target.run('rm -f /tmp/Makefile /tmp/hellomod.c')
diff --git a/meta/lib/oeqa/runtime/scanelf.py b/meta/lib/oeqa/runtime/scanelf.py
index 43a024a..67e02ff 100644
--- a/meta/lib/oeqa/runtime/scanelf.py
+++ b/meta/lib/oeqa/runtime/scanelf.py
@@ -8,7 +8,7 @@ def setUpModule():
 
 class ScanelfTest(oeRuntimeTest):
 
-    def setUp(self):
+    def setUpLocal(self):
         self.scancmd = 'scanelf --quiet --recursive --mount --ldpath --path'
 
     @testcase(966)
-- 
1.8.4.5



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

end of thread, other threads:[~2015-10-15 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15  6:29 [PATCH 0/2] Fix setUp and tearDown for runtime tests mariano.lopez
2015-10-15  6:29 ` [PATCH 1/2] oetest: Add tearDownLocal class mariano.lopez
2015-10-15  6:29 ` [PATCH 2/2] oeqa/runtime: Fix setUp and tearDown methods mariano.lopez

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