Skip to content

Commit

Permalink
Installer test: add static DNS configuration test
Browse files Browse the repository at this point in the history
Driver installer supports restoring DNS configurations after driver
upgrade, so add a DNS checkpoint here.

Reference: The previous static IP configuration test was #3860
Signed-off-by: wji <wji@redhat.com>
  • Loading branch information
heywji committed Feb 26, 2024
1 parent 78e23fe commit a6321b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions qemu/tests/win_virtio_driver_update_by_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
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("Failed to setup static dns,current dns is %s" % static_dns_address)
session_serial.close()
else:
for driver_name, device_name, device_hwid in zip(
Expand Down Expand Up @@ -128,6 +136,12 @@ 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)
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)
session_serial.close()

# for some guests, need to reboot guest after drivers are updated
Expand Down

0 comments on commit a6321b5

Please sign in to comment.