From 018b61742fe53af9e7d2755553c6755e141d2c5e Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 5 Apr 2026 20:39:51 +0200 Subject: Testsuite: T8375: use more specific "option kernel" search path in conf commands As there is also "set system console device kernel", use a more specific match criteria to avoid false positives. --- scripts/check-qemu-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 6ac4b73e..78dbe7e0 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -528,7 +528,7 @@ def basic_cli_tests(c): c.expect(op_mode_prompt) c.sendline('show system memory detail | no-more') c.expect(op_mode_prompt) - c.sendline('show configuration commands | match kernel') + c.sendline('show configuration commands | match "option kernel"') c.expect(op_mode_prompt) c.sendline('cat /proc/cmdline') c.expect(op_mode_prompt) -- cgit v1.2.3 From c7eef9ddc3592b069e6e77c2c50014e4cda391b7 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 5 Apr 2026 20:41:25 +0200 Subject: Testsuite: T8375: verify proper serial console settings Now that the serial console definition is dynamically generated by the image installer, depending on the flavor data, it is time to validate the resulting CLI nodes and GRUB config. --- scripts/check-qemu-install | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'scripts') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 78dbe7e0..ed5bc4e6 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -535,6 +535,33 @@ def basic_cli_tests(c): c.sendline('show version all | grep -e "vpp" -e "vyos-1x"') c.expect(op_mode_prompt) + # Get serial console interface name from flavor definition + c.sendline('cat /usr/share/vyos/flavor.json | jq -r ".console_type"') + c.expect(op_mode_prompt) + lines = [l.strip() for l in c.before.splitlines() if l.strip()] + console_type = lines[-1].decode('utf-8').strip() # e.g. ttyS + + c.sendline('cat /usr/share/vyos/flavor.json | jq -r ".console_num"') + c.expect(op_mode_prompt) + lines = [l.strip() for l in c.before.splitlines() if l.strip()] + console_num = lines[-1].decode('utf-8').strip() # e.g. 0 + + # Get serial console speed from flavor definition + c.sendline('cat /usr/share/vyos/flavor.json | jq -r ".console_speed"') + c.expect(op_mode_prompt) + lines = [l.strip() for l in c.before.splitlines() if l.strip()] + console_speed = lines[-1].decode('utf-8').strip() # e.g. 115200 + + # Ensure serial console with kernel option is set in CLI, done automatically by image installer + c.sendline('show configuration commands | match "system console"') + c.expect(rf'set system console device {console_type}{console_num} kernel\r\r\nset system console device {console_type}{console_num} speed \'{console_speed}\'') + c.expect(op_mode_prompt) + + # Validate GRUB has the right console_type defined + c.sendline('cat /boot/grub/grub.cfg.d/20-vyos-defaults-autoload.cfg | grep "set console_type"') + c.expect(f'set console_type="{console_type}"') + c.expect(op_mode_prompt) + if args.qemu_cmd: tmp = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, iso_img=args.iso, vnc_enabled=args.vnc, secure_boot=args.sbtest) os.system(tmp) -- cgit v1.2.3