Skip to content

Commit

Permalink
Use vm.get_sr instead of relying on fixture in vm migration and nfs…
Browse files Browse the repository at this point in the history
… tests

Signed-off-by: Benjamin Reis <[email protected]>
  • Loading branch information
benjamreis committed Apr 17, 2024
1 parent 4cca513 commit b074cc8
Show file tree
Hide file tree
Showing 24 changed files with 112 additions and 113 deletions.
8 changes: 4 additions & 4 deletions tests/storage/cephfs/test_cephfs_sr_crosspool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostB1", "local_sr_on_hostB1")
class Test:
def test_cold_crosspool_migration(self, host, hostB1, vm_on_cephfs_sr, cephfs_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_cephfs_sr, host, cephfs_sr, hostB1, local_sr_on_hostB1)
def test_cold_crosspool_migration(self, host, hostB1, vm_on_cephfs_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_cephfs_sr, host, hostB1, local_sr_on_hostB1)

def test_live_crosspool_migration(self, host, hostB1, vm_on_cephfs_sr, cephfs_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_cephfs_sr, host, cephfs_sr, hostB1, local_sr_on_hostB1)
def test_live_crosspool_migration(self, host, hostB1, vm_on_cephfs_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_cephfs_sr, host, hostB1, local_sr_on_hostB1)
13 changes: 7 additions & 6 deletions tests/storage/cephfs/test_cephfs_sr_intrapool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostA2", "local_sr_on_hostA2")
class Test:
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_cephfs_sr, cephfs_sr):
live_storage_migration_then_come_back(vm_on_cephfs_sr, host, cephfs_sr, hostA2, cephfs_sr)
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_cephfs_sr):
sr = vm_on_cephfs_sr.get_sr()
live_storage_migration_then_come_back(vm_on_cephfs_sr, host, hostA2, sr)

def test_cold_intrapool_migration(self, host, hostA2, vm_on_cephfs_sr, cephfs_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_cephfs_sr, host, cephfs_sr, hostA2, local_sr_on_hostA2)
def test_cold_intrapool_migration(self, host, hostA2, vm_on_cephfs_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_cephfs_sr, host, hostA2, local_sr_on_hostA2)

def test_live_intrapool_migration(self, host, hostA2, vm_on_cephfs_sr, cephfs_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_cephfs_sr, host, cephfs_sr, hostA2, local_sr_on_hostA2)
def test_live_intrapool_migration(self, host, hostA2, vm_on_cephfs_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_cephfs_sr, host, hostA2, local_sr_on_hostA2)
8 changes: 4 additions & 4 deletions tests/storage/ext/test_ext_sr_crosspool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostB1", "local_sr_on_hostB1")
class Test:
def test_cold_crosspool_migration(self, host, hostB1, vm_on_ext_sr, ext_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_ext_sr, host, ext_sr, hostB1, local_sr_on_hostB1)
def test_cold_crosspool_migration(self, host, hostB1, vm_on_ext_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_ext_sr, host, hostB1, local_sr_on_hostB1)

def test_live_crosspool_migration(self, host, hostB1, vm_on_ext_sr, ext_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_ext_sr, host, ext_sr, hostB1, local_sr_on_hostB1)
def test_live_crosspool_migration(self, host, hostB1, vm_on_ext_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_ext_sr, host, hostB1, local_sr_on_hostB1)
8 changes: 4 additions & 4 deletions tests/storage/ext/test_ext_sr_intrapool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostA2", "local_sr_on_hostA2")
class Test:
def test_cold_intrapool_migration(self, host, hostA2, vm_on_ext_sr, ext_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_ext_sr, host, ext_sr, hostA2, local_sr_on_hostA2)
def test_cold_intrapool_migration(self, host, hostA2, vm_on_ext_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_ext_sr, host, hostA2, local_sr_on_hostA2)

