Skip to content

Commit

Permalink
tgtw
Browse files Browse the repository at this point in the history
  • Loading branch information
Tu Dinh committed Jan 19, 2025
1 parent c2f8562 commit 70bc703
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
18 changes: 9 additions & 9 deletions data.py-dist
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ OTHER_GUEST_TOOLS_ISO = {
# Definitions of other guest tools contained in OTHER_GUEST_TOOLS_ISO
OTHER_GUEST_TOOLS = {
"xcp-ng-9.0.9000": {
# Whether we are installing MSI files ("msi"), bare .inf drivers ("inf")
# or nothing in case of Windows Update (absent or null)
"type": "msi",
# ISO-relative path of this guest tool
"path": "xcp-ng-9.0.9000",
# "path"-relative path of MSI or driver files to be installed
"package": "package\\XenDrivers-x64.msi",
# Is the above path a MSI file path (set to False for path to driver files)
"is_msi": True,
# Can we upgrade automatically from this guest tool to our tools?
"upgradable": True,
# Relative path of root cert file (optional)
"testsign_cert": "testsign\\XCP-ng_Test_Signer.crt",
# Whether this guest tool version wants vendor device to be activated (optional, defaults to False)
# Note: other guest tools may not install correctly with this setting enabled
"vendor_device": False,

# Can we upgrade automatically from this guest tool to our tools?
"upgradable": True,
},
"citrix-9.4.0-vendor": {
"path": "citrix-9.4.0",
"is_msi": False,
"package": "",
"upgradable": False,
"vendor": {
"vendor_device": True,
"upgradable": False,
},
}

Expand Down
52 changes: 28 additions & 24 deletions tests/guest-tools/win/other_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,31 @@ def install_other_drivers(vm: VM, other_tools_iso_name: str, param: dict[str, An
vm.start()
wait_for_vm_running_and_ssh_up_without_tools(vm)

insert_cd_safe(vm, other_tools_iso_name)

if param.get("testsign_cert"):
logging.info("Enable testsigning")
rootcert = PureWindowsPath("D:\\") / param["path"] / param["testsign_cert"]
enable_testsign(vm, rootcert)

package_path = PureWindowsPath("D:\\") / param["path"] / param["package"]
install_cmd = "D:\\install-drivers.ps1 "
if param["is_msi"]:
logging.info(f"Install MSI drivers: {package_path}")
install_cmd += f"-MsiPath '{package_path}' "
else:
logging.info(f"Install drivers: {package_path}")
install_cmd += f"-DriverPath '{package_path}' "
install_cmd += ">C:\\othertools.log;"
install_cmd += SHUTDOWN_COMMAND
vm.start_background_powershell(install_cmd)
# Leave some extra time for install-drivers.ps1 to work.
wait_for(vm.is_halted, "Shutdown VM", timeout_secs=300)

vm.eject_cd()
vm.start()
wait_for_vm_running_and_ssh_up_without_tools(vm)
driver_type = param.get("type")
if driver_type is not None:
insert_cd_safe(vm, other_tools_iso_name)

if param.get("testsign_cert"):
logging.info("Enable testsigning")
rootcert = PureWindowsPath("D:\\") / param["path"] / param["testsign_cert"]
enable_testsign(vm, rootcert)

package_path = PureWindowsPath("D:\\") / param["path"] / param["package"]
install_cmd = "D:\\install-drivers.ps1 "
if driver_type == "msi":
logging.info(f"Install MSI drivers: {package_path}")
install_cmd += f"-MsiPath '{package_path}' "
elif driver_type == "inf":
logging.info(f"Install drivers: {package_path}")
install_cmd += f"-DriverPath '{package_path}' "
else:
raise RuntimeError(f"Invalid driver package type {driver_type}")
install_cmd += ">C:\\othertools.log;"
install_cmd += SHUTDOWN_COMMAND
vm.start_background_powershell(install_cmd)
# Leave some extra time for install-drivers.ps1 to work.
wait_for(vm.is_halted, "Shutdown VM", timeout_secs=300)

vm.eject_cd()
vm.start()
wait_for_vm_running_and_ssh_up_without_tools(vm)

0 comments on commit 70bc703

Please sign in to comment.