def test_properties(self): ms = VNXMigrationSession(0, t_cli()) assert_that(ms.source_lu_id, equal_to(0)) assert_that(ms.source_lu_name, equal_to('LUN 0')) assert_that(ms.dest_lu_id, equal_to(1)) assert_that(ms.dest_lu_name, equal_to('LUN 1')) assert_that(ms.migration_rate, equal_to(VNXMigrationRate.HIGH)) assert_that(ms.percent_complete, equal_to(50.0)) assert_that(ms.time_remaining, equal_to('0 second(s)')) assert_that(ms.current_state, equal_to('MIGRATING')) assert_that(ms.existed, equal_to(True))
def _wait_for_migration_done(self, on_complete=None, on_error=None): migration = VNXMigrationSession(source=self, cli=self._cli) if migration.is_migrating: raise _IsMigratingError() elif migration.is_success and on_complete: ret = on_complete() elif on_error: ret = on_error() else: ret = None return ret
def get_migration_session(self): return VNXMigrationSession.get(self._cli, self)
def get_migration_session(self, src_lun=None): return VNXMigrationSession.get(self._cli, src_lun)
def f(): ms = VNXMigrationSession(0, t_cli()) ms.cancel()
def test_get_lun_not_exists(self): ms = VNXMigrationSession(1234, t_cli()) assert_that(ms.existed, equal_to(False))
def test_get_no_session(self): ms = VNXMigrationSession(10, t_cli()) assert_that(ms.existed, equal_to(False)) assert_that(ms.is_migrating, equal_to(False)) assert_that(ms.is_success, equal_to(True))
def test_get_all_none(self): ms_list = VNXMigrationSession.get(t_cli()) assert_that(len(ms_list), equal_to(0))
def test_destination_lun(self): ms = VNXMigrationSession(0, t_cli()) lun = ms.destination_lun assert_that(lun, instance_of(VNXLun)) assert_that(lun.get_id(lun), equal_to(ms.dest_lu_id))