cook: two default dishes (phyllomeos, phyllomeos-headless) + guest/experimental tiers; CI builds raw images
Manifest groups get a tier; only `default` is generated (make all TIER=..., --tier). Default: phyllomeos (GNOME + virt-manager) and phyllomeos-headless, Fedora 44, systemd-boot, CPU-agnostic hypervisor ingredient (hypervisor_type: any). guest tier: guest-server, guest-desktop. experimental: biosboot/grub, encrypted, rawhide. Generator clears stale recipes/dishes before writing. build-image.sh: --dish and --tier; deploy.sh: --tier. build-iso.yaml replaced by build-image.yaml: raw images for both editions on the fedora:host runner (TMPDIR=/var/tmp, max-parallel 1), attached with the flattened kickstarts to tagged releases. Live edition no longer built. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
35d8879bcc
commit
67316d9852
@@ -278,4 +278,77 @@ def test_generate_writes_recipes_and_dishes(tmp_path, templates):
|
||||
assert len(list(recipes.glob("*.cfg"))) == 1
|
||||
assert len(list(dishes.glob("*.cfg"))) == 1
|
||||
dish = (dishes / "desktop_43_standard_grub_gnome.cfg").read_text()
|
||||
assert "%include" not in dish
|
||||
assert "%include" not in dish
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# tiers and the real manifest
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def real_manifest():
|
||||
return gen.load_yaml(os.path.join(COOK_DIR, "recipes_manifest.yaml"))
|
||||
|
||||
|
||||
def dish_names(manifest, templates, tiers):
|
||||
return sorted(
|
||||
gen.render_filename(templates, group["name"], variant)
|
||||
for group in gen.select_groups(manifest, tiers)
|
||||
for config in group["variants"]
|
||||
for variant in gen.expand_variants(config))
|
||||
|
||||
|
||||
def test_select_groups_defaults_untiered_groups_to_default():
|
||||
manifest = {"recipes": [{"name": "a"}, {"name": "b", "tier": "guest"}]}
|
||||
assert [g["name"] for g in gen.select_groups(manifest, ("default",))] == ["a"]
|
||||
assert [g["name"] for g in gen.select_groups(manifest, ("guest",))] == ["b"]
|
||||
assert [g["name"] for g in gen.select_groups(manifest, ("all",))] == ["a", "b"]
|
||||
|
||||
|
||||
def test_real_manifest_lints_clean_across_all_tiers(templates):
|
||||
problems = gen.lint_manifest(real_manifest(), templates,
|
||||
os.path.join(COOK_DIR, "ingredients"))
|
||||
assert problems == []
|
||||
|
||||
|
||||
def test_default_tier_is_the_two_editions(templates):
|
||||
names = dish_names(real_manifest(), templates, ("default",))
|
||||
assert len(names) == 2
|
||||
assert sorted(n.split("_")[0] for n in names) == ["phyllomeos", "phyllomeos-headless"]
|
||||
|
||||
|
||||
def test_guest_tier_is_server_and_desktop(templates):
|
||||
names = dish_names(real_manifest(), templates, ("guest",))
|
||||
assert sorted(n.split("_")[0] for n in names) == ["guest-desktop", "guest-server"]
|
||||
assert all("guest-agents" in n for n in names)
|
||||
|
||||
|
||||
def test_shipping_dishes_contents(templates):
|
||||
manifest = real_manifest()
|
||||
for group in gen.select_groups(manifest, ("default",)):
|
||||
variant = gen.expand_variants(group["variants"][0])[0]
|
||||
fragments, problems = gen.collect_fragments(templates, variant)
|
||||
assert problems == []
|
||||
assert "hypervisor/cpu-agnostic.ks" in fragments
|
||||
assert "bootloader/systemd-boot.ks" in fragments
|
||||
assert "storage/standard.ks" in fragments
|
||||
assert ("desktop/gnome/config.ks" in fragments) == (group["name"] == "phyllomeos")
|
||||
|
||||
|
||||
def test_generate_only_writes_requested_tier_and_clears_stale(tmp_path):
|
||||
(tmp_path / "ingredients").symlink_to(os.path.join(COOK_DIR, "ingredients"),
|
||||
target_is_directory=True)
|
||||
recipes = tmp_path / "recipes"
|
||||
dishes = tmp_path / "dishes"
|
||||
recipes.mkdir()
|
||||
dishes.mkdir()
|
||||
(dishes / "stale.cfg").write_text("stale")
|
||||
(recipes / "stale.cfg").write_text("stale")
|
||||
templates_path = os.path.join(COOK_DIR, "recipe_templates.yaml")
|
||||
manifest_path = os.path.join(COOK_DIR, "recipes_manifest.yaml")
|
||||
|
||||
code = gen.generate(manifest_path, templates_path, str(recipes), str(dishes),
|
||||
"ingredients", tiers=("guest",))
|
||||
assert code == 0
|
||||
names = sorted(p.name.split("_")[0] for p in dishes.glob("*.cfg"))
|
||||
assert names == ["guest-desktop", "guest-server"]
|
||||
assert not (dishes / "stale.cfg").exists()
|
||||
assert not (recipes / "stale.cfg").exists()
|
||||
|
||||
Reference in New Issue
Block a user