diff options
Diffstat (limited to 'yocto-poky/meta/lib/oeqa/selftest/prservice.py')
-rw-r--r-- | yocto-poky/meta/lib/oeqa/selftest/prservice.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/yocto-poky/meta/lib/oeqa/selftest/prservice.py b/yocto-poky/meta/lib/oeqa/selftest/prservice.py index 4187fbfee..1b9a510fd 100644 --- a/yocto-poky/meta/lib/oeqa/selftest/prservice.py +++ b/yocto-poky/meta/lib/oeqa/selftest/prservice.py @@ -9,9 +9,10 @@ import oeqa.utils.ftools as ftools from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands import runCmd, bitbake, get_bb_var from oeqa.utils.decorators import testcase +from oeqa.utils.network import get_free_port class BitbakePrTests(oeSelfTest): - + def get_pr_version(self, package_name): pkgdata_dir = get_bb_var('PKGDATA_DIR') package_data_file = os.path.join(pkgdata_dir, 'runtime', package_name) @@ -26,7 +27,7 @@ class BitbakePrTests(oeSelfTest): package_stamps_path = "/".join(stampdata[:-1]) stamps = [] for stamp in os.listdir(package_stamps_path): - find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (prefix, recipe_task), stamp) + find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (re.escape(prefix), recipe_task), stamp) if find_stamp: stamps.append(find_stamp.group(1)) self.assertFalse(len(stamps) == 0, msg="Cound not find stamp for task %s for recipe %s" % (recipe_task, package_name)) @@ -34,7 +35,7 @@ class BitbakePrTests(oeSelfTest): return str(stamps[0]) def increment_package_pr(self, package_name): - inc_data = "do_package_append() {\nbb.build.exec_func('do_test_prserv', d)\n}\ndo_test_prserv() {\necho \"The current date is: %s\"\n}" % datetime.datetime.now() + inc_data = "do_package_append() {\n bb.build.exec_func('do_test_prserv', d)\n}\ndo_test_prserv() {\necho \"The current date is: %s\"\n}" % datetime.datetime.now() self.write_recipeinc(package_name, inc_data) bitbake("-ccleansstate %s" % package_name) res = bitbake(package_name, ignore_status=True) @@ -119,3 +120,13 @@ class BitbakePrTests(oeSelfTest): @testcase(936) def test_pr_service_ipk_arch_indep(self): self.run_test_pr_service('xcursor-transparent-theme', 'ipk', 'do_package') + + @testcase(1419) + def test_stopping_prservice_message(self): + port = get_free_port() + + runCmd('bitbake-prserv --host localhost --port %s --loglevel=DEBUG --start' % port) + ret = runCmd('bitbake-prserv --host localhost --port %s --loglevel=DEBUG --stop' % port) + + self.assertEqual(ret.status, 0) + |