diff options
author | Daniel Istrate <daniel.alexandrux.istrate@intel.com> | 2015-10-13 18:00:40 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-21 22:56:06 +0100 |
commit | 94decbce394f74f11f79f6779598426e423e1745 (patch) | |
tree | 847ad1c0969c2a4c89633119c32c8f6fea257b79 /meta/lib | |
parent | 322c3248e9089878a0658b55d3037c6537e6a9cb (diff) | |
download | poky-94decbce394f74f11f79f6779598426e423e1745.tar.gz |
oeqa/selftest/bbtests: Updated bitbake TCs
- Added new TC test_force_task_1 (1354);
check that do_package_write_rpm() re-executes
upon changes in package image.
- Updated TC test_force_task_2 (163);
changed test recipe to zlib and added
do_package() to the task execution list.
- Removed unnecessary imports.
Fix for bug [YOCTO #5875].
(From OE-Core rev: 86a7e68803aca58feca9b6cf479552d14b00996c)
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/bbtests.py | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/meta/lib/oeqa/selftest/bbtests.py b/meta/lib/oeqa/selftest/bbtests.py index af0773df10..1c0e588c04 100644 --- a/meta/lib/oeqa/selftest/bbtests.py +++ b/meta/lib/oeqa/selftest/bbtests.py | |||
@@ -1,8 +1,5 @@ | |||
1 | import unittest | ||
2 | import os | 1 | import os |
3 | import logging | ||
4 | import re | 2 | import re |
5 | import shutil | ||
6 | 3 | ||
7 | import oeqa.utils.ftools as ftools | 4 | import oeqa.utils.ftools as ftools |
8 | from oeqa.selftest.base import oeSelfTest | 5 | from oeqa.selftest.base import oeSelfTest |
@@ -68,15 +65,43 @@ class BitbakeTests(oeSelfTest): | |||
68 | bitbake('-cclean man') | 65 | bitbake('-cclean man') |
69 | self.assertTrue("ERROR: Function failed: patch_do_patch" in result.output, msg = "Though no man-1.5h1-make.patch file exists, bitbake didn't output any err. message. bitbake output: %s" % result.output) | 66 | self.assertTrue("ERROR: Function failed: patch_do_patch" in result.output, msg = "Though no man-1.5h1-make.patch file exists, bitbake didn't output any err. message. bitbake output: %s" % result.output) |
70 | 67 | ||
68 | @testcase(1354) | ||
69 | def test_force_task_1(self): | ||
70 | # test 1 from bug 5875 | ||
71 | test_recipe = 'zlib' | ||
72 | test_data = "Microsoft Made No Profit From Anyone's Zunes Yo" | ||
73 | image_dir = get_bb_var('D', test_recipe) | ||
74 | pkgsplit_dir = get_bb_var('PKGDEST', test_recipe) | ||
75 | man_dir = get_bb_var('mandir', test_recipe) | ||
76 | |||
77 | bitbake('-c cleansstate %s' % test_recipe) | ||
78 | bitbake(test_recipe) | ||
79 | self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) | ||
80 | |||
81 | man_file = os.path.join(image_dir + man_dir, 'man3/zlib.3') | ||
82 | ftools.append_file(man_file, test_data) | ||
83 | bitbake('-c package -f %s' % test_recipe) | ||
84 | |||
85 | man_split_file = os.path.join(pkgsplit_dir, 'zlib-doc' + man_dir, 'man3/zlib.3') | ||
86 | man_split_content = ftools.read_file(man_split_file) | ||
87 | self.assertIn(test_data, man_split_content, 'The man file has not changed in packages-split.') | ||
88 | |||
89 | ret = bitbake(test_recipe) | ||
90 | self.assertIn('task do_package_write_rpm:', ret.output, 'Task do_package_write_rpm did not re-executed.') | ||
91 | |||
71 | @testcase(163) | 92 | @testcase(163) |
72 | def test_force_task(self): | 93 | def test_force_task_2(self): |
73 | bitbake('m4-native') | 94 | # test 2 from bug 5875 |
74 | self.add_command_to_tearDown('bitbake -c clean m4-native') | 95 | test_recipe = 'zlib' |
75 | result = bitbake('-C compile m4-native') | 96 | |
76 | look_for_tasks = ['do_compile', 'do_install', 'do_populate_sysroot'] | 97 | bitbake('-c cleansstate %s' % test_recipe) |
98 | bitbake(test_recipe) | ||
99 | self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) | ||
100 | |||
101 | result = bitbake('-C compile %s' % test_recipe) | ||
102 | look_for_tasks = ['do_compile:', 'do_install:', 'do_populate_sysroot:', 'do_package:'] | ||
77 | for task in look_for_tasks: | 103 | for task in look_for_tasks: |
78 | find_task = re.search("m4-native.*%s" % task, result.output) | 104 | self.assertIn(task, result.output, msg="Couldn't find %s task.") |
79 | self.assertTrue(find_task, msg = "Couldn't find %s task. bitbake output %s" % (task, result.output)) | ||
80 | 105 | ||
81 | @testcase(167) | 106 | @testcase(167) |
82 | def test_bitbake_g(self): | 107 | def test_bitbake_g(self): |