summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorJose Perez Carranza <jose.perez.carranza@linux.intel.com>2017-09-01 13:30:24 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-11 17:30:28 +0100
commit1d5d4165a5bc257650a4c136dfa4a58ade3e404e (patch)
treedbaa78002561ec127e8615988fcf9d35c51acca8 /meta/lib/oeqa
parent3c492afe4f3c8d1cf7e1fef0e83a71dd1557c62e (diff)
downloadpoky-1d5d4165a5bc257650a4c136dfa4a58ade3e404e.tar.gz
oeqa/selftest: Add missing IDs to various test cases
Add decorator @OETestID() with Tesopia TC-ID to the test cases that did not have it properly set. [YOCTO #11873] (From OE-Core rev: aa5b9edbd9c4495befe1912a5b401b536be39d5b) Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/archiver.py3
-rw-r--r--meta/lib/oeqa/selftest/cases/distrodata.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/imagefeatures.py3
-rw-r--r--meta/lib/oeqa/selftest/cases/runcmd.py17
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py1
5 files changed, 25 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py
index 72026d573c..f61a522017 100644
--- a/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -40,7 +40,7 @@ class Archiver(OESelftestTestCase):
40 excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe)) 40 excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe))
41 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe) 41 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe)
42 42
43 43 @OETestID(1900)
44 def test_archiver_filters_by_type(self): 44 def test_archiver_filters_by_type(self):
45 """ 45 """
46 Summary: The archiver is documented to filter on the recipe type. 46 Summary: The archiver is documented to filter on the recipe type.
@@ -73,6 +73,7 @@ class Archiver(OESelftestTestCase):
73 excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipe)) 73 excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipe))
74 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipe) 74 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipe)
75 75
76 @OETestID(1901)
76 def test_archiver_filters_by_type_and_name(self): 77 def test_archiver_filters_by_type_and_name(self):
77 """ 78 """
78 Summary: Test that the archiver archives by recipe type, taking the 79 Summary: Test that the archiver archives by recipe type, taking the
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py
index ecb15d9aea..12540adc7d 100644
--- a/meta/lib/oeqa/selftest/cases/distrodata.py
+++ b/meta/lib/oeqa/selftest/cases/distrodata.py
@@ -2,6 +2,7 @@ from oeqa.selftest.case import OESelftestTestCase
2from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars 2from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
3from oeqa.utils.decorators import testcase 3from oeqa.utils.decorators import testcase
4from oeqa.utils.ftools import write_file 4from oeqa.utils.ftools import write_file
5from oeqa.core.decorator.oeid import OETestID
5 6
6class Distrodata(OESelftestTestCase): 7class Distrodata(OESelftestTestCase):
7 8
@@ -9,6 +10,7 @@ class Distrodata(OESelftestTestCase):
9 def setUpClass(cls): 10 def setUpClass(cls):
10 super(Distrodata, cls).setUpClass() 11 super(Distrodata, cls).setUpClass()
11 12
13 @OETestID(1902)
12 def test_checkpkg(self): 14 def test_checkpkg(self):
13 """ 15 """
14 Summary: Test that upstream version checks do not regress 16 Summary: Test that upstream version checks do not regress
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index bb2e0dba4c..1a850008ef 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -131,6 +131,7 @@ class ImageFeatures(OESelftestTestCase):
131 # check if the resulting gzip is valid 131 # check if the resulting gzip is valid
132 self.assertTrue(runCmd('gzip -t %s' % gzip_path)) 132 self.assertTrue(runCmd('gzip -t %s' % gzip_path))
133 133
134 @OETestID(1903)
134 def test_hypervisor_fmts(self): 135 def test_hypervisor_fmts(self):
135 """ 136 """
136 Summary: Check various hypervisor formats 137 Summary: Check various hypervisor formats
@@ -165,6 +166,7 @@ class ImageFeatures(OESelftestTestCase):
165 native_sysroot=sysroot) 166 native_sysroot=sysroot)
166 self.assertTrue(json.loads(result.output).get('format') == itype) 167 self.assertTrue(json.loads(result.output).get('format') == itype)
167 168
169 @OETestID(1905)
168 def test_long_chain_conversion(self): 170 def test_long_chain_conversion(self):
169 """ 171 """
170 Summary: Check for chaining many CONVERSION_CMDs together 172 Summary: Check for chaining many CONVERSION_CMDs together
@@ -196,6 +198,7 @@ class ImageFeatures(OESelftestTestCase):
196 self.assertTrue(runCmd('cd %s;sha256sum -c %s.%s.sha256sum' % 198 self.assertTrue(runCmd('cd %s;sha256sum -c %s.%s.sha256sum' %
197 (deploy_dir_image, link_name, conv))) 199 (deploy_dir_image, link_name, conv)))
198 200
201 @OETestID(1904)
199 def test_image_fstypes(self): 202 def test_image_fstypes(self):
200 """ 203 """
201 Summary: Check if image of supported image fstypes can be built 204 Summary: Check if image of supported image fstypes can be built
diff --git a/meta/lib/oeqa/selftest/cases/runcmd.py b/meta/lib/oeqa/selftest/cases/runcmd.py
index 6c785caadc..d76d7063c6 100644
--- a/meta/lib/oeqa/selftest/cases/runcmd.py
+++ b/meta/lib/oeqa/selftest/cases/runcmd.py
@@ -1,6 +1,7 @@
1from oeqa.selftest.case import OESelftestTestCase 1from oeqa.selftest.case import OESelftestTestCase
2from oeqa.utils.commands import runCmd 2from oeqa.utils.commands import runCmd
3from oeqa.utils import CommandError 3from oeqa.utils import CommandError
4from oeqa.core.decorator.oeid import OETestID
4 5
5import subprocess 6import subprocess
6import threading 7import threading
@@ -26,49 +27,60 @@ class RunCmdTests(OESelftestTestCase):
26 TIMEOUT = 2 27 TIMEOUT = 2
27 DELTA = 1 28 DELTA = 1
28 29
30 @OETestID(1916)
29 def test_result_okay(self): 31 def test_result_okay(self):
30 result = runCmd("true") 32 result = runCmd("true")
31 self.assertEqual(result.status, 0) 33 self.assertEqual(result.status, 0)
32 34
35 @OETestID(1915)
33 def test_result_false(self): 36 def test_result_false(self):
34 result = runCmd("false", ignore_status=True) 37 result = runCmd("false", ignore_status=True)
35 self.assertEqual(result.status, 1) 38 self.assertEqual(result.status, 1)
36 39
40 @OETestID(1917)
37 def test_shell(self): 41 def test_shell(self):
38 # A shell is used for all string commands. 42 # A shell is used for all string commands.
39 result = runCmd("false; true", ignore_status=True) 43 result = runCmd("false; true", ignore_status=True)
40 self.assertEqual(result.status, 0) 44 self.assertEqual(result.status, 0)
41 45
46 @OETestID(1910)
42 def test_no_shell(self): 47 def test_no_shell(self):
43 self.assertRaises(FileNotFoundError, 48 self.assertRaises(FileNotFoundError,
44 runCmd, "false; true", shell=False) 49 runCmd, "false; true", shell=False)
45 50
51 @OETestID(1906)
46 def test_list_not_found(self): 52 def test_list_not_found(self):
47 self.assertRaises(FileNotFoundError, 53 self.assertRaises(FileNotFoundError,
48 runCmd, ["false; true"]) 54 runCmd, ["false; true"])
49 55
56 @OETestID(1907)
50 def test_list_okay(self): 57 def test_list_okay(self):
51 result = runCmd(["true"]) 58 result = runCmd(["true"])
52 self.assertEqual(result.status, 0) 59 self.assertEqual(result.status, 0)
53 60
61 @OETestID(1913)
54 def test_result_assertion(self): 62 def test_result_assertion(self):
55 self.assertRaisesRegexp(AssertionError, "Command 'echo .* false' returned non-zero exit status 1:\nfoobar", 63 self.assertRaisesRegexp(AssertionError, "Command 'echo .* false' returned non-zero exit status 1:\nfoobar",
56 runCmd, "echo foobar >&2; false", shell=True) 64 runCmd, "echo foobar >&2; false", shell=True)
57 65
66 @OETestID(1914)
58 def test_result_exception(self): 67 def test_result_exception(self):
59 self.assertRaisesRegexp(CommandError, "Command 'echo .* false' returned non-zero exit status 1 with output: foobar", 68 self.assertRaisesRegexp(CommandError, "Command 'echo .* false' returned non-zero exit status 1 with output: foobar",
60 runCmd, "echo foobar >&2; false", shell=True, assert_error=False) 69 runCmd, "echo foobar >&2; false", shell=True, assert_error=False)
61 70
71 @OETestID(1911)
62 def test_output(self): 72 def test_output(self):
63 result = runCmd("echo stdout; echo stderr >&2", shell=True) 73 result = runCmd("echo stdout; echo stderr >&2", shell=True)
64 self.assertEqual("stdout\nstderr", result.output) 74 self.assertEqual("stdout\nstderr", result.output)
65 self.assertEqual("", result.error) 75 self.assertEqual("", result.error)
66 76
77 @OETestID(1912)
67 def test_output_split(self): 78 def test_output_split(self):
68 result = runCmd("echo stdout; echo stderr >&2", shell=True, stderr=subprocess.PIPE) 79 result = runCmd("echo stdout; echo stderr >&2", shell=True, stderr=subprocess.PIPE)
69 self.assertEqual("stdout", result.output) 80 self.assertEqual("stdout", result.output)
70 self.assertEqual("stderr", result.error) 81 self.assertEqual("stderr", result.error)
71 82
83 @OETestID(1920)
72 def test_timeout(self): 84 def test_timeout(self):
73 numthreads = threading.active_count() 85 numthreads = threading.active_count()
74 start = time.time() 86 start = time.time()
@@ -79,6 +91,7 @@ class RunCmdTests(OESelftestTestCase):
79 self.assertLess(end - start, self.TIMEOUT + self.DELTA) 91 self.assertLess(end - start, self.TIMEOUT + self.DELTA)
80 self.assertEqual(numthreads, threading.active_count()) 92 self.assertEqual(numthreads, threading.active_count())
81 93
94 @OETestID(1921)
82 def test_timeout_split(self): 95 def test_timeout_split(self):
83 numthreads = threading.active_count() 96 numthreads = threading.active_count()
84 start = time.time() 97 start = time.time()
@@ -89,12 +102,14 @@ class RunCmdTests(OESelftestTestCase):
89 self.assertLess(end - start, self.TIMEOUT + self.DELTA) 102 self.assertLess(end - start, self.TIMEOUT + self.DELTA)
90 self.assertEqual(numthreads, threading.active_count()) 103 self.assertEqual(numthreads, threading.active_count())
91 104
105 @OETestID(1918)
92 def test_stdin(self): 106 def test_stdin(self):
93 numthreads = threading.active_count() 107 numthreads = threading.active_count()
94 result = runCmd("cat", data=b"hello world", timeout=self.TIMEOUT) 108 result = runCmd("cat", data=b"hello world", timeout=self.TIMEOUT)
95 self.assertEqual("hello world", result.output) 109 self.assertEqual("hello world", result.output)
96 self.assertEqual(numthreads, threading.active_count()) 110 self.assertEqual(numthreads, threading.active_count())
97 111
112 @OETestID(1919)
98 def test_stdin_timeout(self): 113 def test_stdin_timeout(self):
99 numthreads = threading.active_count() 114 numthreads = threading.active_count()
100 start = time.time() 115 start = time.time()
@@ -104,12 +119,14 @@ class RunCmdTests(OESelftestTestCase):
104 self.assertLess(end - start, self.TIMEOUT + self.DELTA) 119 self.assertLess(end - start, self.TIMEOUT + self.DELTA)
105 self.assertEqual(numthreads, threading.active_count()) 120 self.assertEqual(numthreads, threading.active_count())
106 121
122 @OETestID(1908)
107 def test_log(self): 123 def test_log(self):
108 log = MemLogger() 124 log = MemLogger()
109 result = runCmd("echo stdout; echo stderr >&2", shell=True, output_log=log) 125 result = runCmd("echo stdout; echo stderr >&2", shell=True, output_log=log)
110 self.assertEqual(["Running: echo stdout; echo stderr >&2", "stdout", "stderr"], log.info_msgs) 126 self.assertEqual(["Running: echo stdout; echo stderr >&2", "stdout", "stderr"], log.info_msgs)
111 self.assertEqual([], log.error_msgs) 127 self.assertEqual([], log.error_msgs)
112 128
129 @OETestID(1909)
113 def test_log_split(self): 130 def test_log_split(self):
114 log = MemLogger() 131 log = MemLogger()
115 result = runCmd("echo stdout; echo stderr >&2", shell=True, output_log=log, stderr=subprocess.PIPE) 132 result = runCmd("echo stdout; echo stderr >&2", shell=True, output_log=log, stderr=subprocess.PIPE)
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index aa73ba4f7e..fc19a3f211 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -920,6 +920,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
920 self.assertNotIn('\nBZIMAGE ', result.output) 920 self.assertNotIn('\nBZIMAGE ', result.output)
921 self.assertNotIn('\nEFI <DIR> ', result.output) 921 self.assertNotIn('\nEFI <DIR> ', result.output)
922 922
923 @OETestID(1922)
923 def test_mkfs_extraopts(self): 924 def test_mkfs_extraopts(self):
924 """Test wks option --mkfs-extraopts for empty and not empty partitions""" 925 """Test wks option --mkfs-extraopts for empty and not empty partitions"""
925 img = 'core-image-minimal' 926 img = 'core-image-minimal'