summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2015-10-23 15:07:51 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-27 07:24:28 +0000
commit426a9b78d0018a739ec06c5dddcd0f8b6c4194cf (patch)
treecc33f531c7c2aa59b43f18c97223efb1b250f6b6 /meta/lib
parent835525c8bb79007b262b10e9f473ebfa1e4c8ceb (diff)
downloadpoky-426a9b78d0018a739ec06c5dddcd0f8b6c4194cf.tar.gz
oeqa/selftest: Added testcase decorators.
Added testcase decorators for testopia integration. (From OE-Core rev: 9c7ffd397c8232d53c87017e58e03e3056863edf) Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@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')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py11
-rw-r--r--meta/lib/oeqa/selftest/manifest.py2
-rw-r--r--meta/lib/oeqa/selftest/recipetool.py11
-rw-r--r--meta/lib/oeqa/selftest/sstatetests.py14
4 files changed, 30 insertions, 8 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index fb46559eec..f48e6a2557 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -378,6 +378,7 @@ class DevtoolTests(DevtoolBase):
378 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output)) 378 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output))
379 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe) 379 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe)
380 380
381 @testcase(1365)
381 def test_devtool_modify_native(self): 382 def test_devtool_modify_native(self):
382 # Check preconditions 383 # Check preconditions
383 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') 384 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
@@ -466,6 +467,7 @@ class DevtoolTests(DevtoolBase):
466 # Try building 467 # Try building
467 bitbake(testrecipe) 468 bitbake(testrecipe)
468 469
470 @testcase(1378)
469 def test_devtool_modify_virtual(self): 471 def test_devtool_modify_virtual(self):
470 # Try modifying a virtual recipe 472 # Try modifying a virtual recipe
471 virtrecipe = 'virtual/libx11' 473 virtrecipe = 'virtual/libx11'
@@ -745,7 +747,7 @@ class DevtoolTests(DevtoolBase):
745 self.assertEqual(expectedlines, f.readlines()) 747 self.assertEqual(expectedlines, f.readlines())
746 # Deleting isn't expected to work under these circumstances 748 # Deleting isn't expected to work under these circumstances
747 749
748 @testcase(1173) 750 @testcase(1370)
749 def test_devtool_update_recipe_local_files(self): 751 def test_devtool_update_recipe_local_files(self):
750 """Check that local source files are copied over instead of patched""" 752 """Check that local source files are copied over instead of patched"""
751 testrecipe = 'makedevs' 753 testrecipe = 'makedevs'
@@ -775,7 +777,7 @@ class DevtoolTests(DevtoolBase):
775 ('??', '.*/makedevs/0001-Add-new-file.patch$')] 777 ('??', '.*/makedevs/0001-Add-new-file.patch$')]
776 self._check_repo_status(os.path.dirname(recipefile), expected_status) 778 self._check_repo_status(os.path.dirname(recipefile), expected_status)
777 779
778 @testcase(1174) 780 @testcase(1371)
779 def test_devtool_update_recipe_local_files_2(self): 781 def test_devtool_update_recipe_local_files_2(self):
780 """Check local source files support when oe-local-files is in Git""" 782 """Check local source files support when oe-local-files is in Git"""
781 testrecipe = 'lzo' 783 testrecipe = 'lzo'
@@ -827,6 +829,7 @@ class DevtoolTests(DevtoolBase):
827 self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found') 829 self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
828 self._check_src_repo(tempdir) 830 self._check_src_repo(tempdir)
829 831
832 @testcase(1379)
830 def test_devtool_extract_virtual(self): 833 def test_devtool_extract_virtual(self):
831 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 834 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
832 # Try devtool extract 835 # Try devtool extract
@@ -864,6 +867,7 @@ class DevtoolTests(DevtoolBase):
864 matches2 = glob.glob(stampprefix2 + '*') 867 matches2 = glob.glob(stampprefix2 + '*')
865 self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2) 868 self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)
866 869
870 @testcase(1272)
867 def test_devtool_deploy_target(self): 871 def test_devtool_deploy_target(self):
868 # NOTE: Whilst this test would seemingly be better placed as a runtime test, 872 # NOTE: Whilst this test would seemingly be better placed as a runtime test,
869 # unfortunately the runtime tests run under bitbake and you can't run 873 # unfortunately the runtime tests run under bitbake and you can't run
@@ -948,6 +952,7 @@ class DevtoolTests(DevtoolBase):
948 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True) 952 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True)
949 self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have') 953 self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have')
950 954
955 @testcase(1366)
951 def test_devtool_build_image(self): 956 def test_devtool_build_image(self):
952 """Test devtool build-image plugin""" 957 """Test devtool build-image plugin"""
953 # Check preconditions 958 # Check preconditions
@@ -981,6 +986,7 @@ class DevtoolTests(DevtoolBase):
981 if reqpkgs: 986 if reqpkgs:
982 self.fail('The following packages were not present in the image as expected: %s' % ', '.join(reqpkgs)) 987 self.fail('The following packages were not present in the image as expected: %s' % ', '.join(reqpkgs))
983 988
989 @testcase(1367)
984 def test_devtool_upgrade(self): 990 def test_devtool_upgrade(self):
985 # Check preconditions 991 # Check preconditions
986 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') 992 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
@@ -1016,6 +1022,7 @@ class DevtoolTests(DevtoolBase):
1016 self.track_for_cleanup(self.workspacedir) 1022 self.track_for_cleanup(self.workspacedir)
1017 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') 1023 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
1018 1024
1025 @testcase(1352)
1019 def test_devtool_layer_plugins(self): 1026 def test_devtool_layer_plugins(self):
1020 """Test that devtool can use plugins from other layers. 1027 """Test that devtool can use plugins from other layers.
1021 1028
diff --git a/meta/lib/oeqa/selftest/manifest.py b/meta/lib/oeqa/selftest/manifest.py
index c813c1d3be..44d0404c5d 100644
--- a/meta/lib/oeqa/selftest/manifest.py
+++ b/meta/lib/oeqa/selftest/manifest.py
@@ -59,6 +59,7 @@ class VerifyManifest(oeSelfTest):
59 unittest.SkipTest("{}: Cannot setup testing scenario"\ 59 unittest.SkipTest("{}: Cannot setup testing scenario"\
60 .format(self.classname)) 60 .format(self.classname))
61 61
62 @testcase(1380)
62 def test_SDK_manifest_entries(self): 63 def test_SDK_manifest_entries(self):
63 '''Verifying the SDK manifest entries exist, this may take a build''' 64 '''Verifying the SDK manifest entries exist, this may take a build'''
64 65
@@ -124,6 +125,7 @@ class VerifyManifest(oeSelfTest):
124 self.log.info(msg) 125 self.log.info(msg)
125 self.fail(logmsg) 126 self.fail(logmsg)
126 127
128 @testcase(1381)
127 def test_image_manifest_entries(self): 129 def test_image_manifest_entries(self):
128 '''Verifying the image manifest entries exist''' 130 '''Verifying the image manifest entries exist'''
129 131
diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/recipetool.py
index c34ad68870..b1f1d2ab90 100644
--- a/meta/lib/oeqa/selftest/recipetool.py
+++ b/meta/lib/oeqa/selftest/recipetool.py
@@ -492,9 +492,12 @@ class RecipetoolAppendsrcBase(RecipetoolBase):
492 492
493 493
494class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase): 494class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
495
496 @testcase(1273)
495 def test_recipetool_appendsrcfile_basic(self): 497 def test_recipetool_appendsrcfile_basic(self):
496 self._test_appendsrcfile('base-files', 'a-file') 498 self._test_appendsrcfile('base-files', 'a-file')
497 499
500 @testcase(1274)
498 def test_recipetool_appendsrcfile_basic_wildcard(self): 501 def test_recipetool_appendsrcfile_basic_wildcard(self):
499 testrecipe = 'base-files' 502 testrecipe = 'base-files'
500 self._test_appendsrcfile(testrecipe, 'a-file', options='-w') 503 self._test_appendsrcfile(testrecipe, 'a-file', options='-w')
@@ -502,12 +505,15 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
502 bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir) 505 bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
503 self.assertEqual(os.path.basename(bbappendfile), '%s_%%.bbappend' % testrecipe) 506 self.assertEqual(os.path.basename(bbappendfile), '%s_%%.bbappend' % testrecipe)
504 507
508 @testcase(1281)
505 def test_recipetool_appendsrcfile_subdir_basic(self): 509 def test_recipetool_appendsrcfile_subdir_basic(self):
506 self._test_appendsrcfile('base-files', 'a-file', 'tmp') 510 self._test_appendsrcfile('base-files', 'a-file', 'tmp')
507 511
512 @testcase(1282)
508 def test_recipetool_appendsrcfile_subdir_basic_dirdest(self): 513 def test_recipetool_appendsrcfile_subdir_basic_dirdest(self):
509 self._test_appendsrcfile('base-files', destdir='tmp') 514 self._test_appendsrcfile('base-files', destdir='tmp')
510 515
516 @testcase(1280)
511 def test_recipetool_appendsrcfile_srcdir_basic(self): 517 def test_recipetool_appendsrcfile_srcdir_basic(self):
512 testrecipe = 'bash' 518 testrecipe = 'bash'
513 srcdir = get_bb_var('S', testrecipe) 519 srcdir = get_bb_var('S', testrecipe)
@@ -515,12 +521,14 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
515 subdir = os.path.relpath(srcdir, workdir) 521 subdir = os.path.relpath(srcdir, workdir)
516 self._test_appendsrcfile(testrecipe, 'a-file', srcdir=subdir) 522 self._test_appendsrcfile(testrecipe, 'a-file', srcdir=subdir)
517 523
524 @testcase(1275)
518 def test_recipetool_appendsrcfile_existing_in_src_uri(self): 525 def test_recipetool_appendsrcfile_existing_in_src_uri(self):
519 testrecipe = 'base-files' 526 testrecipe = 'base-files'
520 filepath = self._get_first_file_uri(testrecipe) 527 filepath = self._get_first_file_uri(testrecipe)
521 self.assertTrue(filepath, 'Unable to test, no file:// uri found in SRC_URI for %s' % testrecipe) 528 self.assertTrue(filepath, 'Unable to test, no file:// uri found in SRC_URI for %s' % testrecipe)
522 self._test_appendsrcfile(testrecipe, filepath, has_src_uri=False) 529 self._test_appendsrcfile(testrecipe, filepath, has_src_uri=False)
523 530
531 @testcase(1276)
524 def test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(self): 532 def test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(self):
525 testrecipe = 'base-files' 533 testrecipe = 'base-files'
526 subdir = 'tmp' 534 subdir = 'tmp'
@@ -530,6 +538,7 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
530 output = self._test_appendsrcfile(testrecipe, filepath, subdir, has_src_uri=False) 538 output = self._test_appendsrcfile(testrecipe, filepath, subdir, has_src_uri=False)
531 self.assertTrue(any('with different parameters' in l for l in output)) 539 self.assertTrue(any('with different parameters' in l for l in output))
532 540
541 @testcase(1277)
533 def test_recipetool_appendsrcfile_replace_file_srcdir(self): 542 def test_recipetool_appendsrcfile_replace_file_srcdir(self):
534 testrecipe = 'bash' 543 testrecipe = 'bash'
535 filepath = 'Makefile.in' 544 filepath = 'Makefile.in'
@@ -541,6 +550,7 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
541 bitbake('%s:do_unpack' % testrecipe) 550 bitbake('%s:do_unpack' % testrecipe)
542 self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read()) 551 self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read())
543 552
553 @testcase(1278)
544 def test_recipetool_appendsrcfiles_basic(self, destdir=None): 554 def test_recipetool_appendsrcfiles_basic(self, destdir=None):
545 newfiles = [self.testfile] 555 newfiles = [self.testfile]
546 for i in range(1, 5): 556 for i in range(1, 5):
@@ -550,5 +560,6 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
550 newfiles.append(testfile) 560 newfiles.append(testfile)
551 self._test_appendsrcfiles('gcc', newfiles, destdir=destdir, options='-W') 561 self._test_appendsrcfiles('gcc', newfiles, destdir=destdir, options='-W')
552 562
563 @testcase(1279)
553 def test_recipetool_appendsrcfiles_basic_subdir(self): 564 def test_recipetool_appendsrcfiles_basic_subdir(self):
554 self.test_recipetool_appendsrcfiles_basic(destdir='testdir') 565 self.test_recipetool_appendsrcfiles_basic(destdir='testdir')
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index 9ccc7bb265..3c230620ed 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -34,7 +34,7 @@ class SStateTests(SStateBase):
34 targetarch = get_bb_var('TUNE_ARCH') 34 targetarch = get_bb_var('TUNE_ARCH')
35 self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True) 35 self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
36 36
37 @testcase(975) 37 @testcase(1374)
38 def test_sstate_creation_distro_specific_fail(self): 38 def test_sstate_creation_distro_specific_fail(self):
39 targetarch = get_bb_var('TUNE_ARCH') 39 targetarch = get_bb_var('TUNE_ARCH')
40 self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False) 40 self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False)
@@ -43,7 +43,7 @@ class SStateTests(SStateBase):
43 def test_sstate_creation_distro_nonspecific_pass(self): 43 def test_sstate_creation_distro_nonspecific_pass(self):
44 self.run_test_sstate_creation(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True) 44 self.run_test_sstate_creation(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
45 45
46 @testcase(976) 46 @testcase(1375)
47 def test_sstate_creation_distro_nonspecific_fail(self): 47 def test_sstate_creation_distro_nonspecific_fail(self):
48 self.run_test_sstate_creation(['glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False) 48 self.run_test_sstate_creation(['glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False)
49 49
@@ -70,11 +70,11 @@ class SStateTests(SStateBase):
70 targetarch = get_bb_var('TUNE_ARCH') 70 targetarch = get_bb_var('TUNE_ARCH')
71 self.run_test_cleansstate_task(['binutils-cross-' + targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True) 71 self.run_test_cleansstate_task(['binutils-cross-' + targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
72 72
73 @testcase(977) 73 @testcase(1376)
74 def test_cleansstate_task_distro_nonspecific(self): 74 def test_cleansstate_task_distro_nonspecific(self):
75 self.run_test_cleansstate_task(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True) 75 self.run_test_cleansstate_task(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
76 76
77 @testcase(977) 77 @testcase(1377)
78 def test_cleansstate_task_distro_specific(self): 78 def test_cleansstate_task_distro_specific(self):
79 targetarch = get_bb_var('TUNE_ARCH') 79 targetarch = get_bb_var('TUNE_ARCH')
80 self.run_test_cleansstate_task(['binutils-cross-'+ targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True) 80 self.run_test_cleansstate_task(['binutils-cross-'+ targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
@@ -111,12 +111,12 @@ class SStateTests(SStateBase):
111 targetarch = get_bb_var('TUNE_ARCH') 111 targetarch = get_bb_var('TUNE_ARCH')
112 self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch, 'binutils-native'], temp_sstate_location=True) 112 self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch, 'binutils-native'], temp_sstate_location=True)
113 113
114 @testcase(175) 114 @testcase(1372)
115 def test_rebuild_distro_specific_sstate_cross_target(self): 115 def test_rebuild_distro_specific_sstate_cross_target(self):
116 targetarch = get_bb_var('TUNE_ARCH') 116 targetarch = get_bb_var('TUNE_ARCH')
117 self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch], temp_sstate_location=True) 117 self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch], temp_sstate_location=True)
118 118
119 @testcase(175) 119 @testcase(1373)
120 def test_rebuild_distro_specific_sstate_native_target(self): 120 def test_rebuild_distro_specific_sstate_native_target(self):
121 self.run_test_rebuild_distro_specific_sstate(['binutils-native'], temp_sstate_location=True) 121 self.run_test_rebuild_distro_specific_sstate(['binutils-native'], temp_sstate_location=True)
122 122
@@ -283,6 +283,7 @@ NATIVELSBSTRING = \"DistroB\"
283 self.maxDiff = None 283 self.maxDiff = None
284 self.assertItemsEqual(files1, files2) 284 self.assertItemsEqual(files1, files2)
285 285
286 @testcase(1368)
286 def test_sstate_allarch_samesigs(self): 287 def test_sstate_allarch_samesigs(self):
287 """ 288 """
288 The sstate checksums of allarch packages should be independent of whichever 289 The sstate checksums of allarch packages should be independent of whichever
@@ -330,6 +331,7 @@ MACHINE = \"qemuarm\"
330 self.maxDiff = None 331 self.maxDiff = None
331 self.assertItemsEqual(files1, files2) 332 self.assertItemsEqual(files1, files2)
332 333
334 @testcase(1369)
333 def test_sstate_sametune_samesigs(self): 335 def test_sstate_sametune_samesigs(self):
334 """ 336 """
335 The sstate checksums of two identical machines (using the same tune) should be the 337 The sstate checksums of two identical machines (using the same tune) should be the