本文整理汇总了Python中neutron.plugins.openvswitch.ovs_db_v2.release_tunnel函数的典型用法代码示例。如果您正苦于以下问题:Python release_tunnel函数的具体用法?Python release_tunnel怎么用?Python release_tunnel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了release_tunnel函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_specific_tunnel_outside_pool
def test_specific_tunnel_outside_pool(self):
tunnel_id = TUN_MAX + 5
self.assertIsNone(ovs_db_v2.get_tunnel_allocation(tunnel_id))
ovs_db_v2.reserve_specific_tunnel(self.session, tunnel_id)
self.assertTrue(ovs_db_v2.get_tunnel_allocation(tunnel_id).allocated)
with testtools.ExpectedException(n_exc.TunnelIdInUse):
ovs_db_v2.reserve_specific_tunnel(self.session, tunnel_id)
ovs_db_v2.release_tunnel(self.session, tunnel_id, TUNNEL_RANGES)
self.assertIsNone(ovs_db_v2.get_tunnel_allocation(tunnel_id))
开发者ID:PFZheng,项目名称:neutron,代码行数:11,代码来源:test_ovs_db.py
示例2: test_tunnel_pool
def test_tunnel_pool(self):
tunnel_ids = set()
for x in moves.xrange(TUN_MIN, TUN_MAX + 1):
tunnel_id = ovs_db_v2.reserve_tunnel(self.session)
self.assertThat(tunnel_id, matchers.GreaterThan(TUN_MIN - 1))
self.assertThat(tunnel_id, matchers.LessThan(TUN_MAX + 1))
tunnel_ids.add(tunnel_id)
with testtools.ExpectedException(n_exc.NoNetworkAvailable):
tunnel_id = ovs_db_v2.reserve_tunnel(self.session)
ovs_db_v2.release_tunnel(self.session, tunnel_ids.pop(), TUNNEL_RANGES)
tunnel_id = ovs_db_v2.reserve_tunnel(self.session)
self.assertThat(tunnel_id, matchers.GreaterThan(TUN_MIN - 1))
self.assertThat(tunnel_id, matchers.LessThan(TUN_MAX + 1))
tunnel_ids.add(tunnel_id)
for tunnel_id in tunnel_ids:
ovs_db_v2.release_tunnel(self.session, tunnel_id, TUNNEL_RANGES)
开发者ID:PFZheng,项目名称:neutron,代码行数:19,代码来源:test_ovs_db.py
注:本文中的neutron.plugins.openvswitch.ovs_db_v2.release_tunnel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论