mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	wlanpro: updated cleanup for testcase 100 to include all upstream port connections
This commit is contained in:
		| @@ -31,45 +31,45 @@ use strict; | |||||||
| use Getopt::Long; | use Getopt::Long; | ||||||
| use Socket; | use Socket; | ||||||
|  |  | ||||||
| my $pld_size = 500; | our $pld_size = 500; | ||||||
| my $ssid = "wlanpro"; | our $ssid = "wlanpro"; | ||||||
| my $psk = "wlanpro_passwd"; | our $psk = "wlanpro_passwd"; | ||||||
| # Default radio setup for 523b with 2ac, 2ac2. | # Default radio setup for 523b with 2ac, 2ac2. | ||||||
| # For something like a 522 with 2 radios, set 3a, 3b to wiphy0, and | # For something like a 522 with 2 radios, set 3a, 3b to wiphy0, and | ||||||
| # 4a 4b to wiphy1. | # 4a 4b to wiphy1. | ||||||
| my $radio_3a = "wiphy0"; | our $radio_3a = "wiphy0"; | ||||||
| my $radio_3b = "wiphy1"; | our $radio_3b = "wiphy1"; | ||||||
| my $radio_4a = "wiphy2"; | our $radio_4a = "wiphy2"; | ||||||
| my $radio_4b = "wiphy3"; | our $radio_4b = "wiphy3"; | ||||||
| my $sta_max = 40; # For upload/download tests | our $sta_max = 40; # For upload/download tests | ||||||
| my $wct_sta_max = 64; # For wifi-capacity-test on single radio (4a) | our $wct_sta_max = 64; # For wifi-capacity-test on single radio (4a) | ||||||
| my $gui_host = "127.0.0.1"; # auto-wifi-cap script will not work properly if not run on same machine as GUI | our $gui_host = "127.0.0.1"; # auto-wifi-cap script will not work properly if not run on same machine as GUI | ||||||
| my $gui_port = 7777; | our $gui_port = 7777; | ||||||
| my $resource = 2; | our $resource = 2; | ||||||
| my $speed_dl_tot = 1000000000; | our $speed_dl_tot = 1000000000; | ||||||
| my $speed_ul_tot = 1000000000; | our $speed_ul_tot = 1000000000; | ||||||
| my $speed_ul_bi_tot = 200000000; # 200Mbps upload speed when in bi-directional mode | our $speed_ul_bi_tot = 200000000; # 200Mbps upload speed when in bi-directional mode | ||||||
| my $testcase = -1; | our $testcase = -1; | ||||||
| my $manager = "localhost"; | our $manager = "localhost"; | ||||||
| my $log_name = ""; | our $log_name = ""; | ||||||
|  |  | ||||||
| my $endp_type = "lf_udp"; | our $endp_type = "lf_udp"; | ||||||
| my $security = "wpa2"; | our $security = "wpa2"; | ||||||
| my $upstream_resource = 1; | our $upstream_resource = 1; | ||||||
| my $upstream_port = "eth1"; | our $upstream_port = "eth1"; | ||||||
| my $multicon = 1; | our $multicon = 1; | ||||||
| my $rest_time = 20; | our $rest_time = 20; | ||||||
| my $quiet = "yes"; | our $quiet = "yes"; | ||||||
| my $report_timer = 1000; # 1 second report timer | our $report_timer = 1000; # 1 second report timer | ||||||
| my $rpt_timer_wct = 3000; # 3-second rpt timer for wifi-capacity test | our $rpt_timer_wct = 3000; # 3-second rpt timer for wifi-capacity test | ||||||
| my $settle_timer_wct = 10000; # 10-sec wait for connections to get running before clearing and starting the test proper | our $settle_timer_wct = 10000; # 10-sec wait for connections to get running before clearing and starting the test proper | ||||||
| my $wct_duration_sec = 20; # Duration for each iteration | our $wct_duration_sec = 20; # Duration for each iteration | ||||||
| my $one_way_test_time = 30; | our $one_way_test_time = 30; | ||||||
| my $bi_test_time = 30; | our $bi_test_time = 30; | ||||||
| my $interferer_cx = "inteferer_cx"; | our $interferer_cx = "inteferer_cx"; | ||||||
| my $ip = "DHCP"; | our $ip = "DHCP"; | ||||||
| my $netmask = "255.255.0.0"; | our $netmask = "255.255.0.0"; | ||||||
| my $ipn = 0; | our $ipn = 0; | ||||||
|  |  | ||||||
| my $usage = "$0 | my $usage = "$0 | ||||||
|   [--pld_size { bytes } ] |   [--pld_size { bytes } ] | ||||||
| @@ -204,18 +204,22 @@ stop_all_cx(); | |||||||
|  |  | ||||||
| # Delete any wifi-capacity generated connections at this time, it will clean things | # Delete any wifi-capacity generated connections at this time, it will clean things | ||||||
| # up, and it will make parsing reporting data faster. | # up, and it will make parsing reporting data faster. | ||||||
|  | sub remove_cxs { | ||||||
|    my @cx_dump = `./lf_firemod.pl --mgr $manager --action do_cmd --cmd \"show_cx\"`; |    my @cx_dump = `./lf_firemod.pl --mgr $manager --action do_cmd --cmd \"show_cx\"`; | ||||||
| for ($i = 0; $i<@cx_dump; $i++) { |    for (my $i = 0; $i<@cx_dump; $i++) { | ||||||
|      my $line = $cx_dump[$i]; |      my $line = $cx_dump[$i]; | ||||||
|      chomp($line); |      chomp($line); | ||||||
|   if (($line =~ /.*CX:\s+(udp\-\-$upstream_resource\.$upstream_port\-\S+).*/) || |      #print "looking for $upstream_resource, $upstream_port **** $line ****\n"; | ||||||
|       ($line =~ /.*CX:\s+(tcp\-\-$upstream_resource\.$upstream_port\-\S+).*/)) { |      # also match udp--1.eth4-02.sta102-B | ||||||
|  |      if ($line =~ /CX:\s+((tcp|udp)\-\-$upstream_resource\.[^-]+-\S+)\b/) { | ||||||
|        my $cxn = $1; |        my $cxn = $1; | ||||||
|        $cmd = "./lf_firemod.pl --mgr $manager --action delete_cxe --cx_name $cxn"; |        $cmd = "./lf_firemod.pl --mgr $manager --action delete_cxe --cx_name $cxn"; | ||||||
|        do_cmd($cmd); |        do_cmd($cmd); | ||||||
|      } |      } | ||||||
|    } |    } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | remove_cxs(); | ||||||
| # Stop the interferer, just in case it is already running for some reason | # Stop the interferer, just in case it is already running for some reason | ||||||
| $cmd = "./lf_firemod.pl --mgr $manager --action do_cmd --cmd \"set_cx_state default_tm $interferer_cx STOPPED\""; | $cmd = "./lf_firemod.pl --mgr $manager --action do_cmd --cmd \"set_cx_state default_tm $interferer_cx STOPPED\""; | ||||||
| do_cmd($cmd); | do_cmd($cmd); | ||||||
| @@ -436,12 +440,21 @@ if ($testcase == 100) { | |||||||
|     do_cmd("$cmd\n"); |     do_cmd("$cmd\n"); | ||||||
|   } |   } | ||||||
|    |    | ||||||
|  |   for ($i = 0; $i<@stations4a; $i++) { | ||||||
|  |     my $sta_name = $stations4a[$i]; | ||||||
|  |     $cmd = "./lf_portmod.pl  --quiet $quiet --mgr $manager --resource $resource --cmd delete --port_name $sta_name"; | ||||||
|  |     do_cmd("$cmd\n"); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |  | ||||||
|   for ($i = 0; $i<@cxs; $i++) { |   for ($i = 0; $i<@cxs; $i++) { | ||||||
|     my $cxn = $cxs[$i]; |     my $cxn = $cxs[$i]; | ||||||
|     $cmd = "./lf_firemod.pl --mgr $manager --action delete_cxe --cx_name $cxn"; |     $cmd = "./lf_firemod.pl --mgr $manager --action delete_cxe --cx_name $cxn"; | ||||||
|     do_cmd($cmd); |     do_cmd($cmd); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   remove_cxs(); | ||||||
|  |  | ||||||
|   # Set radio back to full antenna capacity |   # Set radio back to full antenna capacity | ||||||
|   for ($i = 0; $i<$radio_count; $i++) { |   for ($i = 0; $i<$radio_count; $i++) { | ||||||
|     my $radio = $radios[$i]; |     my $radio = $radios[$i]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jed Reynolds
					Jed Reynolds