def test_await_attach_volume(self, dev_count, p_sleep): dev_count.return_value = 2 p_sleep.return_value = None instance = r.InstanceResource({'instance_id': '123454321', 'instance_name': 'instt'}) self.assertIsNone(volumes._await_attach_volumes( instance, ['/dev/vda', '/dev/vdb'])) self.assertRaises(ex.SystemError, volumes._await_attach_volumes, instance, ['/dev/vda', '/dev/vdb', '/dev/vdc'])
def test_await_attach_volume(self, dev_paths, p_sleep): dev_paths.return_value = ['/dev/vda', '/dev/vdb'] p_sleep.return_value = None instance = r.InstanceResource({ 'instance_id': '123454321', 'instance_name': 'instt' }) self.assertIsNone(volumes._await_attach_volumes(instance, 2)) self.assertRaises(RuntimeError, volumes._await_attach_volumes, instance, 3)
def test_await_attach_volume(self, dev_count, p_sleep, p_get_cons): self.override_config('await_attach_volumes', 0, group='timeouts') dev_count.return_value = 2 p_sleep.return_value = None instance = r.InstanceResource({'instance_id': '123454321', 'instance_name': 'instt'}) self.assertIsNone(volumes._await_attach_volumes( instance, ['/dev/vda', '/dev/vdb'])) self.assertRaises(ex.TimeoutException, volumes._await_attach_volumes, instance, ['/dev/vda', '/dev/vdb', '/dev/vdc'])