diff --git a/stages/org.osbuild.cloud-init.meta.json b/stages/org.osbuild.cloud-init.meta.json index 773810a9..acd8eeae 100644 --- a/stages/org.osbuild.cloud-init.meta.json +++ b/stages/org.osbuild.cloud-init.meta.json @@ -93,6 +93,8 @@ "enum": [ "Azure", "Ec2", + "NoCloud", + "WSL", "None" ] } @@ -136,6 +138,18 @@ "type": "string" } } + }, + "network": { + "type": "object", + "minProperties": 1, + "properties": { + "config": { + "type": "string", + "enum": [ + "disabled" + ] + } + } } } } diff --git a/stages/test/test_cloud-init.py b/stages/test/test_cloud-init.py index 9a7f8bc9..a46d7338 100644 --- a/stages/test/test_cloud-init.py +++ b/stages/test/test_cloud-init.py @@ -24,3 +24,22 @@ def test_cloud_init_datasource_list_single_line(tmp_path, stage_module): stage_module.main(treedir, options) assert os.path.exists(confpath) assert confpath.read_text() == "datasource_list: [Azure]\n" + + +def test_cloud_init_network(tmp_path, stage_module): + treedir = tmp_path / "tree" + confpath = treedir / "etc/cloud/cloud.cfg.d/network.cfg" + confpath.parent.mkdir(parents=True, exist_ok=True) + + options = { + "filename": confpath.name, + "config": { + "network": { + "config": "disabled", + }, + }, + } + + stage_module.main(treedir, options) + assert os.path.exists(confpath) + assert confpath.read_text() == "network:\n config: disabled\n"