Fix broken unit test for Euca agent.
@@ -28,7 +28,7 @@ class TestEucaAgent(TestCase):
new_reservation = Reservation()
new_reservation.instances = [instance, new_instance]
flexmock(EC2Connection).should_receive('get_all_instances').and_return([]) \
- .and_return([reservation]).and_return([new_reservation]).and_return([new_reservation])
+ .and_return([reservation]).and_return([new_reservation])
# first, validate that the run_instances call goes through successfully
# and gives the user a reservation id
@@ -41,7 +41,7 @@ class TestEucaAgent(TestCase):
'infrastructure': 'euca',
'instance_type': 'booinstance_type',
'keyname': 'bookeyname',
- 'num_vms': '2',
+ 'num_vms': '1',
'use_spot_instances': False,
'zone' : 'my-zone-1b',
'autoscale_agent' : True,
@@ -84,35 +84,6 @@ class TestEucaAgent(TestCase):
(flexmock(EC2Connection)
.should_receive('authorize_security_group')
.and_return())
-
- """
- reservation1 = Reservation()
-
- # the old implementation had a regression where public and private IPs
- # were getting sorted, and thus public ip1 would point to private ip 2.
- # to prevent this regression from resurfacing, set up the dns names so
- # that a sort would mess them up again.
- instance1 = flexmock(name='instance1', private_dns_name='DEF-private-ip1',
- public_dns_name='ABC-public-ip1', id='i-id1', state='running',
- key_name='bookeyname', ip_address='public-ip1',
- private_ip_address='private-ip1')
-
- instance2 = flexmock(name='instance2', private_dns_name='ABC-private-ip2',
- public_dns_name='DEF-public-ip2', id='i-id2', state='running',
- key_name='bookeyname', ip_address='public-ip2',
- private_ip_address='private-ip2')
-
- reservation1.instances = [instance1]
- reservation2 = Reservation()
- reservation2.instances = [instance1, instance2]
-
- (flexmock(EC2Connection)
- .should_receive('get_all_instances')
- .and_return([])
- .and_return([reservation1])
- .and_return([reservation2]))
-
- """
(flexmock(EC2Connection)
.should_receive('run_instances')
.and_return())
