Skip to content

Commit dc16ea1

Browse files
mvo5thozza
authored andcommitted
test: add integration test for test_rhel_bootc_anaconda_iso
This commit adds an integration test for the fix that bootc anaconda ISO secrets must be read while the container is mounted.
1 parent a71e847 commit dc16ea1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/test_rhel.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,26 @@ def test_build_can_build_tar(build_container):
4646
"tar",
4747
"--distro", "centos-10",
4848
])
49+
50+
51+
@pytest.mark.skipif(os.getuid() != 0, reason="needs root")
52+
@pytest.mark.skipif(not os.getenv("RHEL_REGISTRY_USER"), reason="needs registry secrets")
53+
def test_rhel_bootc_anaconda_iso(tmp_path):
54+
rhel_registry_user = os.getenv("RHEL_REGISTRY_USER")
55+
rhel_registry_secret = os.getenv("RHEL_REGISTRY_TOKEN")
56+
bootc_ref = "registry.redhat.io/rhel10/rhel-bootc:latest"
57+
subprocess.run([
58+
"podman",
59+
"login", "registry.redhat.io",
60+
"--username", rhel_registry_user,
61+
"--password-stdin",
62+
], input=rhel_registry_secret, text=True, check=True)
63+
subprocess.check_call(["podman", "pull", bootc_ref])
64+
bib = tmp_path / "bootc-image-builder"
65+
subprocess.check_call(["go", "build", "-o", f"{bib}", "./cmd/image-builder"])
66+
subprocess.check_call([
67+
os.fspath(bib),
68+
"manifest",
69+
"--type", "anaconda-iso",
70+
bootc_ref,
71+
])

0 commit comments

Comments
 (0)