def launch_ping(src_ip, dst_ip, username, passwd,
count, timeout, qrouter, filename):
cmd = 'sudo ip netns exec ' + str(qrouter)
cmd += ' python ping.py --src_ip %s --dst_ip %s --username "%s" --passwd "%s" --count %d --timeout %d' % \
(src_ip, dst_ip, username, passwd, count, timeout)
cmd += ' > %s 2>&1' % filename
p = subprocess.Popen(cmd, shell=True)
return p
评论列表
文章目录