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

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

heywji
Copy link
Contributor

@heywji heywji commented Sep 13, 2024

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 the 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"

@heywji heywji force-pushed the fix_ws2016_session branch 3 times, most recently from cfcae03 to 217316a Compare September 25, 2024 06:16
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 :)

@leidwang
Copy link
Contributor

leidwang commented Oct 9, 2024

Hi @lkotek Would you please help review this PR, I guess gating test also include this test case,thanks!

@lkotek
Copy link
Contributor

lkotek commented Oct 9, 2024

Hi @lkotek Would you please help review this PR, I guess gating test also include this test case,thanks!

Ack. Yes, exactly. I am aware of the issue because of the gating stage jobs. Thanks for the fix! I am fine with the changes as the PR was already successfully tested with Win2016 guest.

Copy link
Contributor

@leidwang leidwang left a comment

Choose a reason for hiding this comment

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

LGTM.

@heywji
Copy link
Contributor Author

heywji commented Oct 10, 2024

Hi @vivianQizhu, Could you help review this patch as well, thanks a lot.

@@ -172,6 +174,15 @@ def run(test, params, env):
if not utils_misc.wait_for(lambda: not session.cmd_status(chk_cmd),
600, 60, 10):
test.fail("Failed to install driver '%s'" % driver_name)
if device_name[0:30] == "Red Hat VirtIO Ethernet Adapte":
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a typo on the device name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vivianQizhu, That is the name of device_name. It was in effect in our recent test log.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad. I see my mistake. I will fix it.

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 have fixed it. Could you help review it again? Thanks a lot!

@heywji heywji force-pushed the fix_ws2016_session branch 3 times, most recently from 0292c08 to 293f43d Compare October 18, 2024 09:57
@heywji heywji force-pushed the fix_ws2016_session branch 3 times, most recently from 33b641f to bfe157e Compare October 30, 2024 12:38
@heywji
Copy link
Contributor Author

heywji commented Oct 31, 2024

Test Result:

 (1/3) Host_RHEL.m9.u6.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.i386.io-github-autotest-qemu.single_driver_install.with_netkvm.virtio_win_iso_media.q35: STARTED
 (1/3) Host_RHEL.m9.u6.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.i386.io-github-autotest-qemu.single_driver_install.with_netkvm.virtio_win_iso_media.q35: PASS (534.23 s)
 (2/3) Host_RHEL.m9.u6.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.x86_64.io-github-autotest-qemu.single_driver_install.with_netkvm.virtio_win_iso_media.q35: STARTED
 (2/3) Host_RHEL.m9.u6.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.x86_64.io-github-autotest-qemu.single_driver_install.with_netkvm.virtio_win_iso_media.q35: PASS (472.28 s)
 (3/3) Host_RHEL.m9.u6.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.single_driver_install.with_netkvm.virtio_win_iso_media.q35: STARTED
 (3/3) Host_RHEL.m9.u6.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.single_driver_install.with_netkvm.virtio_win_iso_media.q35: PASS (603.82 s)

vivianQizhu
vivianQizhu previously approved these changes Nov 1, 2024
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 the 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]>
@vivianQizhu vivianQizhu merged commit 9a57983 into autotest:master Nov 1, 2024
7 checks passed
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.

5 participants