From 0762b6021b87ceb1f37952f3a6d64a36e99ae6a5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 16 Nov 2018 09:33:28 +0000 Subject: oeqa/utils/httpserver: Rework to avoid hangs and improve logging testimage.bbclass installs a SIGTERM handler which conflicts with the use of multiprocessing here. This is paritcularly problematic if the http service is terminated before its started and hence before its had a chance to reset the default signal handler (as the code was written). Instead, temporarily remove testimage's handler whilst forking the http process which means the correct handler is installed and won't deadlock. Also take the opportunity to add in some log messages about the server start and shutdown so that future debugging is easier and its clearer what the code is doing. Signed-off-by: Richard Purdie --- meta/lib/oeqa/runtime/cases/apt.py | 2 +- meta/lib/oeqa/runtime/cases/dnf.py | 2 +- meta/lib/oeqa/runtime/cases/opkg.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'meta/lib/oeqa/runtime/cases') diff --git a/meta/lib/oeqa/runtime/cases/apt.py b/meta/lib/oeqa/runtime/cases/apt.py index 8d4dd35c57..793143f72c 100644 --- a/meta/lib/oeqa/runtime/cases/apt.py +++ b/meta/lib/oeqa/runtime/cases/apt.py @@ -18,7 +18,7 @@ class AptRepoTest(AptTest): @classmethod def setUpClass(cls): service_repo = os.path.join(cls.tc.td['DEPLOY_DIR_DEB'], 'all') - cls.repo_server = HTTPService(service_repo, cls.tc.target.server_ip) + cls.repo_server = HTTPService(service_repo, cls.tc.target.server_ip, logger=cls.tc.logger) cls.repo_server.start() @classmethod diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py index e93a1cea06..c1ed39d776 100644 --- a/meta/lib/oeqa/runtime/cases/dnf.py +++ b/meta/lib/oeqa/runtime/cases/dnf.py @@ -55,7 +55,7 @@ class DnfRepoTest(DnfTest): @classmethod def setUpClass(cls): cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'oe-testimage-repo'), - cls.tc.target.server_ip) + cls.tc.target.server_ip, logger=cls.tc.logger) cls.repo_server.start() @classmethod diff --git a/meta/lib/oeqa/runtime/cases/opkg.py b/meta/lib/oeqa/runtime/cases/opkg.py index 3be480a672..693f5d68c9 100644 --- a/meta/lib/oeqa/runtime/cases/opkg.py +++ b/meta/lib/oeqa/runtime/cases/opkg.py @@ -21,7 +21,7 @@ class OpkgRepoTest(OpkgTest): if cls.tc.td["MULTILIB_VARIANTS"]: allarchfeed = cls.tc.td["TUNE_PKGARCH"] service_repo = os.path.join(cls.tc.td['DEPLOY_DIR_IPK'], allarchfeed) - cls.repo_server = HTTPService(service_repo, cls.tc.target.server_ip) + cls.repo_server = HTTPService(service_repo, cls.tc.target.server_ip, logger=cls.tc.logger) cls.repo_server.start() @classmethod -- cgit 1.2.3-korg