diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-04-05 20:41:25 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-04-05 20:52:27 +0200 |
| commit | c7eef9ddc3592b069e6e77c2c50014e4cda391b7 (patch) | |
| tree | 7102cc05e69fb858ffd099ee149a435e2e13ec1f /scripts | |
| parent | 018b61742fe53af9e7d2755553c6755e141d2c5e (diff) | |
| download | vyos-build-c7eef9ddc3592b069e6e77c2c50014e4cda391b7.tar.gz vyos-build-c7eef9ddc3592b069e6e77c2c50014e4cda391b7.zip | |
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.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-qemu-install | 27 |
1 files changed, 27 insertions, 0 deletions
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) |
