tcpdump.py 文件源码

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

项目:avocado-misc-tests 作者: avocado-framework-tests 项目源码 文件源码
def setUp(self):
        """
        Set up.
        """
        self.iface = self.params.get("interface", default="")
        self.count = self.params.get("count", default="500")
        self.peer_ip = self.params.get("peer_ip", default="")
        self.drop = self.params.get("drop_accepted", default="10")
        # Check if interface exists in the system
        interfaces = netifaces.interfaces()
        if self.iface not in interfaces:
            self.cancel("%s interface is not available" % self.iface)
        if not self.peer_ip:
            self.cancel("peer ip should specify in input")

        # Install needed packages
        smm = SoftwareManager()
        if not smm.check_installed("tcpdump") and not smm.install("tcpdump"):
            self.cancel("Can not install tcpdump")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号