-
Notifications
You must be signed in to change notification settings - Fork 170
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
Automate case: Connect to the guest console without serial device #5865
base: master
Are you sure you want to change the base?
Automate case: Connect to the guest console without serial device #5865
Conversation
xx-300602 - [console][negative] Connect to the guest console without serial device Signed-off-by: chunfuwen <[email protected]>
cleaning libvirtd logs... |
@@ -70,6 +70,12 @@ | |||
serial_dev_type = pty | |||
console_target_type = virtio | |||
second_serial_console = yes | |||
- test_connect_to_console_without_serial_device: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a negative scenario. Can we use negative_test_without_serial_device or other related? This can help us debug auto case quickly after reading the case pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to test_connect_to_console_without_serial_device_negative_test
@@ -821,6 +823,11 @@ def get_console_type(): | |||
if console_type == 'server': | |||
console = prepare_serial_console() | |||
|
|||
if connect_to_console_without_serial_device: | |||
libvirt_version.is_libvirt_feature_supported(params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we add the libvirt_version.is_libvirt_feature_supported
in global but not only in if condition. So we can reuse it if we add new test scenarios later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this dependence version is specific to this case only, so keep it in specific case looks more sensible
- test_connect_to_console_without_serial_device: | ||
only x86_64 | ||
serial_dev_type = pty | ||
error_msg = "Cannot run interactive console without a controlling TTY" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where we get this error message? The actual message in our test is "error: internal error: cannot find character device ".
@@ -835,6 +842,13 @@ def get_console_type(): | |||
console_type != 'server'): | |||
check_serial_console(console, username, password) | |||
|
|||
if connect_to_console_without_serial_device: | |||
# use raw virsh console command since we need to output message from virsh console VM | |||
result = process.run("virsh console %s" % vm_name, shell=True, verbose=True, ignore_status=True).stderr_text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd better to use virsh.command() but not process for virsh commands if there is no virsh.console related functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it need second terminal to launch virsh console command, virsh.command will block execution
Automate case: Connect to the guest console without serial device
xx-300602 - [console][negative] Connect to the guest console without serial device