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