Пример #1
0
    def recover(self):
        wan.sendcontrol('c')
        wan.expect(prompt)
        wan.sendline('killall -9 socat pv')
        wan.expect_exact('killall -9 socat pv')
        wan.expect(prompt)

        for d in [wan, lan]:
            d.sendcontrol('c')
            d.expect(prompt)
            d.sendline('pgrep -f d1:ad2:id20')
            d.expect_exact('pgrep -f d1:ad2:id20')
            d.expect(prompt)
            d.sendline('pkill -9 -f d1:ad2:id20')
            d.expect_exact('pkill -9 -f d1:ad2:id20')
            d.expect(prompt)
            d.sendline('killall -9 socat')
            d.expect_exact('killall -9 socat')
            d.expect(prompt)

        for ip, port in self.all_ips:
            self.cleanup_ip(ip)

        # this needs to be here because we need to make sure mpstat is cleaned up
        board.parse_stats(dict_to_log=self.logged)
        print("mpstat cpu usage = %s" % self.logged['mpstat'])
        self.result_message = "BitTorrent test with %s connections, cpu usage = %s" % (
            self.conns, self.logged['mpstat'])
Пример #2
0
    def recover(self):
        lan.sendcontrol('c')
        lan.expect(prompt)
        lan.sendline('pkill -9 -f hping3')
        lan.expect_exact('pkill -9 -f hping3')
        lan.expect(prompt)

        wan.sendcontrol('c')
        wan.expect(prompt)
        wan.sendline('pkill -9 -f nc ')
        wan.expect_exact('pkill -9 -f nc')
        wan.expect(prompt)

        board.parse_stats(dict_to_log=self.logged)

        args = (self.conn_rate, self.max_conns, self.logged['mpstat'])
        self.result_message = "hping3 udp firewall test, conn_rate = %s, max_conns = %s, cpu usage = %.2f" % args
Пример #3
0
    def recover(self):
        wan.sendcontrol('c')
        wan.expect(prompt)
        wan.sendline('killall -9 socat pv')
        wan.expect_exact('killall -9 socat pv')
        wan.expect(prompt)

        for d in [wan, lan]:
            d.sendcontrol('c')
            d.expect(prompt)
            d.sendline('pgrep -f d1:ad2:id20')
            d.expect_exact('pgrep -f d1:ad2:id20')
            d.expect(prompt)
            d.sendline('pkill -9 -f d1:ad2:id20')
            d.expect_exact('pkill -9 -f d1:ad2:id20')
            d.expect(prompt)
            d.sendline('killall -9 socat')
            d.expect_exact('killall -9 socat')
            d.expect(prompt)

        for ip, port in self.all_ips:
            self.cleanup_ip(ip)
Пример #4
0
 def recover(self):
     wan.sendcontrol('c')
Пример #5
0
 def recover(self):
     wan.sendcontrol('c')