diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-04-13 18:35:34 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-13 18:35:34 +0300 |
| commit | 880043dfae64cf66e0ba4aa072c0cd11fd625fa3 (patch) | |
| tree | 422599522f2f8d847e12737b7a7007eb5ecde0e3 /scripts | |
| parent | 4d26859088b1463965403c14472fbbff245864b5 (diff) | |
| parent | c7eef9ddc3592b069e6e77c2c50014e4cda391b7 (diff) | |
| download | vyos-build-880043dfae64cf66e0ba4aa072c0cd11fd625fa3.tar.gz vyos-build-880043dfae64cf66e0ba4aa072c0cd11fd625fa3.zip | |
Merge pull request #1155 from c-po/kernel-serial-activation
Testsuite: T8375: verify proper serial console settings
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-qemu-install | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 6ac4b73e..ed5bc4e6 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -528,13 +528,40 @@ 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) 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) |
