From 308e7f1352bfdab8cc90be78a82b7ce4195301bc Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Mon, 12 Jun 2023 15:00:55 +0200 Subject: Add kernel driver version check in driver library The driver library will now check that it's compatible with the kernel driver in use by checking the kernel driver's version. The kernel driver version has also been made available to the library users and the Python wrapper has been updated accordingly. Change-Id: Ieae8c0bfc323f945038e7264eceeab90c833f76d Signed-off-by: Mikael Olsson --- driver_library/python/test/test_driver.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'driver_library/python/test') diff --git a/driver_library/python/test/test_driver.py b/driver_library/python/test/test_driver.py index 5496aed..e4e276a 100644 --- a/driver_library/python/test/test_driver.py +++ b/driver_library/python/test/test_driver.py @@ -1,5 +1,5 @@ # -# SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 # import pytest @@ -177,3 +177,14 @@ def test_capabilities(device): assert cap.hwId assert cap.hwCfg assert cap.driver + +@pytest.mark.parametrize('device_name', ['ethosu0']) +def test_kernel_driver_version(device): + version = device.getDriverVersion() + zero_version = [0, 0, 0] + # Validate that a version was returned + assert zero_version != [version.major, version.minor, version.patch] + # Check that supported kernel driver major versions are available in Python API + assert driver.MAX_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION + assert driver.MIN_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION + -- cgit v1.2.1