[{"id":18865,"web_url":"https://patchwork.libcamera.org/comment/18865/","msgid":"<3756e278-ac98-800f-56cf-e01c6df0c37a@ideasonboard.com>","date":"2021-08-17T12:29:07","subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Umang,\n\nOn 17/08/2021 13:26, Umang Jain wrote:\n> Some tests might require to have LIBCAMERA_IPA_FORCE_ISOLATION set\n> to ensure they can test the IPA running in isolated mode. These tests\n> are likely to leverage CameraTest. The environment variable should\n> be set before CameraManager::start() call which happens in CameraTest's\n> constructor. Hence, plumb the constructor with a flag so that the\n> LIBCAMERA_IPA_FORCE_ISOLATION can be set before CameraManager::start().\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  test/libtest/camera_test.cpp | 5 ++++-\n>  test/libtest/camera_test.h   | 2 +-\n>  2 files changed, 5 insertions(+), 2 deletions(-)\n> \n> diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp\n> index 2ae4d677..9cbc4d82 100644\n> --- a/test/libtest/camera_test.cpp\n> +++ b/test/libtest/camera_test.cpp\n> @@ -13,10 +13,13 @@\n>  using namespace libcamera;\n>  using namespace std;\n>  \n> -CameraTest::CameraTest(const char *name)\n> +CameraTest::CameraTest(const char *name, bool isolate)\n>  {\n>  \tcm_ = new CameraManager();\n>  \n> +\tif (isolate)\n> +\t\tsetenv(\"LIBCAMERA_IPA_FORCE_ISOLATION\", \"TRUE\", 1);\n> +\n\nAhh nice. Good so we can now isolate IPA's from tests!\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n\n>  \tif (cm_->start()) {\n>  \t\tcerr << \"Failed to start camera manager\" << endl;\n>  \t\tstatus_ = TestFail;\n> diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h\n> index 7939798f..f56e343e 100644\n> --- a/test/libtest/camera_test.h\n> +++ b/test/libtest/camera_test.h\n> @@ -17,7 +17,7 @@ using namespace libcamera;\n>  class CameraTest\n>  {\n>  public:\n> -\tCameraTest(const char *name);\n> +\tCameraTest(const char *name, bool isolate = false);\n>  \t~CameraTest();\n>  \n>  protected:\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 613EDBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Aug 2021 12:29:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CC72468894;\n\tTue, 17 Aug 2021 14:29:11 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 887A66025C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Aug 2021 14:29:10 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 255952C5;\n\tTue, 17 Aug 2021 14:29:10 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mquGmZCk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629203350;\n\tbh=4k4l2zw17FoFxv1H19zs1rYuskEBRlrVRaBfsa66m4U=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=mquGmZCkUj036Mev4piFeP943oTesgeWEs4jrTOo2kR1hbW8g7hYypoO09F7SYpdA\n\tGTAPkdi1nqGIkkaMW5+FHZLrWRWIiBOo7VXNPL0K0R/2fNyFUbS64iBXPWGiEiA0j4\n\tfnnudPbFuixbUSfJQB0X6prQEx440HeGtZbYy7ZA=","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210817122646.185978-1-umang.jain@ideasonboard.com>\n\t<20210817122646.185978-2-umang.jain@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<3756e278-ac98-800f-56cf-e01c6df0c37a@ideasonboard.com>","Date":"Tue, 17 Aug 2021 13:29:07 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210817122646.185978-2-umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18867,"web_url":"https://patchwork.libcamera.org/comment/18867/","msgid":"<b5095423-c3b8-3a23-c2f1-1ebace92a971@ideasonboard.com>","date":"2021-08-17T12:44:50","subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 17/08/2021 13:29, Kieran Bingham wrote:\n> Hi Umang,\n> \n> On 17/08/2021 13:26, Umang Jain wrote:\n>> Some tests might require to have LIBCAMERA_IPA_FORCE_ISOLATION set\n>> to ensure they can test the IPA running in isolated mode. These tests\n>> are likely to leverage CameraTest. The environment variable should\n>> be set before CameraManager::start() call which happens in CameraTest's\n>> constructor. Hence, plumb the constructor with a flag so that the\n>> LIBCAMERA_IPA_FORCE_ISOLATION can be set before CameraManager::start().\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>  test/libtest/camera_test.cpp | 5 ++++-\n>>  test/libtest/camera_test.h   | 2 +-\n>>  2 files changed, 5 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp\n>> index 2ae4d677..9cbc4d82 100644\n>> --- a/test/libtest/camera_test.cpp\n>> +++ b/test/libtest/camera_test.cpp\n>> @@ -13,10 +13,13 @@\n>>  using namespace libcamera;\n>>  using namespace std;\n>>  \n>> -CameraTest::CameraTest(const char *name)\n>> +CameraTest::CameraTest(const char *name, bool isolate)\n\nReading this where it is used, I wonder if this flag should be an enum,\nbut it's not essential - and more a question for debate.\n\ni.e.\n  CameraTest(kCamId_, ISOLATED_IPA)\n\n\nmight be clearer than\n\n  CameraTest(kCamId_, true);\n\n\nThough the ISOLATED_IPA name is also debatable, and might end up being\nflags? But if it's only the one flag for now ... that's overkill anyway.\n\n\n>>  {\n>>  \tcm_ = new CameraManager();\n>>  \n>> +\tif (isolate)\n>> +\t\tsetenv(\"LIBCAMERA_IPA_FORCE_ISOLATION\", \"TRUE\", 1);\n>> +\n> \n> Ahh nice. Good so we can now isolate IPA's from tests!\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> \n> \n>>  \tif (cm_->start()) {\n>>  \t\tcerr << \"Failed to start camera manager\" << endl;\n>>  \t\tstatus_ = TestFail;\n>> diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h\n>> index 7939798f..f56e343e 100644\n>> --- a/test/libtest/camera_test.h\n>> +++ b/test/libtest/camera_test.h\n>> @@ -17,7 +17,7 @@ using namespace libcamera;\n>>  class CameraTest\n>>  {\n>>  public:\n>> -\tCameraTest(const char *name);\n>> +\tCameraTest(const char *name, bool isolate = false);\n>>  \t~CameraTest();\n>>  \n>>  protected:\n>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 14810BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Aug 2021 12:44:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8ED7A68894;\n\tTue, 17 Aug 2021 14:44:54 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F2916025C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Aug 2021 14:44:53 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 929302C5;\n\tTue, 17 Aug 2021 14:44:52 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"v4VFm6Ae\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629204292;\n\tbh=nYTzpuEbwe8EEjHvxsIethlE0sutW90T5ROFwHy/Joc=;\n\th=Subject:From:To:References:Reply-To:Date:In-Reply-To:From;\n\tb=v4VFm6AeDmzcyq2tcLA1GNH2u+c4iM5yBtIez6Wy5FA6tLkK8DMdj+9WY+uC99Yq5\n\t4pakSdH+7je5NE4ro7Tv9ESh2lMtOMKSmbEHugvE6Yo0RqDQh3TlwVRpX5TY2ujC4R\n\tkJ+Rz8doG3Nx8OJBXEcUa59au28biG83bWn72WXg=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210817122646.185978-1-umang.jain@ideasonboard.com>\n\t<20210817122646.185978-2-umang.jain@ideasonboard.com>\n\t<3756e278-ac98-800f-56cf-e01c6df0c37a@ideasonboard.com>","Organization":"Ideas on Board","Message-ID":"<b5095423-c3b8-3a23-c2f1-1ebace92a971@ideasonboard.com>","Date":"Tue, 17 Aug 2021 13:44:50 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<3756e278-ac98-800f-56cf-e01c6df0c37a@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Reply-To":"kieran.bingham@ideasonboard.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18869,"web_url":"https://patchwork.libcamera.org/comment/18869/","msgid":"<YRuxYQ+WWsgQl71r@pendragon.ideasonboard.com>","date":"2021-08-17T12:53:53","subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hello,\n\nOn Tue, Aug 17, 2021 at 01:44:50PM +0100, Kieran Bingham wrote:\n> On 17/08/2021 13:29, Kieran Bingham wrote:\n> > On 17/08/2021 13:26, Umang Jain wrote:\n> >> Some tests might require to have LIBCAMERA_IPA_FORCE_ISOLATION set\n> >> to ensure they can test the IPA running in isolated mode. These tests\n> >> are likely to leverage CameraTest. The environment variable should\n> >> be set before CameraManager::start() call which happens in CameraTest's\n> >> constructor. Hence, plumb the constructor with a flag so that the\n> >> LIBCAMERA_IPA_FORCE_ISOLATION can be set before CameraManager::start().\n> >>\n> >> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> >> ---\n> >>  test/libtest/camera_test.cpp | 5 ++++-\n> >>  test/libtest/camera_test.h   | 2 +-\n> >>  2 files changed, 5 insertions(+), 2 deletions(-)\n> >>\n> >> diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp\n> >> index 2ae4d677..9cbc4d82 100644\n> >> --- a/test/libtest/camera_test.cpp\n> >> +++ b/test/libtest/camera_test.cpp\n> >> @@ -13,10 +13,13 @@\n> >>  using namespace libcamera;\n> >>  using namespace std;\n> >>  \n> >> -CameraTest::CameraTest(const char *name)\n> >> +CameraTest::CameraTest(const char *name, bool isolate)\n> \n> Reading this where it is used, I wonder if this flag should be an enum,\n> but it's not essential - and more a question for debate.\n> \n> i.e.\n>   CameraTest(kCamId_, ISOLATED_IPA)\n> \n> \n> might be clearer than\n> \n>   CameraTest(kCamId_, true);\n> \n> \n> Though the ISOLATED_IPA name is also debatable, and might end up being\n> flags? But if it's only the one flag for now ... that's overkill anyway.\n\nBools are harmful at they're not very explicit when used as flags. If\nthis was a public API I'd propose fixing it already, but for an internal\nAPI my standards are a bit lower.\n\nIf we want an enum, the enumerator should be named in CamelCase, not\nSNAKE_CASE.\n\n> >>  {\n> >>  \tcm_ = new CameraManager();\n> >>  \n> >> +\tif (isolate)\n> >> +\t\tsetenv(\"LIBCAMERA_IPA_FORCE_ISOLATION\", \"TRUE\", 1);\n\nThe example in the documentation sets the value to \"1\", not \"TRUE\", so\nI'd do the same here.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >> +\n> > \n> > Ahh nice. Good so we can now isolate IPA's from tests!\n> > \n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> >>  \tif (cm_->start()) {\n> >>  \t\tcerr << \"Failed to start camera manager\" << endl;\n> >>  \t\tstatus_ = TestFail;\n> >> diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h\n> >> index 7939798f..f56e343e 100644\n> >> --- a/test/libtest/camera_test.h\n> >> +++ b/test/libtest/camera_test.h\n> >> @@ -17,7 +17,7 @@ using namespace libcamera;\n> >>  class CameraTest\n> >>  {\n> >>  public:\n> >> -\tCameraTest(const char *name);\n> >> +\tCameraTest(const char *name, bool isolate = false);\n> >>  \t~CameraTest();\n> >>  \n> >>  protected:\n> >>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 09A28BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Aug 2021 12:54:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 802C76888F;\n\tTue, 17 Aug 2021 14:54:02 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A32B76025C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Aug 2021 14:54:00 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1A3122C5;\n\tTue, 17 Aug 2021 14:54:00 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"dvmqIEGc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629204840;\n\tbh=gs/tXj0jhTYiqJkXj7DpdJOs++Ut8dLAiVsormBzkGE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=dvmqIEGcy4tFz6UM3feZ0zevl786eo1Sj9QspGLfacTFxlL2xakgAZigRzkhyvhnd\n\t5Fv7NB4ulacbfC2WkGWhqN84VpmJcrg6wiuIbl75Bu5vhnZULVJgr+2ib9KbyMNf4R\n\thRGMXrYf9/5CYz8QX4xJluvoW2x2MtvMxD35PrA0=","Date":"Tue, 17 Aug 2021 15:53:53 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YRuxYQ+WWsgQl71r@pendragon.ideasonboard.com>","References":"<20210817122646.185978-1-umang.jain@ideasonboard.com>\n\t<20210817122646.185978-2-umang.jain@ideasonboard.com>\n\t<3756e278-ac98-800f-56cf-e01c6df0c37a@ideasonboard.com>\n\t<b5095423-c3b8-3a23-c2f1-1ebace92a971@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<b5095423-c3b8-3a23-c2f1-1ebace92a971@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18873,"web_url":"https://patchwork.libcamera.org/comment/18873/","msgid":"<0d64cc75-91b0-1442-318f-eaed73ab7a4e@ideasonboard.com>","date":"2021-08-17T14:44:37","subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Kieran\n\nOn 8/17/21 6:14 PM, Kieran Bingham wrote:\n> On 17/08/2021 13:29, Kieran Bingham wrote:\n>> Hi Umang,\n>>\n>> On 17/08/2021 13:26, Umang Jain wrote:\n>>> Some tests might require to have LIBCAMERA_IPA_FORCE_ISOLATION set\n>>> to ensure they can test the IPA running in isolated mode. These tests\n>>> are likely to leverage CameraTest. The environment variable should\n>>> be set before CameraManager::start() call which happens in CameraTest's\n>>> constructor. Hence, plumb the constructor with a flag so that the\n>>> LIBCAMERA_IPA_FORCE_ISOLATION can be set before CameraManager::start().\n>>>\n>>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>>> ---\n>>>   test/libtest/camera_test.cpp | 5 ++++-\n>>>   test/libtest/camera_test.h   | 2 +-\n>>>   2 files changed, 5 insertions(+), 2 deletions(-)\n>>>\n>>> diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp\n>>> index 2ae4d677..9cbc4d82 100644\n>>> --- a/test/libtest/camera_test.cpp\n>>> +++ b/test/libtest/camera_test.cpp\n>>> @@ -13,10 +13,13 @@\n>>>   using namespace libcamera;\n>>>   using namespace std;\n>>>   \n>>> -CameraTest::CameraTest(const char *name)\n>>> +CameraTest::CameraTest(const char *name, bool isolate)\n> Reading this where it is used, I wonder if this flag should be an enum,\n> but it's not essential - and more a question for debate.\n>\n> i.e.\n>    CameraTest(kCamId_, ISOLATED_IPA)\n>\n>\n> might be clearer than\n>\n>    CameraTest(kCamId_, true);\n>\n>\n> Though the ISOLATED_IPA name is also debatable, and might end up being\n> flags? But if it's only the one flag for now ... that's overkill anyway.\n\n\nIn process of writing this, I actually envisioned that a map of \nenvironment variables that can be passed in to CameraTest that needed to \nbe setenv() before CameraManager::start()\n\nHowever, my thought process was the same, that is overkill for one \nenvironment variable.\n\n\n>\n>\n>>>   {\n>>>   \tcm_ = new CameraManager();\n>>>   \n>>> +\tif (isolate)\n>>> +\t\tsetenv(\"LIBCAMERA_IPA_FORCE_ISOLATION\", \"TRUE\", 1);\n>>> +\n>> Ahh nice. Good so we can now isolate IPA's from tests!\n>>\n>> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>>\n>>\n>>\n>>>   \tif (cm_->start()) {\n>>>   \t\tcerr << \"Failed to start camera manager\" << endl;\n>>>   \t\tstatus_ = TestFail;\n>>> diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h\n>>> index 7939798f..f56e343e 100644\n>>> --- a/test/libtest/camera_test.h\n>>> +++ b/test/libtest/camera_test.h\n>>> @@ -17,7 +17,7 @@ using namespace libcamera;\n>>>   class CameraTest\n>>>   {\n>>>   public:\n>>> -\tCameraTest(const char *name);\n>>> +\tCameraTest(const char *name, bool isolate = false);\n>>>   \t~CameraTest();\n>>>   \n>>>   protected:\n>>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B1B3CBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Aug 2021 14:44:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ED9A2688A3;\n\tTue, 17 Aug 2021 16:44:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D3F6C6025C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Aug 2021 16:44:42 +0200 (CEST)","from [192.168.1.104] (unknown [103.238.109.15])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 020E72C5;\n\tTue, 17 Aug 2021 16:44:41 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mZOZ7mWD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629211482;\n\tbh=u2LkP+kjc8hmNWzolUP0s7gM8sP19ouAf4BRu2tv7Q0=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=mZOZ7mWDR5M50jqPxpKZ1o5TDdI1JA1sIJqLAZMh4skAp/9Q8Zi+9g/NkxtsrzdTs\n\tv+Yq2IDV0KJvZrgEG0+j73oEH8xvFxZYQevz/FSsvja0Yqy9eL24259ghm6+NuKRbI\n\tDpueJMbvVcCVgwKKUn0hL+z/osNIi3rtwM0sCJ6I=","To":"kieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org","References":"<20210817122646.185978-1-umang.jain@ideasonboard.com>\n\t<20210817122646.185978-2-umang.jain@ideasonboard.com>\n\t<3756e278-ac98-800f-56cf-e01c6df0c37a@ideasonboard.com>\n\t<b5095423-c3b8-3a23-c2f1-1ebace92a971@ideasonboard.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<0d64cc75-91b0-1442-318f-eaed73ab7a4e@ideasonboard.com>","Date":"Tue, 17 Aug 2021 20:14:37 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<b5095423-c3b8-3a23-c2f1-1ebace92a971@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18893,"web_url":"https://patchwork.libcamera.org/comment/18893/","msgid":"<20210818031351.GI1733965@pyrite.rasen.tech>","date":"2021-08-18T03:13:51","subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Umang,\n\nOn Tue, Aug 17, 2021 at 05:56:45PM +0530, Umang Jain wrote:\n> Some tests might require to have LIBCAMERA_IPA_FORCE_ISOLATION set\n> to ensure they can test the IPA running in isolated mode. These tests\n> are likely to leverage CameraTest. The environment variable should\n> be set before CameraManager::start() call which happens in CameraTest's\n> constructor. Hence, plumb the constructor with a flag so that the\n> LIBCAMERA_IPA_FORCE_ISOLATION can be set before CameraManager::start().\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  test/libtest/camera_test.cpp | 5 ++++-\n>  test/libtest/camera_test.h   | 2 +-\n>  2 files changed, 5 insertions(+), 2 deletions(-)\n> \n> diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp\n> index 2ae4d677..9cbc4d82 100644\n> --- a/test/libtest/camera_test.cpp\n> +++ b/test/libtest/camera_test.cpp\n> @@ -13,10 +13,13 @@\n>  using namespace libcamera;\n>  using namespace std;\n>  \n> -CameraTest::CameraTest(const char *name)\n> +CameraTest::CameraTest(const char *name, bool isolate)\n>  {\n>  \tcm_ = new CameraManager();\n>  \n> +\tif (isolate)\n> +\t\tsetenv(\"LIBCAMERA_IPA_FORCE_ISOLATION\", \"TRUE\", 1);\n> +\n>  \tif (cm_->start()) {\n>  \t\tcerr << \"Failed to start camera manager\" << endl;\n>  \t\tstatus_ = TestFail;\n> diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h\n> index 7939798f..f56e343e 100644\n> --- a/test/libtest/camera_test.h\n> +++ b/test/libtest/camera_test.h\n> @@ -17,7 +17,7 @@ using namespace libcamera;\n>  class CameraTest\n>  {\n>  public:\n> -\tCameraTest(const char *name);\n> +\tCameraTest(const char *name, bool isolate = false);\n>  \t~CameraTest();\n>  \n>  protected:\n> -- \n> 2.31.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 16ADFBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Aug 2021 03:14:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8EE1E68894;\n\tWed, 18 Aug 2021 05:14:00 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E46260505\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Aug 2021 05:13:59 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 873DE466;\n\tWed, 18 Aug 2021 05:13:57 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sV2OL1fy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629256438;\n\tbh=kRV6rGGbqPOTu3YZZHvVPSv1bld2rKoYhHKm1nOzfj8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sV2OL1fyGy2flhrwt9bFtnZDLpbVu4ihRakTKQUpO45rXpiKThNOba9bstrQkdFPR\n\t7gjNze+oMrcyfiABGI/Yy6ru5MU8b5GNUiHOyYmIs/6mtFA/uGUY/2EVt0h+1l2JOc\n\tLtaChNJLh6258KctDDc2YVPxYYBIIhFdLxZyx6fs=","Date":"Wed, 18 Aug 2021 12:13:51 +0900","From":"paul.elder@ideasonboard.com","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<20210818031351.GI1733965@pyrite.rasen.tech>","References":"<20210817122646.185978-1-umang.jain@ideasonboard.com>\n\t<20210817122646.185978-2-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20210817122646.185978-2-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/2] libtest: camera_test: Plumb\n\tconstructor to set LIBCAMERA_IPA_FORCE_ISOLATION","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]