summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2015-10-13 18:00:40 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-21 22:54:59 +0100
commit86a7e68803aca58feca9b6cf479552d14b00996c (patch)
treed34cb343d41af160ee4fb86215ceddabcea21da9 /meta/lib/oeqa
parentaa3b859524bb693d3b150a8873a2ee24c78eac0a (diff)
downloadopenembedded-core-86a7e68803aca58feca9b6cf479552d14b00996c.tar.gz
openembedded-core-86a7e68803aca58feca9b6cf479552d14b00996c.tar.bz2
openembedded-core-86a7e68803aca58feca9b6cf479552d14b00996c.zip
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]. Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/bbtests.py45
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 @@
-import unittest
import os
-import logging
import re
-import shutil
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
@@ -68,15 +65,43 @@ class BitbakeTests(oeSelfTest):
bitbake('-cclean man')
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)
+ @testcase(1354)
+ def test_force_task_1(self):
+ # test 1 from bug 5875
+ test_recipe = 'zlib'
+ test_data = "Microsoft Made No Profit From Anyone's Zunes Yo"
+ image_dir = get_bb_var('D', test_recipe)
+ pkgsplit_dir = get_bb_var('PKGDEST', test_recipe)
+ man_dir = get_bb_var('mandir', test_recipe)
+
+ bitbake('-c cleansstate %s' % test_recipe)
+ bitbake(test_recipe)
+ self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
+
+ man_file = os.path.join(image_dir + man_dir, 'man3/zlib.3')
+ ftools.append_file(man_file, test_data)
+ bitbake('-c package -f %s' % test_recipe)
+
+ man_split_file = os.path.join(pkgsplit_dir, 'zlib-doc' + man_dir, 'man3/zlib.3')
+ man_split_content = ftools.read_file(man_split_file)
+ self.assertIn(test_data, man_split_content, 'The man file has not changed in packages-split.')
+
+ ret = bitbake(test_recipe)
+ self.assertIn('task do_package_write_rpm:', ret.output, 'Task do_package_write_rpm did not re-executed.')
+
@testcase(163)
- def test_force_task(self):
- bitbake('m4-native')
- self.add_command_to_tearDown('bitbake -c clean m4-native')
- result = bitbake('-C compile m4-native')
- look_for_tasks = ['do_compile', 'do_install', 'do_populate_sysroot']
+ def test_force_task_2(self):
+ # test 2 from bug 5875
+ test_recipe = 'zlib'
+
+ bitbake('-c cleansstate %s' % test_recipe)
+ bitbake(test_recipe)
+ self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
+
+ result = bitbake('-C compile %s' % test_recipe)
+ look_for_tasks = ['do_compile:', 'do_install:', 'do_populate_sysroot:', 'do_package:']
for task in look_for_tasks:
- find_task = re.search("m4-native.*%s" % task, result.output)
- self.assertTrue(find_task, msg = "Couldn't find %s task. bitbake output %s" % (task, result.output))
+ self.assertIn(task, result.output, msg="Couldn't find %s task.")
@testcase(167)
def test_bitbake_g(self):