diff options
| author | Lorin Hochstein <lorin@isi.edu> | 2011-06-16 20:06:56 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-06-16 20:06:56 +0000 |
| commit | 1763419a3f6b01bb0ef98c700f0f350e756b359c (patch) | |
| tree | 8cff47ba327fc91ae74c2ca48aef07071a090fa3 | |
| parent | 7c583997df2c243c4bd21f876da4658331efe37d (diff) | |
| parent | b00628c4767b440fa6123aa1683d88cd33517d21 (diff) | |
Fixes a bug where a unit test sometimes fails due to a race condition.
| -rw-r--r-- | nova/tests/test_cloud.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py index 13046f861..d2ff14f27 100644 --- a/nova/tests/test_cloud.py +++ b/nova/tests/test_cloud.py @@ -457,6 +457,12 @@ class CloudTestCase(test.TestCase): self.cloud.delete_key_pair(self.context, 'test') def test_run_instances(self): + # stub out the rpc call + def stub_cast(*args, **kwargs): + pass + + self.stubs.Set(rpc, 'cast', stub_cast) + kwargs = {'image_id': FLAGS.default_image, 'instance_type': FLAGS.default_instance_type, 'max_count': 1} @@ -466,7 +472,7 @@ class CloudTestCase(test.TestCase): self.assertEqual(instance['imageId'], 'ami-00000001') self.assertEqual(instance['displayName'], 'Server 1') self.assertEqual(instance['instanceId'], 'i-00000001') - self.assertEqual(instance['instanceState']['name'], 'networking') + self.assertEqual(instance['instanceState']['name'], 'scheduling') self.assertEqual(instance['instanceType'], 'm1.small') def test_run_instances_image_state_none(self): |
