Skip to content

Commit

Permalink
stage: add test for core live-artifacts stage
Browse files Browse the repository at this point in the history
This commit adds some unit tests around the coreos live-artifcats
mono stage.
  • Loading branch information
mvo5 committed Dec 5, 2024
1 parent 6a6e9fd commit 9d312cb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions stages/test/test_coreos_live_artifacts_mono.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/python3

import tempfile
import textwrap

import pytest

STAGE_NAME = "org.osbuild.coreos.live-artifacts.mono"


def test_get_os_features(tmp_path, stage_module):
cfg_path = tmp_path / "usr/share/coreos-installer/example-config.yaml"
cfg_path.parent.mkdir(parents=True)
cfg_path.write_text(textwrap.dedent("""\
# Fedora CoreOS stream
stream: name
# Manually specify the image URL
image-url: URL
"""))
features = stage_module.get_os_features(tmp_path)
assert {
"installer-config": True,
"installer-config-directives": {
"stream": True,
"image-url": True,
},
"live-initrd-network": True,
} == features

0 comments on commit 9d312cb

Please sign in to comment.