-
Notifications
You must be signed in to change notification settings - Fork 174
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
Installer test: add static DNS configuration test #3937
Conversation
Test Result:
|
f2b2522
to
ce819cf
Compare
Hi @leidwang @xiagao @vivianQizhu Could you please help to review it? Thanks. |
@@ -96,6 +96,14 @@ def change_virtio_media(cdrom_virtio): | |||
static_ip_address = utils_net.get_guest_ip_addr(session_serial, virtio_nic_mac, os_type='windows') | |||
if static_ip_address != params["static_ip"]: | |||
test.fail("Failed to setup static ip,current ip is %s" % static_ip_address) | |||
setup_dns_cmd = params["setup_dns_cmd"] % ifname | |||
session_serial.cmd_status(setup_dns_cmd) | |||
static_dns_address = utils_net.get_windows_nic_attribute(session_serial, global_switch="nicconfig", |
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.
Hi @wji
Is it possible to get the index value via the ifname/mac_address, it will be better than the hard code.
Thanks.
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.
@heywji I understand that the old code did not follow PEP8 perfectly, we could keep them as it is. But when we introduce new lines or touch them when fix issues let's try to improve our code style. please keep each line within 79 characters.
2a75c49
to
4ce5b54
Compare
Hi @leidwang, Could you help review this patch again since it gets the index value via the mac_address now? |
LGTM, would you please provide the test results? |
57d1e21
to
da5f7b6
Compare
Test Result:
|
Hi @leidwang @vivianQizhu, Please help me review this patch again when you are free. Thanks a lot : ) |
@@ -128,6 +136,14 @@ def change_virtio_media(cdrom_virtio): | |||
static_ip_address = utils_net.get_guest_ip_addr(session_serial, virtio_nic_mac, os_type='windows') | |||
if static_ip_address != params["static_ip"]: | |||
test.fail("Static ip is lost after upgrade driver,current ip is %s" % static_ip_address) | |||
setup_dns_cmd = params["setup_dns_cmd"] % ifname | |||
session_serial.cmd_status(setup_dns_cmd) |
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.
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.
Hi @leidwang, I tried that. If I don't set it, I will get "c:\windows\system32".
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 should be another problem.
Back to our test case, the checkpoint is to check if the static dns can be saved after upgrading the driver. If we set the DNS again after upgrading the driver, then our checkpoint will not be tested at all, which is meaningless.
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.
@leidwang You are right. I will change my code and find the root cause.
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 am fixing a similar bug, not sure if the error you hit is same with me, I will send you the patch.You can try to run your patch with my fix first.
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 have already solved this problem.
There are two issues contained here, so let me explain.
The first one about 'c:\\windows\\system32' comes from your patch-related problem.
The second problem is a runtime error. The root cause of this problem comes from the fact that the developers fixed this problem in virtio-win-1.9.36-0.el9_3.iso, and I was using a lower version before. So that, it is normal that the DNS information is not found.
It works now. Thanks leidong.
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.
In short, I was using the wrong iso. Sorry :(
Test Result:
|
Hi @leidwang, Could you please help to review this again when you are free? Thanks in advance. |
3df5811
to
a6321b5
Compare
I just pushed the wrong branch, but it is normal now. |
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.
LGTM.
static_dns_address = utils_net.get_windows_nic_attribute(session_serial, global_switch="nicconfig", | ||
key="MACAddress", value=f"{virtio_nic_mac}", | ||
target="DNSServerSearchOrder") | ||
static_dns_address = static_dns_address.strip('{}').strip('"') | ||
if static_dns_address != params["static_dns"]: | ||
test.fail("Static dns is lost after upgrade driver,current dns is %s" % static_dns_address) |
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.
@heywji Shall we consider package these lines into a function as you repeat exactly the same lines twice.
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.
OK! I will change it now.
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.
Hi @vivianQizhu, I have put these lines into a function. Could you please check them again?
Test Result: Pass
Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_install_by_installer.driver_update.from_old_installer.q35: PASS (955.86 s)
8fdca88
to
0406768
Compare
e4b690d
to
902a123
Compare
static_ip_address = utils_net.get_guest_ip_addr(session_serial, virtio_nic_mac, os_type='windows') | ||
if static_ip_address != params["static_ip"]: | ||
test.fail("Failed to setup static ip,current ip is %s" % static_ip_address) |
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.
@heywji These lines also could be included into the function.
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.
OK
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.
Done.
Test Result: pass
Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.x86_64.io-github-autotest-qemu.win_virtio_driver_install_by_installer.driver_update.from_old_installer.q35: PASS (960.66 s)
f94bbb4
to
1e1c801
Compare
Test Result:
|
Driver installer supports restoring DNS configurations after driver upgrade, so add a DNS checkpoint here. Reference: The previous static IP configuration test was autotest#3860 Signed-off-by: wji <wji@redhat.com>
@heywji Latest test result please. Thanks. |
Test Result: PASS
|
Driver installer supports restoring DNS configurations after driver upgrade, so add a DNS checkpoint here. The previous static IP configuration test was #3860
ID: 1561
Signed-off-by: wji wji@redhat.com