From 02537089d875449957722153ab65932aea4ddeb3 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Tue, 1 Jul 2025 11:15:17 +0200 Subject: [PATCH] stage/ovf: additional schema tests Adds tests to more thoroughly look at the vmware and virtualbox schemas by passing wrong types. Signed-off-by: Simon de Vlieger --- stages/test/test_ovf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stages/test/test_ovf.py b/stages/test/test_ovf.py index a36f37d2..189cc97a 100644 --- a/stages/test/test_ovf.py +++ b/stages/test/test_ovf.py @@ -13,8 +13,11 @@ STAGE_NAME = "org.osbuild.ovf" ({}, "'vmdk' is a required property"), ({"vmdk": 123}, "123 is not of type 'string'"), ({"vmdk": "imagename"}, "'imagename' does not match '[a-zA-Z0-9+_.-]+.vmdk'"), + ({"vmdk": "imagename.vmdk", "vmware": {"os_type": 1}}, "is not of type 'string'"), + ({"vmdk": "imagename.vmdk", "virtualbox": {"os_type": 1}}, "is not of type 'string'"), # Good API parameters ({"vmdk": "imagename.vmdk"}, ""), + ({"vmdk": "imagename.vmdk", "vmware": {"os_type": "OtherGuest"}, "virtualbox": {"os_type": "OtherGuest"}}, ""), ]) # This test validates only API calls using correct and incorrect queries def test_schema_validation_ovf(stage_schema, test_data, expected_err):