Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 def get_migration_session(self):
     return VNXMigrationSession.get(self._cli, self)
Ejemplo n.º 4
0
 def get_migration_session(self, src_lun=None):
     return VNXMigrationSession.get(self._cli, src_lun)
Ejemplo n.º 5
0
 def f():
     ms = VNXMigrationSession(0, t_cli())
     ms.cancel()
Ejemplo n.º 6
0
 def test_get_lun_not_exists(self):
     ms = VNXMigrationSession(1234, t_cli())
     assert_that(ms.existed, equal_to(False))
Ejemplo n.º 7
0
 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))
Ejemplo n.º 8
0
 def test_get_all_none(self):
     ms_list = VNXMigrationSession.get(t_cli())
     assert_that(len(ms_list), equal_to(0))
Ejemplo n.º 9
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))
Ejemplo n.º 10
0
 def f():
     ms = VNXMigrationSession(0, t_cli())
     ms.cancel()
Ejemplo n.º 11
0
 def test_get_all_none(self):
     ms_list = VNXMigrationSession.get(t_cli())
     assert_that(len(ms_list), equal_to(0))
Ejemplo n.º 12
0
Archivo: lun.py Proyecto: crook/storops
 def get_migration_session(self):
     return VNXMigrationSession.get(self._cli, self)