[libcamera-devel] [PATCH 2/2] tests: v4l2_compat: Check v4l2-compliance and v4l2-ctl versions
paul.elder at ideasonboard.com
paul.elder at ideasonboard.com
Sat Jul 11 07:35:00 CEST 2020
Hi me,
On Fri, Jul 10, 2020 at 11:15:08PM +0900, Paul Elder wrote:
> v4l2-compliance and v4l2-ctl with version 1.20 and before will fail with
> v4l2-compat. Check the versions of v4l2-compliance and v4l2-ctl before
> continuing, though since neither of them currently are able to print
> their version, simply checking if they can do so is sufficient.
>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
>
> ---
> Obviously this depends on v4l2-compliance and v4l2-ctl having --version,
> so that needs to be accepted first before this can be merged.
> ---
> test/v4l2_compat/v4l2_compat_test.py | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py
> index 8a8e59e..c97ae79 100755
> --- a/test/v4l2_compat/v4l2_compat_test.py
> +++ b/test/v4l2_compat/v4l2_compat_test.py
> @@ -98,11 +98,21 @@ def main(argv):
> print('v4l2-compliance is not available')
> return TestSkip
>
> + ret, _ = run_with_stdout(v4l2_compliance, '--version')
> + if (ret != 0):
> + print('v4l2-compliance version >= 1.21.0 required')
> + return TestSkip
> +
It just occurred to me that stuff might be backported in v4l-utils, so
to prepare for the case that --version might be backported, we should
still actually check the version.
> v4l2_ctl = shutil.which('v4l2-ctl')
> if v4l2_ctl is None:
> print('v4l2-ctl is not available')
> return TestSkip
>
> + ret, _ = run_with_stdout(v4l2_ctl, '--version')
> + if (ret != 0):
> + print('v4l2-ctl version >= 1.21.0 required')
> + return TestSkip
> +
> dev_nodes = glob.glob('/dev/video*')
> if len(dev_nodes) == 0:
> print('no video nodes available to test with')
> --
> 2.27.0
>
Paul
More information about the libcamera-devel
mailing list