Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: qt_send_key doesn't work with down, end, f10, probably others #38

Open
ali1234 opened this issue May 21, 2024 · 3 comments
Open

bug: qt_send_key doesn't work with down, end, f10, probably others #38

ali1234 opened this issue May 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ali1234
Copy link
Contributor

ali1234 commented May 21, 2024

Test case (put this in one of the ubuntu 24.04 tests):

function test_post_boot_grub() {
    # Wait a while for EUFI or BIOS to pass
    # We could skip having this function, but it's nice to have
    # So we have the opportunity to click that stupid dialog
    qt_wait_for_seconds 10
    # Wait for the grub menu
    qt_wait_for_text "$FUNCNAME" "$text_console_gnu_grub" 10 5


    qt_send_key "e"
    qt_wait_for_seconds 1
    qt_send_key "down"
    qt_wait_for_seconds 1
    qt_send_key "down"
    qt_wait_for_seconds 1
    qt_send_key "down"
    qt_wait_for_seconds 1
    qt_send_key "end"
    qt_wait_for_seconds 1
    qt_send_string " console=ttyS0,115200"
    qt_screenshot_ppm "$FUNCNAME"
    qt_send_key "f10"
}

What should happen:

  • "e" - begin editing the boot config
  • "down"x3 - move down three lines
  • "end" - move to end of line
  • insert the string
  • "f10" - boot with edited command line

What actually happens:

  • "e" works and we enter the editor.
  • "down", "end" are ignored.
  • The extra command lines are typed in the wrong place.
  • "f10" is ignored, leaving the system like this:

image

The "console=..." should be at the end of the line beginning with "linux".

@ali1234 ali1234 added the bug Something isn't working label May 21, 2024
@ali1234
Copy link
Contributor Author

ali1234 commented May 21, 2024

According to https://en.wikibooks.org/wiki/QEMU/Monitor#sendkey_keys these are the correct key names so I don't know why they don't work. Performing these steps manually through the viewer does work (F10 seems to be grabbed by the viewer, but ctrl-x works instead).

@popey
Copy link
Contributor

popey commented May 21, 2024

Have you tried qt_send_key_combo? Which does no translation/mapping? It's a bit horrid, but there's two functions in Quicktest for this reason. The qt_send_key_combo lets you send the raw ret, esc ctrl-alt-f1 combinations that Qemu recognises. Whereas the qt_send_key function does the whole mapping of # to shift-f3 or whatever it is for your keyboard layout.

@ali1234
Copy link
Contributor Author

ali1234 commented May 21, 2024

qt_send_key_combo works.

In order to avoid confusion, I would make only qt_send_string handle remapping, then make qt_send_key do what qt_send_key_combo does, and remove the latter. Finally qt_send_key should display an error for invalid keys instead of silently doing nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants