]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - wme_test/more_sta/run-wlans
Initial work on test with multiple stations
[frescor/fwp.git] / wme_test / more_sta / run-wlans
1 #!/usr/bin/perl -w
2 @run_at = qw|localhost/wlan0 localhost/wlan1 localhost/wlan2 localhost/wlan3|;
3 $dest = "192.168.1.2";
4
5 sub run {
6     my $at = shift; 
7     my ($host, $iface) = split(/\//, $run_at[$at], 2);
8     
9     @args = ();
10     push @args, ('ssh', $host) if ($host ne 'localhost');
11     push @args, ('wclient');
12     push @args, ('-I', $iface) if (defined $iface);
13     push @args, split(/ /, shift);
14     print "running ", join(' ', @args), "\n";
15     if (fork() == 0) {
16         exec(@args);
17         exit();
18     }
19 }
20
21
22 for ($tbw=20; $tbw<=20; $tbw+=10) {
23     foreach $ac(qw/VO/) {# VI BE BK
24         $params="-B $tbw -b $ac -j 50 -s 100 -c 15";
25
26         for ($i=1; $i <= @run_at; $i++) {
27             $at = 0;
28
29             run($at, $params . " -o $tbw-$ac-$i-stas $dest");
30             # Run first tasks at [0] and the remaining in 
31             for ($j=1; $j<@run_at; $j++) {
32                 if ($j > @run_at - $i) { $at++; }
33                 run($at, $params . " -o $tbw-$ac-$i-stas-$j $dest");
34             }
35             print "==================\n";
36             
37             for ($j=1; $j <= @run_at; $j++) {
38                 wait();
39             }
40             sleep(1);
41         }
42     }
43 }
44