import collections
import glob
import json
import os
import re
import sys
class Iperf(object):
def __init__(self, runner=None, bind=None):
self.run = runner
self.bind = bind
def Ping(self,host):
args = ['-c', '1', host]
return (self.run(['ping'] + args).succeeded or self.run(['ping6'] + args).succeeded)
链接:https://gfiber.googlesource.com/vendor/google/test/+/master/wifitables/iperf.py