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")
tcpdump.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录