예제 #1
0
 def test_allocate_address_overlimit(self):
     self.configure(external_network=fakes.NAME_OS_PUBLIC_NETWORK)
     self.neutron.list_networks.return_value = ({
         'networks': [{
             'id': fakes.ID_OS_PUBLIC_NETWORK
         }]
     })
     self.neutron.create_floatingip.side_effect = (
         neutron_exception.OverQuotaClient())
     self.assert_execution_error('AddressLimitExceeded', 'AllocateAddress',
                                 {'Domain': 'vpc'})
     self.assert_execution_error('AddressLimitExceeded', 'AllocateAddress',
                                 {})
예제 #2
0
 def test_create_security_group_over_quota(self):
     self.neutron.create_security_group.side_effect = (
         neutron_exception.OverQuotaClient(413))
     self.assert_execution_error(
         'ResourceLimitExceeded', 'CreateSecurityGroup', {
             'VpcId': fakes.ID_EC2_VPC_1,
             'GroupName': 'groupname',
             'GroupDescription': 'Group description'
         })
     secgroup_body = ({
         'security_group': {
             'name': 'groupname',
             'description': 'Group description'
         }
     })
     self.neutron.create_security_group.assert_called_once_with(
         secgroup_body)