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

Netkvm: Fix session handling issue during netkvm driver installation #4158

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

Conversation

heywji
Copy link
Contributor

@heywji heywji commented Sep 13, 2024

During acceptance testing, installing the netkvm driver on an existing network interface caused session handling issues, leading to test failures. This patch changes the session handling from SSH to serial session by replacing vm.wait_for_login() with vm.wait_for_serial_login() . It also adds a ping test to verify network connectivity after the driver installation.

ID: 1382
Signed-off-by: wji [email protected]

@heywji heywji force-pushed the fix_ws2016_session branch 2 times, most recently from 9655041 to 7622023 Compare September 13, 2024 02:14

ext_host = utils_net.get_ip_address_by_interface(ifname="%s" % params.get("netdst"))
test.log.info("ext_host of netkvm adapte is %s" % ext_host)
guest_ip = vm.get_address(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious how to determine the ip owner? rtl8139 or virtio-net ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use get_address function call to get my IP, and its parameter "1" comes from the "single_driver_install.cfg" file, where it is defined as nic_model_nic2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As our discussion, I changed "Index as 1" to "Name as nic2" now. This also works. Please review it when you are free. Thanks in advance.

@heywji heywji force-pushed the fix_ws2016_session branch 5 times, most recently from 4c4b0d8 to 088ff5f Compare September 14, 2024 00:39
@heywji
Copy link
Contributor Author

heywji commented Sep 14, 2024

Test Result: Fully passed on "--category=virtio_win_prewhql_acceptance --guestname=Win2016"

qemu/tests/single_driver_install.py Show resolved Hide resolved
if device_name[0:30] == "Red Hat VirtIO Ethernet Adapte":
ext_host = utils_net.get_ip_address_by_interface(ifname="%s" % params.get("netdst"))
test.log.info("ext_host of netkvm adapte is %s" % ext_host)
guest_ip = vm.get_address("nic2")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please tell why using 'nic2' here? I thought it is similar with 'index2'. How about getting the ether name inside guest with some keywords, such as "Red Hat VirtIO Ethernet Adapte"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @xiagao, I used 'nic2' because it's the second element in the vm.virtnet list. You can see vm.virtnet code defined in this function: avocado-framework/avocado-vt/blob/master/virttest/virt_vm.py#L832.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And "nic2" has already been defined in our cfg file: tp-qemu/blob/master/qemu/tests/cfg/single_driver_install.cfg#L56.

@heywji heywji force-pushed the fix_ws2016_session branch 2 times, most recently from 44dedb2 to cfcae03 Compare September 23, 2024 09:23
During acceptance testing, installing the netkvm driver on an existing
network interface caused session handling issues, leading to test
failures. This patch changes the session handling from SSH to serial
session by replacing vm.wait_for_login() with vm.wait_for_serial_login()
. It also adds a ping test to verify network connectivity after the
driver installation.

Signed-off-by: wji <[email protected]>
Copy link
Contributor

@xiagao xiagao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

@heywji
Copy link
Contributor Author

heywji commented Sep 25, 2024

Hi @leidwang, Could you help review it when you have times? Thanks :)

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