当前位置: 首页>>代码示例>>Python>>正文


Python FakeDeviceConnect.reset方法代码示例

本文整理汇总了Python中test_dm_utils.FakeDeviceConnect.reset方法的典型用法代码示例。如果您正苦于以下问题:Python FakeDeviceConnect.reset方法的具体用法?Python FakeDeviceConnect.reset怎么用?Python FakeDeviceConnect.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在test_dm_utils.FakeDeviceConnect的用法示例。


在下文中一共展示了FakeDeviceConnect.reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_dm_instance

# 需要导入模块: from test_dm_utils import FakeDeviceConnect [as 别名]
# 或者: from test_dm_utils.FakeDeviceConnect import reset [as 别名]
 def test_dm_instance(self):
     FakeDeviceConnect.reset()
     kill_device_manager(TestInfraDM._dm_greenlet)
     self.check_dm_instance()
     TestInfraDM._dm_greenlet = gevent.spawn(launch_device_manager,
         self._cluster_id, TestInfraDM._api_server_ip, TestInfraDM._api_server_port)
     wait_for_device_manager_up()
开发者ID:cijohnson,项目名称:contrail-controller,代码行数:9,代码来源:test_dm_infra.py

示例2: tearDown

# 需要导入模块: from test_dm_utils import FakeDeviceConnect [as 别名]
# 或者: from test_dm_utils.FakeDeviceConnect import reset [as 别名]
 def tearDown(self):
     FakeDeviceConnect.reset()
     FakeJobHandler.reset()
     super(DMTestCase, self).tearDown()
开发者ID:Juniper,项目名称:contrail-controller,代码行数:6,代码来源:test_case.py

示例3: test_dm_plugins

# 需要导入模块: from test_dm_utils import FakeDeviceConnect [as 别名]
# 或者: from test_dm_utils.FakeDeviceConnect import reset [as 别名]
    def test_dm_plugins(self):
        # check basic valid vendor, product plugin
        bgp_router, pr = self.create_router('router100' + self.id(), '1.1.1.1',
                                                            product=self.product)
        self.check_dm_plugin()
        pr_config = FakeDeviceConnect.params.get("pr_config")

        # update valid another vendor, product; another plugin should be found
        FakeDeviceConnect.reset()
        FakeNetconfManager.set_model('qfx5110')
        pr.physical_router_vendor_name = "juniper"
        pr.physical_router_product_name = "qfx5110"
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_plugin()

        FakeDeviceConnect.reset()
        FakeNetconfManager.set_model('qfx5100')
        pr.physical_router_vendor_name = "juniper"
        pr.physical_router_product_name = "qfx5100"
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_plugin()

        FakeDeviceConnect.reset()
        FakeNetconfManager.set_model('qfx5200')
        pr.physical_router_vendor_name = "juniper"
        pr.physical_router_product_name = "qfx5200"
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_plugin()

        FakeDeviceConnect.reset()
        FakeNetconfManager.set_model('qfx5300')
        pr.physical_router_vendor_name = "juniper"
        pr.physical_router_product_name = "qfx5300"
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_plugin(is_valid=False)

        FakeDeviceConnect.reset()
        FakeNetconfManager.set_model('qfx10000')
        pr.physical_router_vendor_name = "juniper"
        pr.physical_router_product_name = "qfx10000"
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_plugin()

        # check invalid vendor, product; no plugin
        FakeDeviceConnect.reset()
        FakeNetconfManager.set_model('cix')
        pr.physical_router_vendor_name = "cix"
        pr.physical_router_product_name = "cix100"
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_plugin(is_valid=False)

        # update valid vendor, product; plugin should be found, config should be pushed
        FakeDeviceConnect.reset()
        FakeNetconfManager.set_model('mx80')
        pr.physical_router_vendor_name = "juniper"
        pr.physical_router_product_name = "mx"
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_plugin()

        FakeDeviceConnect.reset()
        FakeNetconfManager.set_model('mx480')
        pr.physical_router_vendor_name = "juniper"
        pr.physical_router_product_name = "mx480"
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_plugin()

        # device connection is down, config should not be pushed
        pr_config = FakeDeviceConnect.params.get("pr_config")
        pr_config._nc_manager.connected = False
        self.assertFalse(pr_config.is_connected())
        FakeDeviceConnect.reset()
        self.set_hold_time(bgp_router, 100)
        self._vnc_lib.bgp_router_update(bgp_router)
        self.check_dm_plugin(False)
        # device connection is up, config should be auto pushed
        pr_config._nc_manager.connected = True
        self.check_dm_plugin()

        # unset vnc-managed, should generate delete groups config
        pr.physical_router_vnc_managed = False
        self._vnc_lib.physical_router_update(pr)
        self.check_dm_delete_groups()

        # set vnc-managed, should generate groups config again
        pr.physical_router_vnc_managed = True
        self._vnc_lib.physical_router_update(pr)
        self.check_if_xml_is_generated()

        bgp_router_fq = bgp_router.get_fq_name()
        pr_fq = pr.get_fq_name()
        self.delete_routers(bgp_router, pr)
        self.wait_for_routers_delete(bgp_router_fq, pr_fq)
开发者ID:cijohnson,项目名称:contrail-controller,代码行数:94,代码来源:test_dm_infra.py


注:本文中的test_dm_utils.FakeDeviceConnect.reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。