stages: remove test_schema_supports_bootc_style_mounts tests

With PR#1727 merged there is no need to test for individual stages
if they support the bootc style mounting in their schema. All
stages now support devices/mounts now. So let's remove this
redundant code.
This commit is contained in:
Michael Vogt 2024-04-16 08:45:16 +02:00
parent 5da9a2fb63
commit 11d41ab5a2
4 changed files with 0 additions and 57 deletions

View file

@ -43,39 +43,3 @@ def stage_schema(request: pytest.FixtureRequest) -> osbuild.meta.Schema:
root = caller_dir.parent.parent
mod_info = osbuild.meta.ModuleInfo.load(root, "Stage", stage_name)
return osbuild.meta.Schema(mod_info.get_schema(version=schema_version), stage_name)
@pytest.fixture
def bootc_devices_mounts_dict() -> dict:
""" bootc_devices_mounts_dict returns a dict with a typical bootc
devices/mount dict
"""
return {
"devices": {
"disk": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.raw",
"partscan": True,
}
}
},
"mounts": [
{
"name": "root",
"type": "org.osbuild.ext4",
"source": "disk",
"partition": 4,
"target": "/"
}, {
"name": "ostree.deployment",
"type": "org.osbuild.ostree.deployment",
"options": {
"source": "mount",
"deployment": {
"default": True,
}
}
}
]
}

View file

@ -29,10 +29,3 @@ def test_schema_validation(stage_schema, test_data, expected_err):
else:
assert res.valid is False
assert_jsonschema_error_contains(res, expected_err, expected_num_errs=1)
def test_schema_supports_bootc_style_mounts(stage_schema, bootc_devices_mounts_dict):
test_input = bootc_devices_mounts_dict
test_input["type"] = STAGE_NAME
res = stage_schema.validate(test_input)
assert res.valid is True, f"err: {[e.as_dict() for e in res.errors]}"

View file

@ -48,13 +48,6 @@ def test_schema_validation_selinux_file_context_required(stage_schema):
testutil.assert_jsonschema_error_contains(res, expected_err, expected_num_errs=1)
def test_schema_supports_bootc_style_mounts(stage_schema, bootc_devices_mounts_dict):
test_input = bootc_devices_mounts_dict
test_input["type"] = STAGE_NAME
res = stage_schema.validate(test_input)
assert res.valid is True, f"err: {[e.as_dict() for e in res.errors]}"
@patch("osbuild.util.selinux.setfiles")
def test_selinux_file_contexts(mocked_setfiles, tmp_path, stage_module):
options = {

View file

@ -36,13 +36,6 @@ def test_schema_validation(stage_schema, test_data, expected_err):
assert_jsonschema_error_contains(res, expected_err, expected_num_errs=1)
def test_schema_supports_bootc_style_mounts(stage_schema, bootc_devices_mounts_dict):
test_input = bootc_devices_mounts_dict
test_input["type"] = STAGE_NAME
res = stage_schema.validate(test_input)
assert res.valid is True, f"err: {[e.as_dict() for e in res.errors]}"
TEST_CASES = [
# user_opts,expected commandline args
({}, []),