diff options
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_network.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py index 69ac4f2a6..759650839 100644 --- a/nova/tests/test_network.py +++ b/nova/tests/test_network.py @@ -300,6 +300,7 @@ class VlanNetworkTestCase(test.TestCase): db.fixed_ip_associate(mox.IgnoreArg(), mox.IgnoreArg(), mox.IgnoreArg(), + mox.IgnoreArg(), reserved=True).AndReturn('192.168.0.1') db.fixed_ip_update(mox.IgnoreArg(), mox.IgnoreArg(), @@ -312,6 +313,19 @@ class VlanNetworkTestCase(test.TestCase): network['vpn_private_address'] = '192.168.0.2' self.network.allocate_fixed_ip(None, 0, network, vpn=True) + def test_vpn_allocate_fixed_ip_no_network_id(self): + network = dict(networks[0]) + network['vpn_private_address'] = '192.168.0.2' + network['id'] = None + context_admin = context.RequestContext('testuser', 'testproject', + is_admin=True) + self.assertRaises(exception.FixedIpNotFoundForNetwork, + self.network.allocate_fixed_ip, + context_admin, + 0, + network, + vpn=True) + def test_allocate_fixed_ip(self): self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool') self.mox.StubOutWithMock(db, 'fixed_ip_update') |
