def test_calculate_migration_delta(self): delta = driver_factory.calculate_migration_delta( 'drv', self.driver_cls, False) self.assertEqual( { 'driver': 'hw-type', 'console_interface': 'new-console', 'inspect_interface': 'new-inspect', 'raid_interface': 'no-raid', 'rescue_interface': 'no-rescue', 'vendor_interface': 'no-vendor' }, delta)
def test_calculate_migration_delta_unsupported_interface_reset(self): self.new_ifaces['inspect'] = 'unsupported inspect' delta = driver_factory.calculate_migration_delta( 'drv', self.driver_cls, True) self.assertEqual( { 'driver': 'hw-type', 'console_interface': 'new-console', 'inspect_interface': 'no-inspect', 'raid_interface': 'no-raid', 'rescue_interface': 'no-rescue', 'vendor_interface': 'no-vendor' }, delta)
def test__calculate_migration_delta_unsupported_interface(self): self.new_ifaces['inspect'] = 'unsupported inspect' delta = driver_factory.calculate_migration_delta( 'drv', self.driver_cls, False) self.assertIsNone(delta)
def test_calculate_migration_delta_unsupported_hw_type(self): self.driver_cls.to_hardware_type.return_value = ('hw-type2', self.new_ifaces) delta = driver_factory.calculate_migration_delta( 'drv', self.driver_cls, False) self.assertIsNone(delta)
def test_calculate_migration_delta_not_implemeted(self): self.driver_cls.to_hardware_type.side_effect = NotImplementedError() delta = driver_factory.calculate_migration_delta( 'drv', self.driver_cls, False) self.assertIsNone(delta)