[v1] test: libtest: CameraTest: Set env var before CameraManager
diff mbox series

Message ID 20250714131326.1279434-1-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • [v1] test: libtest: CameraTest: Set env var before CameraManager
Related show

Commit Message

Barnabás Pőcze July 14, 2025, 1:13 p.m. UTC
Set the `LIBCAMERA_IPA_FORCE_ISOLATION` environmental variable
before constructing the `CameraManager` object. This makes it
available during construction (some components might want to
query environmental variables at that time).

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 test/libtest/camera_test.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart July 14, 2025, 1:20 p.m. UTC | #1
Hi Barnabás,

Thank you for the patch.

On Mon, Jul 14, 2025 at 03:13:26PM +0200, Barnabás Pőcze wrote:
> Set the `LIBCAMERA_IPA_FORCE_ISOLATION` environmental variable

s/environmental/environment/

(caring about environmental issues is important, but that's unrelated to
this patch :-))

> before constructing the `CameraManager` object. This makes it
> available during construction (some components might want to
> query environmental variables at that time).

Same here.

> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  test/libtest/camera_test.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp
> index fe13d6acf..6fb44989d 100644
> --- a/test/libtest/camera_test.cpp
> +++ b/test/libtest/camera_test.cpp
> @@ -15,11 +15,11 @@ using namespace std;
>  
>  CameraTest::CameraTest(const char *name, bool isolate)
>  {
> -	cm_ = new CameraManager();
> -
>  	if (isolate)
>  		setenv("LIBCAMERA_IPA_FORCE_ISOLATION", "1", 1);
>  
> +	cm_ = new CameraManager();
> +
>  	if (cm_->start()) {
>  		cerr << "Failed to start camera manager" << endl;
>  		status_ = TestFail;
Kieran Bingham July 14, 2025, 1:30 p.m. UTC | #2
Quoting Laurent Pinchart (2025-07-14 14:20:55)
> Hi Barnabás,
> 
> Thank you for the patch.
> 
> On Mon, Jul 14, 2025 at 03:13:26PM +0200, Barnabás Pőcze wrote:
> > Set the `LIBCAMERA_IPA_FORCE_ISOLATION` environmental variable
> 
> s/environmental/environment/
> 
> (caring about environmental issues is important, but that's unrelated to
> this patch :-))
> 
> > before constructing the `CameraManager` object. This makes it
> > available during construction (some components might want to
> > query environmental variables at that time).
> 
> Same here.
> 
> > 
> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Should be fine to fixup as you merge this - no need to send a v2 then ;-)



> > ---
> >  test/libtest/camera_test.cpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp
> > index fe13d6acf..6fb44989d 100644
> > --- a/test/libtest/camera_test.cpp
> > +++ b/test/libtest/camera_test.cpp
> > @@ -15,11 +15,11 @@ using namespace std;
> >  
> >  CameraTest::CameraTest(const char *name, bool isolate)
> >  {
> > -     cm_ = new CameraManager();
> > -
> >       if (isolate)
> >               setenv("LIBCAMERA_IPA_FORCE_ISOLATION", "1", 1);
> >  
> > +     cm_ = new CameraManager();
> > +
> >       if (cm_->start()) {
> >               cerr << "Failed to start camera manager" << endl;
> >               status_ = TestFail;
> 
> -- 
> Regards,
> 
> Laurent Pinchart

Patch
diff mbox series

diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp
index fe13d6acf..6fb44989d 100644
--- a/test/libtest/camera_test.cpp
+++ b/test/libtest/camera_test.cpp
@@ -15,11 +15,11 @@  using namespace std;
 
 CameraTest::CameraTest(const char *name, bool isolate)
 {
-	cm_ = new CameraManager();
-
 	if (isolate)
 		setenv("LIBCAMERA_IPA_FORCE_ISOLATION", "1", 1);
 
+	cm_ = new CameraManager();
+
 	if (cm_->start()) {
 		cerr << "Failed to start camera manager" << endl;
 		status_ = TestFail;