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

Automate case: Connect to the guest console without serial device #5865

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chunfuwen
Copy link
Contributor

Automate case: Connect to the guest console without serial device

xx-300602 - [console][negative] Connect to the guest console without serial device

xx-300602 - [console][negative] Connect to the guest console without serial device

Signed-off-by: chunfuwen <[email protected]>
@chunfuwen
Copy link
Contributor Author

cleaning libvirtd logs...
DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.serial.functional.test_connect_to_console_without_serial_device

@@ -70,6 +70,12 @@
serial_dev_type = pty
console_target_type = virtio
second_serial_console = yes
- test_connect_to_console_without_serial_device:
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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"
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants