mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 04:38:02 +00:00 
			
		
		
		
	Fix test_ipv4_ttls.py
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
		@@ -127,8 +127,9 @@ class TTLSTest(LFCliBase):
 | 
				
			|||||||
        self.station_profile.mode = 0
 | 
					        self.station_profile.mode = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Layer3 Traffic
 | 
					        # Layer3 Traffic
 | 
				
			||||||
        self.l3_cx_obj_udp = IPVariableTime(host=self.host, port=self.port,
 | 
					        self.l3_cx_obj_udp = IPVariableTime(host=self.host, port=self.port, radio=self.radio,
 | 
				
			||||||
                                            create_sta=False, sta_list=self.sta_list, traffic_type="lf_udp",
 | 
					                                            ssid=self.ssid, password=self.password, security=self.security,
 | 
				
			||||||
 | 
					                                            use_existing_sta=False, sta_list=self.sta_list, traffic_type="lf_udp",
 | 
				
			||||||
                                            upstream=self.upstream_port)
 | 
					                                            upstream=self.upstream_port)
 | 
				
			||||||
        self.l3_cx_obj_udp.cx_profile.name_prefix = "udp-"
 | 
					        self.l3_cx_obj_udp.cx_profile.name_prefix = "udp-"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -140,8 +141,9 @@ class TTLSTest(LFCliBase):
 | 
				
			|||||||
        self.l3_cx_obj_udp.cx_profile.side_b_min_pdu = 1500
 | 
					        self.l3_cx_obj_udp.cx_profile.side_b_min_pdu = 1500
 | 
				
			||||||
        self.l3_cx_obj_udp.cx_profile.report_timer = 1000
 | 
					        self.l3_cx_obj_udp.cx_profile.report_timer = 1000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.l3_cx_obj_tcp = IPVariableTime(host=self.host, port=self.port,
 | 
					        self.l3_cx_obj_tcp = IPVariableTime(host=self.host, port=self.port, radio=self.radio,
 | 
				
			||||||
                                            create_sta=False, sta_list=self.sta_list, traffic_type="lf_tcp",
 | 
					                                            ssid=self.ssid, password=self.password, security=self.security,
 | 
				
			||||||
 | 
					                                            use_existing_sta=False, sta_list=self.sta_list, traffic_type="lf_tcp",
 | 
				
			||||||
                                            upstream=self.upstream_port)
 | 
					                                            upstream=self.upstream_port)
 | 
				
			||||||
        self.l3_cx_obj_tcp.cx_profile.name_prefix = "tcp-"
 | 
					        self.l3_cx_obj_tcp.cx_profile.name_prefix = "tcp-"
 | 
				
			||||||
        self.l3_cx_obj_tcp.cx_profile.side_a_min_bps = 128000
 | 
					        self.l3_cx_obj_tcp.cx_profile.side_a_min_bps = 128000
 | 
				
			||||||
@@ -152,11 +154,13 @@ class TTLSTest(LFCliBase):
 | 
				
			|||||||
        self.l3_cx_obj_tcp.cx_profile.side_b_min_pdu = 1500
 | 
					        self.l3_cx_obj_tcp.cx_profile.side_b_min_pdu = 1500
 | 
				
			||||||
        self.l3_cx_obj_tcp.cx_profile.report_timer = 1000
 | 
					        self.l3_cx_obj_tcp.cx_profile.report_timer = 1000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def build(self, extra_securities=[]):
 | 
					    def build(self,
 | 
				
			||||||
 | 
					              extra_securities=None):
 | 
				
			||||||
        # Build stations
 | 
					        # Build stations
 | 
				
			||||||
        keyphrase = "[BLANK]"
 | 
					        keyphrase = "[BLANK]"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.station_profile.use_security(self.security, self.ssid, passwd=self.password)
 | 
					        self.station_profile.use_security(self.security, self.ssid, passwd=self.password)
 | 
				
			||||||
 | 
					        if extra_securities is not None:
 | 
				
			||||||
            for security in extra_securities:
 | 
					            for security in extra_securities:
 | 
				
			||||||
                self.station_profile.add_security_extra(security=security)
 | 
					                self.station_profile.add_security_extra(security=security)
 | 
				
			||||||
        if self.vap:
 | 
					        if self.vap:
 | 
				
			||||||
@@ -336,35 +340,23 @@ test_ipv4_ttls.py:
 | 
				
			|||||||
    --debug
 | 
					    --debug
 | 
				
			||||||
 | 
					
 | 
				
			||||||
''')
 | 
					''')
 | 
				
			||||||
    required = None
 | 
					 | 
				
			||||||
    for agroup in parser._action_groups:
 | 
					 | 
				
			||||||
        if agroup.title == "required arguments":
 | 
					 | 
				
			||||||
            required = agroup
 | 
					 | 
				
			||||||
    # if required is not None:
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    optional = None
 | 
					    parser.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
 | 
				
			||||||
    for agroup in parser._action_groups:
 | 
					    parser.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000)
 | 
				
			||||||
        if agroup.title == "optional arguments":
 | 
					    parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m")
 | 
				
			||||||
            optional = agroup
 | 
					    parser.add_argument('--key-mgmt', help="--key-mgt: { %s }" % ", ".join(realm.wpa_ent_list()), default="WPA-EAP")
 | 
				
			||||||
 | 
					    parser.add_argument('--wpa_psk', help='wpa-ent pre shared key', default="[BLANK]")
 | 
				
			||||||
    if optional is not None:
 | 
					    parser.add_argument('--eap', help='--eap eap method to use', default="TTLS")
 | 
				
			||||||
        optional.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
 | 
					    parser.add_argument('--identity', help='--identity eap identity string', default="testuser")
 | 
				
			||||||
        optional.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000)
 | 
					    parser.add_argument('--ttls_passwd', help='--ttls_passwd eap password string', default="testpasswd")
 | 
				
			||||||
        optional.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m")
 | 
					    parser.add_argument('--ttls_realm', help='--ttls_realm 802.11u home realm to use', default="localhost.localdomain")
 | 
				
			||||||
        optional.add_argument('--key-mgmt', help="--key-mgt: { %s }" % ", ".join(realm.wpa_ent_list()),
 | 
					    parser.add_argument('--domain', help='--domain 802.11 domain to use', default="localhost.localdomain")
 | 
				
			||||||
                              default="WPA-EAP")
 | 
					    parser.add_argument('--hessid', help='--hessid 802.11u HESSID (MAC addr format/peer for WDS)',
 | 
				
			||||||
        optional.add_argument('--wpa_psk', help='wpa-ent pre shared key', default="[BLANK]")
 | 
					 | 
				
			||||||
        optional.add_argument('--eap', help='--eap eap method to use', default="TTLS")
 | 
					 | 
				
			||||||
        optional.add_argument('--identity', help='--identity eap identity string', default="testuser")
 | 
					 | 
				
			||||||
        optional.add_argument('--ttls_passwd', help='--ttls_passwd eap password string', default="testpasswd")
 | 
					 | 
				
			||||||
        optional.add_argument('--ttls_realm', help='--ttls_realm 802.11u home realm to use',
 | 
					 | 
				
			||||||
                              default="localhost.localdomain")
 | 
					 | 
				
			||||||
        optional.add_argument('--domain', help='--domain 802.11 domain to use', default="localhost.localdomain")
 | 
					 | 
				
			||||||
        optional.add_argument('--hessid', help='--hessid 802.11u HESSID (MAC addr format/peer for WDS)',
 | 
					 | 
				
			||||||
                        default="00:00:00:00:00:01")
 | 
					                        default="00:00:00:00:00:01")
 | 
				
			||||||
        optional.add_argument('--ieee80211w', help='--ieee80211w <disabled(0),optional(1),required(2)', default='1')
 | 
					    parser.add_argument('--ieee80211w', help='--ieee80211w <disabled(0),optional(1),required(2)', default='1')
 | 
				
			||||||
        optional.add_argument('--use_hs20', help='use HotSpot 2.0', default=False)
 | 
					    parser.add_argument('--use_hs20', help='use HotSpot 2.0', default=False)
 | 
				
			||||||
        optional.add_argument('--enable_pkc', help='enable opportunistic PMKSA WPA2 key caching', default=False)
 | 
					    parser.add_argument('--enable_pkc', help='enable opportunistic PMKSA WPA2 key caching', default=False)
 | 
				
			||||||
 | 
					    parser.add_argument('--vap', help='Create VAP on host device', default=True)
 | 
				
			||||||
    args = parser.parse_args()
 | 
					    args = parser.parse_args()
 | 
				
			||||||
    num_sta = 2
 | 
					    num_sta = 2
 | 
				
			||||||
    if (args.num_stations is not None) and (int(args.num_stations) > 0):
 | 
					    if (args.num_stations is not None) and (int(args.num_stations) > 0):
 | 
				
			||||||
@@ -372,7 +364,8 @@ test_ipv4_ttls.py:
 | 
				
			|||||||
        num_sta = num_stations_converted
 | 
					        num_sta = num_stations_converted
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000)
 | 
					    station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000)
 | 
				
			||||||
    ttls_test = TTLSTest(host=args.mgr, port=args.mgr_port,
 | 
					    ttls_test = TTLSTest(host=args.mgr,
 | 
				
			||||||
 | 
					                         port=args.mgr_port,
 | 
				
			||||||
                         ssid=args.ssid,
 | 
					                         ssid=args.ssid,
 | 
				
			||||||
                         password=args.passwd,
 | 
					                         password=args.passwd,
 | 
				
			||||||
                         security=args.security,
 | 
					                         security=args.security,
 | 
				
			||||||
@@ -381,7 +374,7 @@ test_ipv4_ttls.py:
 | 
				
			|||||||
                         key_mgmt=args.key_mgmt,
 | 
					                         key_mgmt=args.key_mgmt,
 | 
				
			||||||
                         wpa_psk=args.wpa_psk,
 | 
					                         wpa_psk=args.wpa_psk,
 | 
				
			||||||
                         eap=args.eap,
 | 
					                         eap=args.eap,
 | 
				
			||||||
                         vap=True,
 | 
					                         vap=args.vap,
 | 
				
			||||||
                         identity=args.identity,
 | 
					                         identity=args.identity,
 | 
				
			||||||
                         ttls_passwd=args.ttls_passwd,
 | 
					                         ttls_passwd=args.ttls_passwd,
 | 
				
			||||||
                         ttls_realm=args.ttls_realm,
 | 
					                         ttls_realm=args.ttls_realm,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user