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


Python VerificationOpsSrv.get_ops_vm方法代码示例

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


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

示例1: verify_vm_uve

# 需要导入模块: from opserver_introspect_utils import VerificationOpsSrv [as 别名]
# 或者: from opserver_introspect_utils.VerificationOpsSrv import get_ops_vm [as 别名]
 def verify_vm_uve(self, vm_id, num_vm_ifs, msg_count, opserver_port=None):
     if opserver_port is not None:
         vns = VerificationOpsSrv('127.0.0.1', opserver_port)
     else:
         vns = VerificationOpsSrv('127.0.0.1', self._opserver_port)
     res = vns.get_ops_vm(vm_id)
     if res == {}:
         return False
     else:
         assert(len(res) > 0)
         self._logger.info(str(res))
         anum_vm_ifs = len(res.get_attr('Agent', 'interface_list'))
         assert anum_vm_ifs == num_vm_ifs
         anum_vm_if_stats = len(res.get_attr('Agent', 'if_stats_list'))
         assert anum_vm_if_stats == num_vm_ifs
         for i in range(num_vm_ifs):
             vm_if_dict = res.get_attr('Agent', 'interface_list')[i]
             vm_if_stats_dict = res.get_attr('Agent', 'if_stats_list')[i]
             evm_if_name = self._VM_IF_PREFIX + str(i)
             avm_if_name = vm_if_dict['name']
             assert avm_if_name == evm_if_name
             avm_if_stats_name = vm_if_stats_dict['name']
             assert avm_if_stats_name == evm_if_name
             epkt_count = self._INITIAL_PKT_COUNT + \
                 (msg_count - 1) * self._PKTS_PER_SEC
             apkt_count = vm_if_stats_dict['in_pkts']
             assert int(apkt_count) == epkt_count
             ebyte_count = epkt_count * self._BYTES_PER_PACKET
             abyte_count = vm_if_stats_dict['in_bytes']
             assert int(abyte_count) == ebyte_count
         return True
开发者ID:anju078,项目名称:contrail-controller,代码行数:33,代码来源:generator_fixture.py

示例2: verify_vm_uve

# 需要导入模块: from opserver_introspect_utils import VerificationOpsSrv [as 别名]
# 或者: from opserver_introspect_utils.VerificationOpsSrv import get_ops_vm [as 别名]
 def verify_vm_uve(self, vm_id, num_vm_ifs, msg_count):
     vns = VerificationOpsSrv("127.0.0.1", self._opserver_port)
     res = vns.get_ops_vm(vm_id)
     if res == {}:
         return False
     else:
         assert len(res) > 0
         self._logger.info(str(res))
         anum_vm_ifs = len(res.get_attr("Agent", "interface_list"))
         assert anum_vm_ifs == num_vm_ifs
         anum_vm_if_stats = len(res.get_attr("Agent", "if_stats_list"))
         assert anum_vm_if_stats == num_vm_ifs
         for i in range(num_vm_ifs):
             vm_if_dict = res.get_attr("Agent", "interface_list")[i]
             vm_if_stats_dict = res.get_attr("Agent", "if_stats_list")[i]
             evm_if_name = self._VM_IF_PREFIX + str(i)
             avm_if_name = vm_if_dict["name"]
             assert avm_if_name == evm_if_name
             avm_if_stats_name = vm_if_stats_dict["name"]
             assert avm_if_stats_name == evm_if_name
             epkt_count = self._INITIAL_PKT_COUNT + (msg_count - 1) * self._PKTS_PER_SEC
             apkt_count = vm_if_stats_dict["in_pkts"]
             assert int(apkt_count) == epkt_count
             ebyte_count = epkt_count * self._BYTES_PER_PACKET
             abyte_count = vm_if_stats_dict["in_bytes"]
             assert int(abyte_count) == ebyte_count
         return True
开发者ID:npchandran,项目名称:contrail-controller,代码行数:29,代码来源:generator_fixture.py

示例3: verify_vm_uve

# 需要导入模块: from opserver_introspect_utils import VerificationOpsSrv [as 别名]
# 或者: from opserver_introspect_utils.VerificationOpsSrv import get_ops_vm [as 别名]
 def verify_vm_uve(self, vm_id, num_vm_ifs, msg_count, opserver_port=None):
     if opserver_port is not None:
         vns = VerificationOpsSrv('127.0.0.1', opserver_port)
     else:
         vns = VerificationOpsSrv('127.0.0.1', self._opserver_port)
     res = vns.get_ops_vm(vm_id)
     if res == {}:
         return False
     else:
         assert(len(res) > 0)
         self._logger.info(str(res))
         anum_vm_ifs = len(res.get_attr('Agent', 'interface_list'))
         assert anum_vm_ifs == num_vm_ifs
         for i in range(num_vm_ifs):
             vm_if_dict = res.get_attr('Agent', 'interface_list')[i]
             evm_if_name = self._VM_IF_PREFIX + str(i)
             avm_if_name = vm_if_dict['name']
             assert avm_if_name == evm_if_name
         return True
开发者ID:eonpatapon,项目名称:contrail-controller,代码行数:21,代码来源:generator_fixture.py


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