def test_live_intrapool_migration(self, host, hostA2, vm_on_ext_sr, ext_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_ext_sr, host, ext_sr, hostA2, local_sr_on_hostA2)
def test_live_intrapool_migration(self, host, hostA2, vm_on_ext_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_ext_sr, host, hostA2, local_sr_on_hostA2)
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostB1", "local_sr_on_hostB1", "sr_disk_for_all_hosts")
class Test:
def test_cold_crosspool_migration(self, host, hostB1, vm_on_glusterfs_sr, glusterfs_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_glusterfs_sr, host, glusterfs_sr, hostB1, local_sr_on_hostB1)
def test_cold_crosspool_migration(self, host, hostB1, vm_on_glusterfs_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_glusterfs_sr, host, hostB1, local_sr_on_hostB1)

def test_live_crosspool_migration(self, host, hostB1, vm_on_glusterfs_sr, glusterfs_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_glusterfs_sr, host, glusterfs_sr, hostB1, local_sr_on_hostB1)
def test_live_crosspool_migration(self, host, hostB1, vm_on_glusterfs_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_glusterfs_sr, host, hostB1, local_sr_on_hostB1)
13 changes: 7 additions & 6 deletions tests/storage/glusterfs/test_glusterfs_sr_intrapool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostA2", "local_sr_on_hostA2", "sr_disk_for_all_hosts")
class Test:
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_glusterfs_sr, glusterfs_sr):
live_storage_migration_then_come_back(vm_on_glusterfs_sr, host, glusterfs_sr, hostA2, glusterfs_sr)
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_glusterfs_sr):
sr = vm_on_glusterfs_sr.get_sr()
live_storage_migration_then_come_back(vm_on_glusterfs_sr, host, hostA2, sr)

def test_cold_intrapool_migration(self, host, hostA2, vm_on_glusterfs_sr, glusterfs_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_glusterfs_sr, host, glusterfs_sr, hostA2, local_sr_on_hostA2)
def test_cold_intrapool_migration(self, host, hostA2, vm_on_glusterfs_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_glusterfs_sr, host, hostA2, local_sr_on_hostA2)

def test_live_intrapool_migration(self, host, hostA2, vm_on_glusterfs_sr, glusterfs_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_glusterfs_sr, host, glusterfs_sr, hostA2, local_sr_on_hostA2)
def test_live_intrapool_migration(self, host, hostA2, vm_on_glusterfs_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_glusterfs_sr, host, hostA2, local_sr_on_hostA2)
8 changes: 4 additions & 4 deletions tests/storage/linstor/test_linstor_sr_crosspool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
@pytest.mark.big_vm # and ideally on a big VM to test it scales
@pytest.mark.usefixtures("hostB1", "local_sr_on_hostB1")
class Test:
def test_cold_crosspool_migration(self, host, hostB1, vm_on_linstor_sr, linstor_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_linstor_sr, host, linstor_sr, hostB1, local_sr_on_hostB1)
def test_cold_crosspool_migration(self, host, hostB1, vm_on_linstor_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_linstor_sr, host, hostB1, local_sr_on_hostB1)

def test_live_crosspool_migration(self, host, hostB1, vm_on_linstor_sr, linstor_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_linstor_sr, host, linstor_sr, hostB1, local_sr_on_hostB1)
def test_live_crosspool_migration(self, host, hostB1, vm_on_linstor_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_linstor_sr, host, hostB1, local_sr_on_hostB1)
13 changes: 7 additions & 6 deletions tests/storage/linstor/test_linstor_sr_intrapool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostA2", "local_sr_on_hostA2")
class Test:
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_linstor_sr, linstor_sr):
live_storage_migration_then_come_back(vm_on_linstor_sr, host, linstor_sr, hostA2, linstor_sr)
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_linstor_sr):
sr = vm_on_linstor_sr.get_sr()
live_storage_migration_then_come_back(vm_on_linstor_sr, host, hostA2, sr)

