Skip to content

Commit

Permalink
fixup! install: adjust host IP, name, UUIDs in firstboot data before …
Browse files Browse the repository at this point in the history
…booting
  • Loading branch information
ydirson committed Oct 18, 2024
1 parent 3055797 commit 7e29333
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions tests/install/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@
# ssh-rsa keys, a public ssh-ed25519 key listed in TEST_SSH_PUBKEY should be
# there)

@pytest.fixture
def helper_vm_with_plugged_disk(running_vm, create_vms):
helper_vm = running_vm
host_vm, = create_vms

all_vdis = [VDI(uuid, host=host_vm.host) for uuid in host_vm.vdi_uuids()]
disk_vdis = [vdi for vdi in all_vdis if not vdi.readonly()]
vdi, = disk_vdis

vbd = helper_vm.create_vbd("1", vdi.uuid)
try:
vbd.plug()

yield helper_vm

finally:
vbd.unplug()
vbd.destroy()

@pytest.mark.dependency()
class TestNested:
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
Expand Down Expand Up @@ -73,26 +92,6 @@ def test_install(self, vm_booted_with_installer, install_disk,
host_vm = vm_booted_with_installer
installer.monitor_install(ip=host_vm.ip)

@pytest.fixture
@staticmethod
def helper_vm_with_plugged_disk(running_vm, create_vms):
helper_vm = running_vm
host_vm, = create_vms

all_vdis = [VDI(uuid, host=host_vm.host) for uuid in host_vm.vdi_uuids()]
disk_vdis = [vdi for vdi in all_vdis if not vdi.readonly()]
vdi, = disk_vdis

vbd = helper_vm.create_vbd("1", vdi.uuid)
try:
vbd.plug()

yield helper_vm

finally:
vbd.unplug()
vbd.destroy()

@pytest.mark.usefixtures("xcpng_chained")
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
@pytest.mark.parametrize("package_source", ("iso", "net"))
Expand Down

0 comments on commit 7e29333

Please sign in to comment.