Revision ed87a801 test_code/peerstreamer.py

View differences:

test_code/peerstreamer.py
59 59
        self.killAll()
60 60

  
61 61
class PSHostsTest(PSTest):
62
    def __init__(self, mininet, source_name, peer_names, 
63
            duration=300, name=None):
64
        super(PSHostsTest,self).__init__(mininet, duration = duration)
62
    def __init__(self, mininet, name, args):
63
        source_name = args["source_name"]
64
        peer_names = args["peer_names"]
65
        duration = int(args["duration"])
66
        super(PSHostsTest, self).__init__(mininet, duration = duration)
65 67
        self.source = mininet.get(source_name)
66
        for n in peer_names:
68
        for n in peer_names.split():
67 69
            self.hosts.append(mininet.get(n))
68 70
        self.setPrefix(name)
69 71

  
70 72
class PSRandomTest(PSTest):
71
    def __init__(self,mininet,duration=300,num_peers=5,name=None):
73
    def __init__(self, mininet, name, args):
74
        num_peers = int(args["num_peers"])
75
        duration = int(args["duration"])
72 76
        super(PSRandomTest,self).__init__(mininet,duration)
73 77
        self.hosts = self.getHostSample(num_peers)
74 78
        if len(self.hosts) > 0:

Also available in: Unified diff