コード例 #1
0
ファイル: iperf.py プロジェクト: netixx/NetProbes
 def doTest(self):
     """Does the actual test"""
     for target in self.targets:
         targetIp = TestServices.getProbeIpById(target)
         if self.options.protocol == self.PROTO_TCP:
             attempts = 0
             telnetCli = 'sh -c "echo A | telnet -e A {ip} {port}"'
             while ('Connected' not in TestServices.runCmd(telnetCli.format(ip = targetIp, port = self.options.port))[0].decode()
                    and attempts < self.MAX_ATTEMPTS):
                 attempts += 1
                 time.sleep(.5)
         self.outputs[target] = TestServices.runCmd(self.cmd.format(ip = targetIp))
コード例 #2
0
ファイル: iperf.py プロジェクト: netixx/NetProbes
 def doTest(self):
     """Does the actual test"""
     for target in self.targets:
         targetIp = TestServices.getProbeIpById(target)
         if self.options.protocol == self.PROTO_TCP:
             attempts = 0
             telnetCli = 'sh -c "echo A | telnet -e A {ip} {port}"'
             while ('Connected' not in TestServices.runCmd(
                     telnetCli.format(ip=targetIp,
                                      port=self.options.port))[0].decode()
                    and attempts < self.MAX_ATTEMPTS):
                 attempts += 1
                 time.sleep(.5)
         self.outputs[target] = TestServices.runCmd(
             self.cmd.format(ip=targetIp))
コード例 #3
0
ファイル: delay.py プロジェクト: netixx/NetProbes
 def makePing(cls, ip, **options):
     opts = {}
     opts.update(cls.DEFAULT_OPTIONS)
     opts.update(options)
     opstr = ''
     for opt, val in opts.items():
         opstr += cls._addOption(opt, val)
     stdout, stderr, code = TestServices.runCmd(cls._ping_cmd.format(opts = opstr, ip = ip))
     # if isSweep:
     #     return cls._parseSweepPing(str(stdout.decode()))
     return cls._parsePing(str(stdout.decode()))
コード例 #4
0
ファイル: delay.py プロジェクト: netixx/NetProbes
 def makePing(cls, ip, **options):
     opts = {}
     opts.update(cls.DEFAULT_OPTIONS)
     opts.update(options)
     opstr = ''
     for opt, val in opts.items():
         opstr += cls._addOption(opt, val)
     stdout, stderr, code = TestServices.runCmd(
         cls._ping_cmd.format(opts=opstr, ip=ip))
     # if isSweep:
     #     return cls._parseSweepPing(str(stdout.decode()))
     return cls._parsePing(str(stdout.decode()))
コード例 #5
0
ファイル: igi.py プロジェクト: nonsns/NetProbes
 def doTest(self):
     """Does the actual test"""
     for target in self.targets:
         targetIp = TestServices.getProbeIpById(target)
         self.outputs[target] = TestServices.runCmd(self.cmd.format(ip = targetIp))