From 09f5cc6d163c01145c2a19095a0aa42cfa539bdc Mon Sep 17 00:00:00 2001 From: Martin Kepplinger Date: Thu, 30 Sep 2021 10:34:58 +0200 Subject: [PATCH] test_cameras: update for newer kernels Linux 5.15 and later include new media csi drivers. Rename the test files to be a bit more descriptive. we test raw i2c communication in test_cameras_i2c.py and test the (new) media control and v4l2 interface in test_cameras_api.py. --- pytests/test_camera.py | 8 -------- pytests/test_cameras_api.py | 11 +++++++++++ pytests/{test_cameras.py => test_cameras_i2c.py} | 0 3 files changed, 11 insertions(+), 8 deletions(-) delete mode 100644 pytests/test_camera.py create mode 100644 pytests/test_cameras_api.py rename pytests/{test_cameras.py => test_cameras_i2c.py} (100%) diff --git a/pytests/test_camera.py b/pytests/test_camera.py deleted file mode 100644 index 6c3c53d..0000000 --- a/pytests/test_camera.py +++ /dev/null @@ -1,8 +0,0 @@ -import subprocess - - -def test_csi(): - out = subprocess.check_output(['v4l2-ctl', '-D', '-d', '/dev/video0']) - assert(b'i.MX6S_CSI' in out) - assert(b"\tVideo Capture" in out) - assert(b"\tStreaming" in out) diff --git a/pytests/test_cameras_api.py b/pytests/test_cameras_api.py new file mode 100644 index 0000000..0c799b2 --- /dev/null +++ b/pytests/test_cameras_api.py @@ -0,0 +1,11 @@ +import subprocess + + +def test_front(): + out = subprocess.check_output(['v4l2-ctl', '--media-bus-info', 'platform:30a90000.csi', '--device', 'hi846 2-0020', '--all']) + assert(b"analogue_gain" in out) + + +def test_rear(): + out = subprocess.check_output(['v4l2-ctl', '--media-bus-info', 'platform:30b80000.csi', '--device', 's5k3l6xx 3-002d', '--all']) + assert(b"analogue_gain" in out) diff --git a/pytests/test_cameras.py b/pytests/test_cameras_i2c.py similarity index 100% rename from pytests/test_cameras.py rename to pytests/test_cameras_i2c.py -- GitLab