d33f624 kickstart-tests: handle non-US keyboard layouts

Authored and Committed by adamwill 8 years ago
    kickstart-tests: handle non-US keyboard layouts
    
    wow, this was a deep dive. A few of the kickstart-tests set the
    OS keymap to cz. Long story short, the way openQA does keyboard
    input is via VNC; VNC keyboard events are for keysyms, which
    are layout-dependent (so when we say `send_key "a"`, openQA
    sends qemu the keysym for 'a', regardless of layout issues).
    qemu turns the keysym into a keycode and sends *that* to the
    guest OS, which turns it back into a keysym according to its
    keymap config.
    
    qemu uses a US map by default to turn the keysym it receives via
    VNC into a keycode. So if you send qemu a '-', it sends the guest
    OS the keycode that would be converted to the keysym for '-' *in
    the US layout*. But if the guest OS has its layout set to cz,
    the same keycode is converted to '=', since that's what the key
    with that keycode is labelled as on a Czech keyboard.
    
    That's why if you set the guest OS keymap to cz and tell openQA
    to type '-', you get '='.
    
    However! You can tell qemu to use a different keymap for its
    keysym -> keycode conversion. If you keep the qemu keymap and
    the guest OS keymap lined up, when you say `send_key "-"`, you
    should actually *get* a "-". Which is what we want, for these
    tests. So we tell openQA to tell qemu to do that, using the
    VNCKB var, which is for precisely this: it tells os-autoinst
    to run qemu with `-k (layout)`.
    
        
file modified
+61 -20