コード例 #1
0
ファイル: test_volumes.py プロジェクト: cloudoop/sahara
 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(ex.SystemError, volumes._await_attach_volumes,
                       instance, 3)
コード例 #2
0
 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'])
コード例 #3
0
ファイル: test_volumes.py プロジェクト: jfrodriguez/sahara
 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"]
     )
コード例 #4
0
 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)
コード例 #5
0
ファイル: test_volumes.py プロジェクト: egafford/sahara
 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'])
コード例 #6
0
 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'])
コード例 #7
0
ファイル: test_volumes.py プロジェクト: kevinshan/sahara
 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)