diff --git a/bastion/src/bastion/src/templates/install.ks.ts b/bastion/src/bastion/src/templates/install.ks.ts index d6ba8f1..019bbb8 100644 --- a/bastion/src/bastion/src/templates/install.ks.ts +++ b/bastion/src/bastion/src/templates/install.ks.ts @@ -121,8 +121,7 @@ ${userDirective} bootloader --append="console=tty0 console=ttyS0,115200n8" -# logging --host=${serverIp} --port=${syslogPort} --level=info -# TODO: Enable once syslog UDP port is opened in firewall and tested standalone +logging --host=${serverIp} --port=${syslogPort} url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch diff --git a/bastion/src/bastion/tests/kickstart.test.ts b/bastion/src/bastion/tests/kickstart.test.ts index 88f5f63..2629877 100644 --- a/bastion/src/bastion/tests/kickstart.test.ts +++ b/bastion/src/bastion/tests/kickstart.test.ts @@ -185,7 +185,25 @@ describe("renderInstallKickstart", () => { it("sends install logs to bastion via syslog", () => { const ks = renderInstallKickstart(baseParams({ syslogPort: 5514 })); - expect(ks).toContain("logging --host=192.168.1.100 --port=5514 --level=info"); + expect(ks).toContain("logging --host=192.168.1.100 --port=5514"); + }); + + it("passes ksvalidator syntax check", () => { + for (const role of ["vanilla", "worker", "infra"] as const) { + const ks = renderInstallKickstart(baseParams({ role })); + const { execSync } = require("node:child_process"); + const { writeFileSync, unlinkSync } = require("node:fs"); + const tmp = `/tmp/ks-test-${role}.ks`; + writeFileSync(tmp, ks); + try { + execSync(`ksvalidator -v F43 ${tmp}`, { encoding: "utf-8" }); + } catch (err: unknown) { + const msg = err instanceof Error ? (err as { stderr?: string }).stderr ?? err.message : String(err); + throw new Error(`ksvalidator failed for role=${role}: ${msg}`); + } finally { + try { unlinkSync(tmp); } catch {} + } + } }); it("forwards system logs to serial console", () => {