From patchwork Wed Aug 18 09:02:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13386 X-Patchwork-Delegate: umang.jain@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 3BA7CBD87C for ; Wed, 18 Aug 2021 09:03:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 043F568895; Wed, 18 Aug 2021 11:03:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rahCF9za"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 35A476025E for ; Wed, 18 Aug 2021 11:03:04 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.238.109.15]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 92B79466; Wed, 18 Aug 2021 11:03:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1629277384; bh=oWqdDxtU4DI2eibi/7jjv5OTD/WVHyEs3wLemlBI17g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rahCF9za5Nqh034WquDdTo/LkwEG/Dro0E8VyFenoMKKCp1dfBbLyh3mVsxIiCzpm LWaGjeRic189Q9CXPpRZa1nsgzFT21cgQ3LWfUpoFGSfb5IInTvIb/liDjcr+CLtMK HrSjWaTBNSp36avNAbvWvPP9vCHR7DuJiBJAnxe4= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Wed, 18 Aug 2021 14:32:46 +0530 Message-Id: <20210818090247.33838-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210818090247.33838-1-umang.jain@ideasonboard.com> References: <20210818090247.33838-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] libtest: camera_test: Plumb constructor to set LIBCAMERA_IPA_FORCE_ISOLATION X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Some tests might require to have LIBCAMERA_IPA_FORCE_ISOLATION set to ensure they can test the IPA running in isolated mode. These tests are likely to leverage CameraTest. The environment variable should be set before CameraManager::start() call which happens in CameraTest's constructor. Hence, plumb the constructor with a flag so that the LIBCAMERA_IPA_FORCE_ISOLATION can be set before CameraManager::start(). Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- test/libtest/camera_test.cpp | 5 ++++- test/libtest/camera_test.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp index 2ae4d677..fe13d6ac 100644 --- a/test/libtest/camera_test.cpp +++ b/test/libtest/camera_test.cpp @@ -13,10 +13,13 @@ using namespace libcamera; using namespace std; -CameraTest::CameraTest(const char *name) +CameraTest::CameraTest(const char *name, bool isolate) { cm_ = new CameraManager(); + if (isolate) + setenv("LIBCAMERA_IPA_FORCE_ISOLATION", "1", 1); + if (cm_->start()) { cerr << "Failed to start camera manager" << endl; status_ = TestFail; diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h index 7939798f..f56e343e 100644 --- a/test/libtest/camera_test.h +++ b/test/libtest/camera_test.h @@ -17,7 +17,7 @@ using namespace libcamera; class CameraTest { public: - CameraTest(const char *name); + CameraTest(const char *name, bool isolate = false); ~CameraTest(); protected: