From d8eb9d41b0afb48f98dc59383cf886c8ca53c21a Mon Sep 17 00:00:00 2001 From: Lucian Musat Date: Tue, 15 Sep 2015 18:11:59 +0300 Subject: oeqa/decorators: Added decorator to restart the DUT in case of test hang. Once the DUT is hanged during testing, currently all the following test cases have to wait for default timeout to exit. Using this decorator the user can choose a timeout at case by case basis and what happens when the timeout is reached by overwriting the self.target.restart method. [YOCTO #7853] (From OE-Core rev: ce9a7501ea29ddba61ef7c297223b3f7eca5a2a1) Signed-off-by: Lucian Musat Signed-off-by: Richard Purdie --- meta/lib/oeqa/oetest.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'meta/lib/oeqa/oetest.py') diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py index 0fe68d4d52..a6f89b6a86 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py @@ -151,6 +151,12 @@ class oeRuntimeTest(oeTest): elif (type(self.target).__name__ == "QemuTarget"): self.assertTrue(self.target.check(), msg = "Qemu not running?") + self.setUpLocal() + + # a setup method before tests but after the class instantiation + def setUpLocal(self): + pass + def tearDown(self): # If a test fails or there is an exception if not exc_info() == (None, None, None): -- cgit v1.2.3-54-g00ecf