def test_cold_intrapool_migration(self, host, hostA2, vm_on_linstor_sr, linstor_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_linstor_sr, host, linstor_sr, hostA2, local_sr_on_hostA2)
def test_cold_intrapool_migration(self, host, hostA2, vm_on_linstor_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_linstor_sr, host, hostA2, local_sr_on_hostA2)

def test_live_intrapool_migration(self, host, hostA2, vm_on_linstor_sr, linstor_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_linstor_sr, host, linstor_sr, hostA2, local_sr_on_hostA2)
def test_live_intrapool_migration(self, host, hostA2, vm_on_linstor_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_linstor_sr, host, hostA2, local_sr_on_hostA2)
8 changes: 4 additions & 4 deletions tests/storage/lvm/test_lvm_sr_crosspool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostB1", "local_sr_on_hostB1")
class Test:
def test_cold_crosspool_migration(self, host, hostB1, vm_on_lvm_sr, lvm_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_lvm_sr, host, lvm_sr, hostB1, local_sr_on_hostB1)
def test_cold_crosspool_migration(self, host, hostB1, vm_on_lvm_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_lvm_sr, host, hostB1, local_sr_on_hostB1)

def test_live_crosspool_migration(self, host, hostB1, vm_on_lvm_sr, lvm_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_lvm_sr, host, lvm_sr, hostB1, local_sr_on_hostB1)
def test_live_crosspool_migration(self, host, hostB1, vm_on_lvm_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_lvm_sr, host, hostB1, local_sr_on_hostB1)
8 changes: 4 additions & 4 deletions tests/storage/lvm/test_lvm_sr_intrapool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostA2", "local_sr_on_hostA2")
class Test:
def test_cold_intrapool_migration(self, host, hostA2, vm_on_lvm_sr, lvm_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_lvm_sr, host, lvm_sr, hostA2, local_sr_on_hostA2)
def test_cold_intrapool_migration(self, host, hostA2, vm_on_lvm_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_lvm_sr, host, hostA2, local_sr_on_hostA2)

def test_live_intrapool_migration(self, host, hostA2, vm_on_lvm_sr, lvm_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_lvm_sr, host, lvm_sr, hostA2, local_sr_on_hostA2)
def test_live_intrapool_migration(self, host, hostA2, vm_on_lvm_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_lvm_sr, host, hostA2, local_sr_on_hostA2)
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostB1", "local_sr_on_hostB1")
class Test:
def test_cold_crosspool_migration(self, host, hostB1, vm_on_lvmoiscsi_sr, lvmoiscsi_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_lvmoiscsi_sr, host, lvmoiscsi_sr, hostB1, local_sr_on_hostB1)
def test_cold_crosspool_migration(self, host, hostB1, vm_on_lvmoiscsi_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_lvmoiscsi_sr, host, hostB1, local_sr_on_hostB1)

def test_live_crosspool_migration(self, host, hostB1, vm_on_lvmoiscsi_sr, lvmoiscsi_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_lvmoiscsi_sr, host, lvmoiscsi_sr, hostB1, local_sr_on_hostB1)
def test_live_crosspool_migration(self, host, hostB1, vm_on_lvmoiscsi_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_lvmoiscsi_sr, host, hostB1, local_sr_on_hostB1)
13 changes: 7 additions & 6 deletions tests/storage/lvmoiscsi/test_lvmoiscsi_sr_intrapool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostA2", "local_sr_on_hostA2")
class Test:
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_lvmoiscsi_sr, lvmoiscsi_sr):
live_storage_migration_then_come_back(vm_on_lvmoiscsi_sr, host, lvmoiscsi_sr, hostA2, lvmoiscsi_sr)
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_lvmoiscsi_sr):
sr = vm_on_lvmoiscsi_sr.get_sr()
live_storage_migration_then_come_back(vm_on_lvmoiscsi_sr, host, hostA2, sr)

