Машина с ISO после установки перезагружается сама: создаётся без отдельной фазы установки (no_install), диск первым в порядке загрузки

Этот коммит содержится в:
2026-09-27 17:45:03 +09:00
родитель daeec06ec6
Коммит 2474ad3dc2
5 изменённых файлов: 15 добавлений и 9 удалений
+4 -1
Просмотреть файл
@@ -142,7 +142,10 @@ def test_vm_create_iso_builds_virt_install(logged_in, data_dirs, monkeypatch):
assert cmd[0] == "virt-install"
assert "--cdrom" in cmd and str(iso) in cmd
assert any(part.startswith("network=virtuality-nat,model=virtio,mac=52:54:00:") for part in cmd)
assert captured["operation"]["boot_order"] == "cdrom_disk"
assert captured["operation"]["boot_order"] == "disk_cdrom"
# После установки гость перезагружается с диска: без особого режима установки и с диском первым в очереди.
assert cmd[cmd.index("--boot") + 1] == "hd,cdrom"
assert cmd[cmd.index("--install") + 1] == "no_install=yes"
def test_vm_create_validation_error(logged_in):
+2 -2
Просмотреть файл
@@ -118,7 +118,7 @@ def test_windows11_gets_uefi_tpm_sata_and_e1000e(logged_in, data_dirs, monkeypat
assert response.status_code == 303
cmd = captured["cmd"]
assert "--osinfo" in cmd and cmd[cmd.index("--osinfo") + 1] == "win11"
assert cmd[cmd.index("--boot") + 1] == "uefi,cdrom,hd"
assert cmd[cmd.index("--boot") + 1] == "uefi,hd,cdrom"
assert "--tpm" in cmd and "backend.version=2.0" in cmd[cmd.index("--tpm") + 1]
assert "bus=sata" in cmd[cmd.index("--disk") + 1] and "model=e1000e" in cmd[cmd.index("--network") + 1]
assert "--channel" not in cmd # Windows has no guest agent without extra drivers
@@ -129,7 +129,7 @@ def test_linux_installer_detects_os_and_uses_virtio(logged_in, data_dirs, monkey
iso.write_bytes(b"iso")
response, captured = create(logged_in, monkeypatch, iso_form(iso))
cmd = captured["cmd"]
assert cmd[cmd.index("--osinfo") + 1] == "detect=on,require=off" and cmd[cmd.index("--boot") + 1] == "cdrom,hd"
assert cmd[cmd.index("--osinfo") + 1] == "detect=on,require=off" and cmd[cmd.index("--boot") + 1] == "hd,cdrom"
assert "bus=virtio" in cmd[cmd.index("--disk") + 1] and "model=virtio" in cmd[cmd.index("--network") + 1] and "--tpm" not in cmd
assert cmd[cmd.index("--channel") + 1] == "unix,target.type=virtio,target.name=org.qemu.guest_agent.0"
assert create(logged_in, monkeypatch, iso_form(iso, os_type="bsd"))[0].status_code == 400