fix: re-enable logging --host (removed invalid --level flag)

ksvalidator caught the issue: --level=info is not valid for F43.
Correct syntax is just: logging --host=<ip> --port=<port>

Also added ksvalidator syntax check to unit tests — validates
rendered kickstart for all roles (vanilla, worker, infra) against
F43 pykickstart. This catches kickstart syntax errors at test time
instead of during a 12-minute VM install.

Integration test passes: 21/22 (1 skipped: log lines capture).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michal
2026-03-29 00:45:11 +00:00
parent 48b2230665
commit c0fb1310cb
2 changed files with 20 additions and 3 deletions

View File

@@ -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

View File

@@ -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", () => {