def test_cold_intrapool_migration(self, host, hostA2, vm_on_lvmoiscsi_sr, lvmoiscsi_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_lvmoiscsi_sr, host, lvmoiscsi_sr, hostA2, local_sr_on_hostA2)
def test_cold_intrapool_migration(self, host, hostA2, vm_on_lvmoiscsi_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_lvmoiscsi_sr, host, hostA2, local_sr_on_hostA2)

def test_live_intrapool_migration(self, host, hostA2, vm_on_lvmoiscsi_sr, lvmoiscsi_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_lvmoiscsi_sr, host, lvmoiscsi_sr, hostA2, local_sr_on_hostA2)
def test_live_intrapool_migration(self, host, hostA2, vm_on_lvmoiscsi_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_lvmoiscsi_sr, host, hostA2, local_sr_on_hostA2)
8 changes: 4 additions & 4 deletions tests/storage/moosefs/test_moosefs_sr_crosspool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
@pytest.mark.big_vm # and ideally on a big VM to test it scales
@pytest.mark.usefixtures("hostB1", "local_sr_on_hostB1", "host_no_ipv6") # MooseFS doesn't support IPv6
class Test:
def test_cold_crosspool_migration(self, host, hostB1, vm_on_moosefs_sr, moosefs_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_moosefs_sr, host, moosefs_sr, hostB1, local_sr_on_hostB1)
def test_cold_crosspool_migration(self, host, hostB1, vm_on_moosefs_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_moosefs_sr, host, hostB1, local_sr_on_hostB1)

def test_live_crosspool_migration(self, host, hostB1, vm_on_moosefs_sr, moosefs_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_moosefs_sr, host, moosefs_sr, hostB1, local_sr_on_hostB1)
def test_live_crosspool_migration(self, host, hostB1, vm_on_moosefs_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_moosefs_sr, host, hostB1, local_sr_on_hostB1)
13 changes: 7 additions & 6 deletions tests/storage/moosefs/test_moosefs_sr_intrapool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
@pytest.mark.big_vm # and ideally on a big VM to test it scales
@pytest.mark.usefixtures("hostA2", "local_sr_on_hostA2", "host_no_ipv6") # MooseFS doesn't support IPv6
class Test:
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_moosefs_sr, moosefs_sr):
live_storage_migration_then_come_back(vm_on_moosefs_sr, host, moosefs_sr, hostA2, moosefs_sr)
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_moosefs_sr):
sr = vm_on_moosefs_sr.get_sr()
live_storage_migration_then_come_back(vm_on_moosefs_sr, host, hostA2, sr)

def test_cold_intrapool_migration(self, host, hostA2, vm_on_moosefs_sr, moosefs_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_moosefs_sr, host, moosefs_sr, hostA2, local_sr_on_hostA2)
def test_cold_intrapool_migration(self, host, hostA2, vm_on_moosefs_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_moosefs_sr, host, hostA2, local_sr_on_hostA2)

def test_live_intrapool_migration(self, host, hostA2, vm_on_moosefs_sr, moosefs_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_moosefs_sr, host, moosefs_sr, hostA2, local_sr_on_hostA2)
def test_live_intrapool_migration(self, host, hostA2, vm_on_moosefs_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_moosefs_sr, host, hostA2, local_sr_on_hostA2)
5 changes: 2 additions & 3 deletions tests/storage/nfs/test_nfs_sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def test_create_and_destroy_sr(self, host, nfs_device_config):
vm.destroy(verify=True)
sr.destroy(verify=True)

@pytest.mark.usefixtures("nfs_sr")
class TestNFSSR:
@pytest.mark.quicktest
def test_quicktest(self, nfs_sr):
Expand Down Expand Up @@ -47,9 +46,9 @@ def test_snapshot(self, vm_on_nfs_sr):

