當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。