summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/tests/cases
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-11-09 11:26:59 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:18 +0000
commit7bf63b28f1dee0b582769879c1727c5a1171c2b1 (patch)
tree991a4907c63df8c43199fd749546234e0c150839 /meta/lib/oeqa/core/tests/cases
parent4da4091cee20fd425addccd0d267a5b40f1ab8cd (diff)
downloadpoky-7bf63b28f1dee0b582769879c1727c5a1171c2b1.tar.gz
oeqa/core: Add tests for the OEQA framework
This test suite covers the current functionality for the OEQA framework. For run certain test suite, $ cd meta/lib/oeqa/core/tests $ ./test_data.py (From OE-Core rev: 7d7d0dc3736fc12ae7848de2785f0066e6470cd1) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/tests/cases')
-rw-r--r--meta/lib/oeqa/core/tests/cases/data.py20
-rw-r--r--meta/lib/oeqa/core/tests/cases/depends.py38
-rw-r--r--meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py15
-rw-r--r--meta/lib/oeqa/core/tests/cases/loader/valid/another.py9
-rw-r--r--meta/lib/oeqa/core/tests/cases/oeid.py18
-rw-r--r--meta/lib/oeqa/core/tests/cases/oetag.py18
-rw-r--r--meta/lib/oeqa/core/tests/cases/timeout.py18
7 files changed, 136 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/tests/cases/data.py b/meta/lib/oeqa/core/tests/cases/data.py
new file mode 100644
index 0000000000..88003a6adc
--- /dev/null
+++ b/meta/lib/oeqa/core/tests/cases/data.py
@@ -0,0 +1,20 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5from oeqa.core.decorator.oetag import OETestTag
6from oeqa.core.decorator.data import OETestDataDepends
7
8class DataTest(OETestCase):
9 data_vars = ['IMAGE', 'ARCH']
10
11 @OETestDataDepends(['MACHINE',])
12 @OETestTag('dataTestOk')
13 def testDataOk(self):
14 self.assertEqual(self.td.get('IMAGE'), 'core-image-minimal')
15 self.assertEqual(self.td.get('ARCH'), 'x86')
16 self.assertEqual(self.td.get('MACHINE'), 'qemuarm')
17
18 @OETestTag('dataTestFail')
19 def testDataFail(self):
20 pass
diff --git a/meta/lib/oeqa/core/tests/cases/depends.py b/meta/lib/oeqa/core/tests/cases/depends.py
new file mode 100644
index 0000000000..17cdd90b15
--- /dev/null
+++ b/meta/lib/oeqa/core/tests/cases/depends.py
@@ -0,0 +1,38 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5from oeqa.core.decorator.depends import OETestDepends
6
7class DependsTest(OETestCase):
8
9 def testDependsFirst(self):
10 self.assertTrue(True, msg='How is this possible?')
11
12 @OETestDepends(['testDependsFirst'])
13 def testDependsSecond(self):
14 self.assertTrue(True, msg='How is this possible?')
15
16 @OETestDepends(['testDependsSecond'])
17 def testDependsThird(self):
18 self.assertTrue(True, msg='How is this possible?')
19
20 @OETestDepends(['testDependsSecond'])
21 def testDependsFourth(self):
22 self.assertTrue(True, msg='How is this possible?')
23
24 @OETestDepends(['testDependsThird', 'testDependsFourth'])
25 def testDependsFifth(self):
26 self.assertTrue(True, msg='How is this possible?')
27
28 @OETestDepends(['testDependsCircular3'])
29 def testDependsCircular1(self):
30 self.assertTrue(True, msg='How is this possible?')
31
32 @OETestDepends(['testDependsCircular1'])
33 def testDependsCircular2(self):
34 self.assertTrue(True, msg='How is this possible?')
35
36 @OETestDepends(['testDependsCircular2'])
37 def testDependsCircular3(self):
38 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py b/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py
new file mode 100644
index 0000000000..038d445931
--- /dev/null
+++ b/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py
@@ -0,0 +1,15 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5
6class AnotherIDTest(OETestCase):
7
8 def testAnotherIdGood(self):
9 self.assertTrue(True, msg='How is this possible?')
10
11 def testAnotherIdOther(self):
12 self.assertTrue(True, msg='How is this possible?')
13
14 def testAnotherIdNone(self):
15 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/loader/valid/another.py b/meta/lib/oeqa/core/tests/cases/loader/valid/another.py
new file mode 100644
index 0000000000..c9ffd17773
--- /dev/null
+++ b/meta/lib/oeqa/core/tests/cases/loader/valid/another.py
@@ -0,0 +1,9 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5
6class AnotherTest(OETestCase):
7
8 def testAnother(self):
9 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/oeid.py b/meta/lib/oeqa/core/tests/cases/oeid.py
new file mode 100644
index 0000000000..c2d3d32f2d
--- /dev/null
+++ b/meta/lib/oeqa/core/tests/cases/oeid.py
@@ -0,0 +1,18 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5from oeqa.core.decorator.oeid import OETestID
6
7class IDTest(OETestCase):
8
9 @OETestID(101)
10 def testIdGood(self):
11 self.assertTrue(True, msg='How is this possible?')
12
13 @OETestID(102)
14 def testIdOther(self):
15 self.assertTrue(True, msg='How is this possible?')
16
17 def testIdNone(self):
18 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/oetag.py b/meta/lib/oeqa/core/tests/cases/oetag.py
new file mode 100644
index 0000000000..0cae02e75c
--- /dev/null
+++ b/meta/lib/oeqa/core/tests/cases/oetag.py
@@ -0,0 +1,18 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5from oeqa.core.decorator.oetag import OETestTag
6
7class TagTest(OETestCase):
8
9 @OETestTag('goodTag')
10 def testTagGood(self):
11 self.assertTrue(True, msg='How is this possible?')
12
13 @OETestTag('otherTag')
14 def testTagOther(self):
15 self.assertTrue(True, msg='How is this possible?')
16
17 def testTagNone(self):
18 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/timeout.py b/meta/lib/oeqa/core/tests/cases/timeout.py
new file mode 100644
index 0000000000..870c3157f7
--- /dev/null
+++ b/meta/lib/oeqa/core/tests/cases/timeout.py
@@ -0,0 +1,18 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from time import sleep
5
6from oeqa.core.case import OETestCase
7from oeqa.core.decorator.oetimeout import OETimeout
8
9class TimeoutTest(OETestCase):
10
11 @OETimeout(1)
12 def testTimeoutPass(self):
13 self.assertTrue(True, msg='How is this possible?')
14
15 @OETimeout(1)
16 def testTimeoutFail(self):
17 sleep(2)
18 self.assertTrue(True, msg='How is this possible?')