@pytest.mark.reboot
@pytest.mark.small_vm
def test_reboot(self, host, nfs_sr, vm_on_nfs_sr):
sr = nfs_sr
def test_reboot(self, host, vm_on_nfs_sr):
vm = vm_on_nfs_sr
sr = vm.get_sr()
host.reboot(verify=True)
wait_for(sr.all_pbds_attached, "Wait for PBD attached")
# start the VM as a way to check that the underlying SR is operational
Expand Down
8 changes: 4 additions & 4 deletions tests/storage/nfs/test_nfs_sr_crosspool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostB1", "local_sr_on_hostB1")
class Test:
def test_cold_crosspool_migration(self, host, hostB1, vm_on_nfs_sr, nfs_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_nfs_sr, host, nfs_sr, hostB1, local_sr_on_hostB1)
def test_cold_crosspool_migration(self, host, hostB1, vm_on_nfs_sr, local_sr_on_hostB1):
cold_migration_then_come_back(vm_on_nfs_sr, host, hostB1, local_sr_on_hostB1)

def test_live_crosspool_migration(self, host, hostB1, vm_on_nfs_sr, nfs_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_nfs_sr, host, nfs_sr, hostB1, local_sr_on_hostB1)
def test_live_crosspool_migration(self, host, hostB1, vm_on_nfs_sr, local_sr_on_hostB1):
live_storage_migration_then_come_back(vm_on_nfs_sr, host, hostB1, local_sr_on_hostB1)
13 changes: 7 additions & 6 deletions tests/storage/nfs/test_nfs_sr_intrapool_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
@pytest.mark.big_vm # and ideally with a big VM to test it scales
@pytest.mark.usefixtures("hostA2", "local_sr_on_hostA2")
class Test:
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_nfs_sr, nfs_sr):
live_storage_migration_then_come_back(vm_on_nfs_sr, host, nfs_sr, hostA2, nfs_sr)
def test_live_intrapool_shared_migration(self, host, hostA2, vm_on_nfs_sr):
sr = vm_on_nfs_sr.get_sr()
live_storage_migration_then_come_back(vm_on_nfs_sr, host, hostA2, sr)

def test_cold_intrapool_migration(self, host, hostA2, vm_on_nfs_sr, nfs_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_nfs_sr, host, nfs_sr, hostA2, local_sr_on_hostA2)
def test_cold_intrapool_migration(self, host, hostA2, vm_on_nfs_sr, local_sr_on_hostA2):
cold_migration_then_come_back(vm_on_nfs_sr, host, hostA2, local_sr_on_hostA2)

def test_live_intrapool_migration(self, host, hostA2, vm_on_nfs_sr, nfs_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_nfs_sr, host, nfs_sr, hostA2, local_sr_on_hostA2)
def test_live_intrapool_migration(self, host, hostA2, vm_on_nfs_sr, local_sr_on_hostA2):
live_storage_migration_then_come_back(vm_on_nfs_sr, host, hostA2, local_sr_on_hostA2)
6 changes: 4 additions & 2 deletions tests/storage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ def try_to_create_sr_with_missing_device(sr_type, label, host):
return
assert False, 'SR creation should not have succeeded!'

def cold_migration_then_come_back(vm, prov_host, prov_sr, dest_host, dest_sr):
def cold_migration_then_come_back(vm, prov_host, dest_host, dest_sr):
""" Storage migration of a shutdown VM, then migrate it back. """
prov_sr = vm.get_sr()
assert vm.is_halted()
# Move the VM to another host of the pool
vm.migrate(dest_host, dest_sr)
Expand All @@ -31,7 +32,8 @@ def cold_migration_then_come_back(vm, prov_host, prov_sr, dest_host, dest_sr):
vm.wait_for_os_booted()
vm.shutdown(verify=True)

def live_storage_migration_then_come_back(vm, prov_host, prov_sr, dest_host, dest_sr):
def live_storage_migration_then_come_back(vm, prov_host, dest_host, dest_sr):
prov_sr = vm.get_sr()
# start VM
vm.start(on=prov_host.uuid)
vm.wait_for_os_booted()
Expand Down
Loading

0 comments on commit b074cc8

Please sign in to comment.