multiport_stress.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:avocado-misc-tests 作者: avocado-framework-tests 项目源码 文件源码
def setUp(self):
        '''
        To check and install dependencies for the test
        '''
        self.host_interfaces = self.params.get("host_interfaces",
                                               default="").split(",")
        if not self.host_interfaces:
            self.cancel("user should specify host interfaces")
        smm = SoftwareManager()
        if distro.detect().name == 'Ubuntu':
            pkg = 'iputils-ping'
        else:
            pkg = 'iputils'
        if not smm.check_installed(pkg) and not smm.install(pkg):
            self.cancel("Package %s is needed to test" % pkg)
        self.peer_ips = self.params.get("peer_ips",
                                        default="").split(",")
        interfaces = netifaces.interfaces()
        for self.host_interface in self.host_interfaces:
            if self.host_interface not in interfaces:
                self.cancel("interface is not available")
        self.count = self.params.get("count", default="1000")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号