summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-07-10 22:57:10 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-07-13 19:46:24 +0900
commit74c8b508338ccdd0780aa1e067a1e8fcb9ee326b (patch)
tree0f40240b3c3d12fab6357685ad1f01b279b42ac5
parentce32ca491884c4755e3cae0c7a6453a1f4933da2 (diff)
tests: v4l2_compat: Check v4l2-compliance and v4l2-ctl versions
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. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xtest/v4l2_compat/v4l2_compat_test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py
index 8aca2220..b054fe65 100755
--- a/test/v4l2_compat/v4l2_compat_test.py
+++ b/test/v4l2_compat/v4l2_compat_test.py
@@ -9,12 +9,15 @@
import argparse
import glob
import os
+from packaging import version
import re
import shutil
import signal
import subprocess
import sys
+MIN_V4L_UTILS_VERSION = version.parse("1.21.0")
+
TestPass = 0
TestFail = -1
TestSkip = 77
@@ -90,11 +93,21 @@ def main(argv):
print('v4l2-compliance is not available')
return TestSkip
+ ret, out = run_with_stdout(v4l2_compliance, '--version')
+ if (ret != 0 or version.parse(out[-2].split()[-1]) < MIN_V4L_UTILS_VERSION):
+ print('v4l2-compliance version >= 1.21.0 required')
+ return TestSkip
+
v4l2_ctl = shutil.which('v4l2-ctl')
if v4l2_ctl is None:
print('v4l2-ctl is not available')
return TestSkip
+ ret, out = run_with_stdout(v4l2_ctl, '--version')
+ if (ret != 0 or version.parse(out[-2].split()[-1]) < MIN_V4L_UTILS_VERSION):
+ 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')
a id='n168' href='#n168'>168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398
{
    "rpi.black_level":
    {
        "black_level": 1024
    },
    "rpi.dpc":
    {

    },
    "rpi.lux":
    {
        "reference_shutter_speed": 21663,
        "reference_gain": 1.0,
        "reference_aperture": 1.0,
        "reference_lux": 987,
        "reference_Y": 8961
    },
    "rpi.noise":
    {
        "reference_constant": 0,
        "reference_slope": 4.25
    },
    "rpi.geq":
    {
        "offset": 401,
        "slope": 0.05619
    },
    "rpi.sdn":
    {

    },
    "rpi.awb":
    {
        "priors":
        [
            {
                "lux": 0, "prior":
                [
                    2000, 1.0, 3000, 0.0, 13000, 0.0
                ]
            },
            {
                "lux": 800, "prior":
                [
                    2000, 0.0, 6000, 2.0, 13000, 2.0
                ]
            },
            {
                "lux": 1500, "prior":
                [
                    2000, 0.0, 4000, 1.0, 6000, 6.0, 6500, 7.0, 7000, 1.0, 13000, 1.0
                ]
            }
        ],
        "modes":
        {
            "auto":
            {
                "lo": 2500,
                "hi": 8000
            },
            "incandescent":
            {
                "lo": 2500,
                "hi": 3000
            },
            "tungsten":
            {
                "lo": 3000,
                "hi": 3500
            },
            "fluorescent":
            {
                "lo": 4000,
                "hi": 4700
            },
            "indoor":
            {
                "lo": 3000,
                "hi": 5000
            },
            "daylight":
            {
                "lo": 5500,
                "hi": 6500
            },
            "cloudy":
            {
                "lo": 7000,
                "hi": 8600
            }
        },
        "bayes": 1,
        "ct_curve":
        [
            2500.0, 1.0289, 0.4503, 2803.0, 0.9428, 0.5108, 2914.0, 0.9406, 0.5127, 3605.0, 0.8261, 0.6249, 4540.0, 0.7331, 0.7533, 5699.0,
            0.6715, 0.8627, 8625.0, 0.6081, 1.0012
        ],
        "sensitivity_r": 1.05,
        "sensitivity_b": 1.05,
        "transverse_pos": 0.0321,
        "transverse_neg": 0.04313
    },
    "rpi.agc":
    {
        "metering_modes":
        {
            "centre-weighted":
            {
                "weights":
                [
                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0
                ]
            },
            "spot":
            {
                "weights":
                [
                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                ]
            },
            "matrix":
            {
                "weights":
                [
                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
                ]
            }
        },
        "exposure_modes":
        {
            "normal":
            {
                "shutter":
                [
                    100, 10000, 30000, 30000, 30000
                ],
                "gain":
                [
                    1.0, 2.0, 4.0, 6.0, 6.0
                ]
            },
            "short":
            {
                "shutter":
                [
                    100, 5000, 10000, 20000, 30000
                ],
                "gain":
                [
                    1.0, 2.0, 4.0, 6.0, 6.0
                ]
            }
        },
        "constraint_modes":
        {
            "normal":
            [
                {
                    "bound": "LOWER", "q_lo": 0.98, "q_hi": 1.0, "y_target":
                    [
                        0, 0.5, 1000, 0.5
                    ]
                }
            ],
            "highlight":
            [
                {
                    "bound": "LOWER", "q_lo": 0.98, "q_hi": 1.0, "y_target":
                    [
                        0, 0.5, 1000, 0.5
                    ]
                },
                {
                    "bound": "UPPER", "q_lo": 0.98, "q_hi": 1.0, "y_target":
                    [
                        0, 0.8, 1000, 0.8
                    ]
                }
            ],
	    "shadows":
	    [
		{
		    "bound": "LOWER", "q_lo": 0.0, "q_hi": 0.5, "y_target":
                    [
                        0, 0.17, 1000, 0.17
                    ]
                }
            ]
        },
        "y_target":
        [
            0, 0.16, 1000, 0.165, 10000, 0.17
        ],
	"base_ev": 1.25
    },
    "rpi.alsc":
    {
        "omega": 1.3,
        "n_iter": 100,
        "luminance_strength": 0.5,
        "calibrations_Cr":
        [
            {
                "ct": 3000, "table":
                [
                    1.105, 1.103, 1.093, 1.083, 1.071, 1.065, 1.065, 1.065, 1.066, 1.069, 1.072, 1.077, 1.084, 1.089, 1.093, 1.093,
                    1.103, 1.096, 1.084, 1.072, 1.059, 1.051, 1.047, 1.047, 1.051, 1.053, 1.059, 1.067, 1.075, 1.082, 1.085, 1.086,
                    1.096, 1.084, 1.072, 1.059, 1.051, 1.045, 1.039, 1.038, 1.039, 1.045, 1.049, 1.057, 1.063, 1.072, 1.081, 1.082,
                    1.092, 1.075, 1.061, 1.052, 1.045, 1.039, 1.036, 1.035, 1.035, 1.039, 1.044, 1.049, 1.056, 1.063, 1.072, 1.081,
                    1.092, 1.073, 1.058, 1.048, 1.043, 1.038, 1.035, 1.033, 1.033, 1.035, 1.039, 1.044, 1.051, 1.057, 1.069, 1.078,
                    1.091, 1.068, 1.054, 1.045, 1.041, 1.038, 1.035, 1.032, 1.032, 1.032, 1.036, 1.041, 1.045, 1.055, 1.069, 1.078,
                    1.091, 1.068, 1.052, 1.043, 1.041, 1.038, 1.035, 1.032, 1.031, 1.032, 1.034, 1.036, 1.043, 1.055, 1.069, 1.078,
                    1.092, 1.068, 1.052, 1.047, 1.042, 1.041, 1.038, 1.035, 1.032, 1.032, 1.035, 1.039, 1.043, 1.055, 1.071, 1.079,
                    1.092, 1.073, 1.057, 1.051, 1.047, 1.047, 1.044, 1.041, 1.038, 1.038, 1.039, 1.043, 1.051, 1.059, 1.076, 1.083,
                    1.092, 1.081, 1.068, 1.058, 1.056, 1.056, 1.053, 1.052, 1.049, 1.048, 1.048, 1.051, 1.059, 1.066, 1.083, 1.085,
                    1.091, 1.087, 1.081, 1.068, 1.065, 1.064, 1.062, 1.062, 1.061, 1.056, 1.056, 1.056, 1.064, 1.069, 1.084, 1.089,
                    1.091, 1.089, 1.085, 1.079, 1.069, 1.068, 1.067, 1.067, 1.067, 1.063, 1.061, 1.063, 1.068, 1.069, 1.081, 1.092
                ]
            },
            {
                "ct": 5000, "table":
                [
                    1.486, 1.484, 1.468, 1.449, 1.427, 1.403, 1.399, 1.399, 1.399, 1.404, 1.413, 1.433, 1.454, 1.473, 1.482, 1.488,
                    1.484, 1.472, 1.454, 1.431, 1.405, 1.381, 1.365, 1.365, 1.367, 1.373, 1.392, 1.411, 1.438, 1.458, 1.476, 1.481,
                    1.476, 1.458, 1.433, 1.405, 1.381, 1.361, 1.339, 1.334, 1.334, 1.346, 1.362, 1.391, 1.411, 1.438, 1.462, 1.474,
                    1.471, 1.443, 1.417, 1.388, 1.361, 1.339, 1.321, 1.313, 1.313, 1.327, 1.346, 1.362, 1.391, 1.422, 1.453, 1.473,
                    1.469, 1.439, 1.408, 1.377, 1.349, 1.321, 1.312, 1.299, 1.299, 1.311, 1.327, 1.348, 1.378, 1.415, 1.446, 1.468,
                    1.468, 1.434, 1.402, 1.371, 1.341, 1.316, 1.299, 1.296, 1.295, 1.299, 1.314, 1.338, 1.371, 1.408, 1.441, 1.466,
                    1.468, 1.434, 1.401, 1.371, 1.341, 1.316, 1.301, 1.296, 1.295, 1.297, 1.314, 1.338, 1.369, 1.408, 1.441, 1.465,
                    1.469, 1.436, 1.401, 1.374, 1.348, 1.332, 1.315, 1.301, 1.301, 1.313, 1.324, 1.342, 1.372, 1.409, 1.442, 1.465,
                    1.471, 1.444, 1.413, 1.388, 1.371, 1.348, 1.332, 1.323, 1.323, 1.324, 1.342, 1.362, 1.386, 1.418, 1.449, 1.467,
                    1.473, 1.454, 1.431, 1.407, 1.388, 1.371, 1.359, 1.352, 1.351, 1.351, 1.362, 1.383, 1.404, 1.433, 1.462, 1.472,
                    1.474, 1.461, 1.447, 1.424, 1.407, 1.394, 1.385, 1.381, 1.379, 1.381, 1.383, 1.401, 1.419, 1.444, 1.466, 1.481,
                    1.474, 1.464, 1.455, 1.442, 1.421, 1.408, 1.403, 1.403, 1.403, 1.399, 1.402, 1.415, 1.432, 1.446, 1.467, 1.483
                ]
            },
            {
                "ct": 6500, "table":